Skip to content

Conversation

johanneshahn
Copy link

…()instead ofthread_rng()This pull request updates the codebase to use Rust 2021 edition, modernizes dependencies, and replaces the deprecatedthread_rngfunction with therngfunction from therand` crate. Additionally, it removes unsafe code in key deserialization and includes minor refactoring for clarity. Below are the most important changes grouped by theme:

Dependency Updates

  • Updated the Rust edition from 2018 to 2021 in Cargo.toml and fuzz/Cargo.toml for modern language features. [1] [2]
  • Upgraded rand from version 0.5 to 0.9.0 and rand_core from version 0.2 to 0.9.3 in Cargo.toml.
  • Updated libfuzzer-sys dependency from 0.3 to 0.4.9 in fuzz/Cargo.toml.

Transition to rng from thread_rng

  • Replaced all instances of thread_rng with rng across the codebase for compatibility with the updated rand crate. This includes changes in src/aggsig.rs, src/ecdh.rs, src/key.rs, and fuzz/fuzz_targets/fuzz_aggsig.rs. [1] [2] [3] [4]

Removal of Unsafe Code

  • Eliminated unsafe initialization of arrays in the Deserialize implementation for PublicKey in src/key.rs, replacing it with a safe zeroed array initialization. [1] [2]

Minor Refactoring

  • Commented out unused try_fill_bytes methods in the test module of src/key.rs for improved code clarity. [1] [2] [3]

Documentation and Constants

  • Added and clarified comments for constants related to Bulletproofs and range proofs in src/constants.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant