summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/pow
Commit message (Collapse)AuthorAgeFilesLines
* clippy config: Forbid TimeRangeBound::if_valid_nowIan Jackson2026-07-231-0/+1
|
* tor-checkable: Rename `TimeBound::check_valid_*` to `if_valid_*`Ian Jackson2026-07-231-1/+1
| | | | | | | I find these names confusing. To my mind "check" implies a function returning `Result<(), _>`. Some other APIs use `unwrap` here but I think `if` is good.
* Use new TimeRangeBound name throughout the treeIan Jackson2026-07-161-2/+2
|
* Use new TimeBound name throughout the treeIan Jackson2026-07-161-1/+1
|
* tor-hsclient: port to web-time-compat.Nick Mathewson2026-03-261-2/+2
|
* hsclient: Suppress unused-async warning when building without pow.Nick Mathewson2026-02-181-0/+1
| | | | | | Without this fix, it isn't possible to run clippy on higher-level crates without the hs-pow feature, since this failure stops checking earlier.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Always use full path to rand::thread_rng().Nick Mathewson2025-03-181-2/+1
| | | | | This is partly for consistency, and partly to facilitate a global search-and-replace.
* hs-pow: Use clamp for clarity.Wesley Aptekar-Cassels2024-10-091-4/+4
| | | | | | | | Instead of min/max pairs, we can use clamp. And since it's a little clearer, let's go a bit further and use the same clamp construct with a lower bound of zero in the other spot we had a min(). Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Use TimerangeBound for puzzle parameters.Wesley Aptekar-Cassels2024-10-092-29/+28
| | | | Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Effort type improvements.Wesley Aptekar-Cassels2024-10-091-10/+10
| | | | | | | | The Effort type didn't have any const constructor and we had to disassemble it to do any arithmetic. This adds a const constructor and int/float saturating arithmetic methods. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* hs-pow: Refactor to prefer stub types rather than cfg sprawl.Wesley Aptekar-Cassels2024-10-092-2/+33
| | | | | | | | | | | | | | | | | | | | | | In this design, the thin multiplexing layer between PoW types is always available when onion services are in use, but the specific pow schemes (and their dependency libraries) are gated by crate features everywhere. There are now no new cfg() gates. When the pow-v1 scheme is disabled, we can parse `pow-params v1` lines into an empty type (so clients know a PoW scheme exists that might be supported if they were configured differently). We currently don't save the contents of unknown hsdesc items. On the relaycell side, the hs ext module already sets a strong precedent for keeping unrecognized data as a byte vec, and it doesn't provide a good way to signal soft parse errors like unrecognized optional extensions. There, the `v1` type is completely optional, and services lacking a pow scheme suggested by a client would see one of these 'unrecognized' blobs. This isn't necessarily helpful but it fits the rest of the design. Co-authored-by: Micah Elizabeth Scott <[email protected]>
* tor-hspow: Big refactor, dissolve this crateWesley Aptekar-Cassels2024-10-091-0/+132
My previous strategy here was to try and centralize hspow in one crate, writing it like a self-contained feature. That introduced friction in the data types, prompting the use of simplistic types at the netdoc/cell layers and full-featured types in the optional modules. This changes tactics, dissolving the low-level parts of tor-hspow into tor-hscrypto and the high-level parts into hsclient/hsservice. Full featured types are used everywhere now, but the tradeoff is that compile-time configurability is a lot more pervasive. Anything that knows about PoW types at all needs to be fully configured out. I took this opportunity to try a more complete set of crate features, allowing users to configure individual PoW schemes. Co-authored-by: Micah Elizabeth Scott <[email protected]>