clippy fixes (#212)

This commit is contained in:
Conrado Gouvea 2023-01-09 18:23:59 -03:00 committed by GitHub
parent ffe5c57a17
commit b5e6da8820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 17 deletions

View File

@ -544,7 +544,7 @@ pub(crate) fn generate_secret_shares<C: Ciphersuite>(
let (coefficients, commitment) =
generate_secret_polynomial(secret, max_signers, min_signers, coefficients)?;
for idx in 1..=max_signers as u16 {
for idx in 1..=max_signers {
let id = Identifier::<C>::try_from(idx)?;
let value = evaluate_polynomial(id, &coefficients);

View File

@ -73,7 +73,7 @@ fn check_sign<C: Ciphersuite + PartialEq, R: RngCore + CryptoRng>(
// Round 1: generating nonces and signing commitments for each participant
////////////////////////////////////////////////////////////////////////////
for participant_index in 1..(min_signers as u16 + 1) {
for participant_index in 1..(min_signers + 1) {
let participant_identifier = participant_index.try_into().expect("should be nonzero");
// Generate one (1) nonce and one SigningCommitments instance for each
// participant, up to _min_signers_.

View File

@ -273,10 +273,7 @@ pub fn check_sign_with_test_vectors<C: Ciphersuite>(json_vectors: &Value) {
// Round 2: each participant generates their signature share
/////////////////////////////////////////////////////////////////////////////
let signer_commitments_vec = signer_commitments
.into_iter()
.map(|(_, signing_commitments)| signing_commitments)
.collect();
let signer_commitments_vec = signer_commitments.into_values().collect();
let signing_package = frost::SigningPackage::new(signer_commitments_vec, message_bytes);

View File

@ -15,11 +15,11 @@ proptest! {
// Use a deterministic RNG so that test failures can be reproduced.
// Seeding with 64 bits of entropy is INSECURE and this code should
// not be copied outside of this test!
let mut rng = ChaChaRng::from_seed(rng_seed);
let rng = ChaChaRng::from_seed(rng_seed);
// Create a test case for each signature type.
let msg = b"test message for proptests";
let mut sig = SignatureCase::<Ed25519Sha512>::new(&mut rng, msg.to_vec());
let mut sig = SignatureCase::<Ed25519Sha512>::new(rng, msg.to_vec());
// Apply tweaks to each case.
for t in &tweaks {

View File

@ -15,11 +15,11 @@ proptest! {
// Use a deterministic RNG so that test failures can be reproduced.
// Seeding with 64 bits of entropy is INSECURE and this code should
// not be copied outside of this test!
let mut rng = ChaChaRng::from_seed(rng_seed);
let rng = ChaChaRng::from_seed(rng_seed);
// Create a test case for each signature type.
let msg = b"test message for proptests";
let mut sig = SignatureCase::<Ed448Shake256>::new(&mut rng, msg.to_vec());
let mut sig = SignatureCase::<Ed448Shake256>::new(rng, msg.to_vec());
// Apply tweaks to each case.
for t in &tweaks {

View File

@ -15,11 +15,11 @@ proptest! {
// Use a deterministic RNG so that test failures can be reproduced.
// Seeding with 64 bits of entropy is INSECURE and this code should
// not be copied outside of this test!
let mut rng = ChaChaRng::from_seed(rng_seed);
let rng = ChaChaRng::from_seed(rng_seed);
// Create a test case for each signature type.
let msg = b"test message for proptests";
let mut sig = SignatureCase::<P256Sha256>::new(&mut rng, msg.to_vec());
let mut sig = SignatureCase::<P256Sha256>::new(rng, msg.to_vec());
// Apply tweaks to each case.
for t in &tweaks {

View File

@ -42,7 +42,7 @@ pub fn check_randomized_sign_with_dealer<C: Ciphersuite, R: RngCore + CryptoRng>
// Round 1: generating nonces and signing commitments for each participant
////////////////////////////////////////////////////////////////////////////
for participant_index in 1..(min_signers as u16 + 1) {
for participant_index in 1..(min_signers + 1) {
let participant_identifier = participant_index.try_into().expect("should be nonzero");
// Generate one (1) nonce and one SigningCommitments instance for each
// participant, up to _min_signers_.

View File

@ -15,11 +15,11 @@ proptest! {
// Use a deterministic RNG so that test failures can be reproduced.
// Seeding with 64 bits of entropy is INSECURE and this code should
// not be copied outside of this test!
let mut rng = ChaChaRng::from_seed(rng_seed);
let rng = ChaChaRng::from_seed(rng_seed);
// Create a test case for each signature type.
let msg = b"test message for proptests";
let mut sig = SignatureCase::<Ristretto255Sha512>::new(&mut rng, msg.to_vec());
let mut sig = SignatureCase::<Ristretto255Sha512>::new(rng, msg.to_vec());
// Apply tweaks to each case.
for t in &tweaks {

View File

@ -15,11 +15,11 @@ proptest! {
// Use a deterministic RNG so that test failures can be reproduced.
// Seeding with 64 bits of entropy is INSECURE and this code should
// not be copied outside of this test!
let mut rng = ChaChaRng::from_seed(rng_seed);
let rng = ChaChaRng::from_seed(rng_seed);
// Create a test case for each signature type.
let msg = b"test message for proptests";
let mut sig = SignatureCase::<Secp256K1Sha256>::new(&mut rng, msg.to_vec());
let mut sig = SignatureCase::<Secp256K1Sha256>::new(rng, msg.to_vec());
// Apply tweaks to each case.
for t in &tweaks {