aboutsummaryrefslogtreecommitdiff
path: root/crates/hashx/src/rand.rs
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-18/+22
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* 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.
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-1/+1
| | | | Made with https://crates.io/crates/typos-cli
* hashx, tor-persist: fix intra-doc link backtickshashcatHitman2025-04-161-1/+1
| | | | | | | | | | - Replaced single quotes in [`hashx::rand`] documentation link to [`hashx::rand::RngBuffer`] with backticks so it actually works. - Added a missing backtick to the link to [`tor_persist::state_dir::StateDirectory::instance_peek_storage`] in the documentation of [`tor_persist::state_dir::StateDirectory::with_instance_path_pieces`].
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-8/+0
| | | | - `try_fill_bytes()` is no longer a member of RngCore.
* tor-hspow, equix, hashx: Comment tweaksMicah Elizabeth Scott2023-07-271-14/+20
| | | | | | Making a few comment tweaks suggested in review feedback. Signed-off-by: Micah Elizabeth Scott <[email protected]>
* hashx: use RngCore for HashX's internal PRNGMicah Elizabeth Scott2023-07-271-0/+232
This refactors the random number generator used within HashX's program generator so that it uses the rand::RngCore trait. The basic SipHash powered u64 generator now implements RngCore, while a buffer layer wraps this and provides u8 and u32 values as needed by the generator. Some of this new RngCore layer is now exposed to the hashx crate's public API. The intent is to allow external code to test, benchmark, or fuzz the program generator by supplying its own random number stream. Benchmarks show a small but confusing performance improvement associated with this patch. About a 2% improvement in generation. This could be due to the Rng changes. No change in compiled hash execution performance. Even though this patch only touches program generation, benchmarks show a 4% speedup in interpreted execution. This seems most likely explained by instruction cache effects, but I'm not sure. Signed-off-by: Micah Elizabeth Scott <[email protected]>