Skip to content

Commit 9c485ca

Browse files
authored
[chore] update deps (#932)
1 parent c141d4c commit 9c485ca

31 files changed

Lines changed: 1334 additions & 1094 deletions

Cargo.lock

Lines changed: 1251 additions & 993 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deny.toml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ ignore = [
2626
# This codebase only uses RSA for signature verification with public keys,
2727
# so this vulnerability does not apply. No patched version exists yet.
2828
"RUSTSEC-2023-0071",
29-
# allow unmaintained proc-macro-error used in transitive dependencies (also in Sui)
30-
"RUSTSEC-2024-0370",
31-
# allow unmaintained instant crate used in transitive dependencies (backoff, cached, fastrand, parking_lot_*, also in Sui)
32-
"RUSTSEC-2024-0384",
33-
# allow outdated 'idna' until passkey-client crate is able to update (also in Sui)
34-
"RUSTSEC-2024-0421",
35-
# allow unmaintained derivative crate used in transitive dependencies (paste, ark-*, also in Sui)
29+
# Unmaintained derivative crate used by ark-crypto-primitives v0.4.0
3630
"RUSTSEC-2024-0388",
37-
"RUSTSEC-2024-0436"
31+
# Unmaintained paste crate used by ark dependencies
32+
"RUSTSEC-2024-0436",
33+
# tracing-subscriber ANSI escape vulnerability from ark-relations 0.4.0
34+
"RUSTSEC-2025-0055",
35+
# Unmaintained bincode (direct dependency, no safe upgrade available)
36+
"RUSTSEC-2025-0141"
3837
]
3938
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
4039
# lower than the range specified will be ignored. Note that ignored advisories
@@ -62,12 +61,11 @@ allow = [
6261
"MPL-2.0",
6362
"ISC",
6463
"CC0-1.0",
65-
"0BSD",
66-
"LicenseRef-ring",
6764
"Unlicense",
6865
"BSL-1.0",
69-
"Unicode-DFS-2016",
7066
"Unicode-3.0",
67+
"Zlib",
68+
"CDLA-Permissive-2.0",
7169
#"Apache-2.0 WITH LLVM-exception",
7270
]
7371
# The confidence threshold for detecting a license from license text.

fastcrypto-cli/src/ecvrf.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ fn execute(cmd: Command) -> Result<String, std::io::Error> {
6868
match cmd {
6969
Command::Keygen => {
7070
let keypair = ECVRFKeyPair::generate(&mut thread_rng());
71-
let sk_string =
72-
hex::encode(bcs::to_bytes(&keypair.sk).map_err(|_| {
73-
Error::new(ErrorKind::Other, "Failed to serialize secret key.")
74-
})?);
75-
let pk_string =
76-
hex::encode(bcs::to_bytes(&keypair.pk).map_err(|_| {
77-
Error::new(ErrorKind::Other, "Failed to serialize public key.")
78-
})?);
71+
let sk_string = hex::encode(
72+
bcs::to_bytes(&keypair.sk)
73+
.map_err(|_| Error::other("Failed to serialize secret key."))?,
74+
);
75+
let pk_string = hex::encode(
76+
bcs::to_bytes(&keypair.pk)
77+
.map_err(|_| Error::other("Failed to serialize public key."))?,
78+
);
7979

8080
let mut result = "Secret key: ".to_string();
8181
result.push_str(&sk_string);
@@ -135,7 +135,7 @@ fn execute(cmd: Command) -> Result<String, std::io::Error> {
135135
{
136136
return Ok("Proof verified correctly!".to_string());
137137
}
138-
Err(Error::new(ErrorKind::Other, "Proof is not correct."))
138+
Err(Error::other("Proof is not correct."))
139139
}
140140
}
141141
}

fastcrypto-cli/src/sigs_cli.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ use fastcrypto::{
1919
};
2020
use rand::rngs::StdRng;
2121
use rand::SeedableRng;
22-
use std::{
23-
io::{Error, ErrorKind},
24-
str::FromStr,
25-
};
22+
use std::{io::Error, str::FromStr};
2623
#[derive(Parser)]
2724
#[command(name = "sig-cli")]
2825
#[command(about = "Sign or verify a signature using a signature scheme", long_about = None)]
@@ -69,7 +66,7 @@ impl FromStr for SignatureScheme {
6966
"secp256r1-rec" => Ok(SignatureScheme::Secp256r1Recoverable),
7067
"bls12381-minsig" => Ok(SignatureScheme::BLS12381MinSig),
7168
"bls12381-minpk" => Ok(SignatureScheme::BLS12381MinPk),
72-
_ => Err(Error::new(ErrorKind::Other, "Invalid signature scheme.")),
69+
_ => Err(Error::other("Invalid signature scheme.")),
7370
}
7471
}
7572
}

fastcrypto-cli/src/tlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn execute(cmd: Command) -> Result<String, std::io::Error> {
218218
result.push_str(&msg);
219219
Ok(result)
220220
}
221-
None => Err(Error::new(ErrorKind::Other, "Decryption failed.")),
221+
None => Err(Error::other("Decryption failed.")),
222222
}
223223
}
224224
Command::Verify(arguments) => {

fastcrypto-cli/src/vdf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn execute(cmd: Command) -> Result<String, Error> {
126126
let vdf = DefaultVDF::new(DISCRIMINANT_3072.clone(), arguments.iterations);
127127
let (output, proof) = vdf
128128
.evaluate(&g)
129-
.map_err(|_| Error::new(ErrorKind::Other, "VDF evaluation failed"))?;
129+
.map_err(|_| Error::other("VDF evaluation failed"))?;
130130

131131
let output_string = hex::encode(bcs::to_bytes(&output).unwrap());
132132
let proof_string = hex::encode(bcs::to_bytes(&proof).unwrap());

fastcrypto-tbls/src/dkg_v1.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use zeroize::Zeroize;
2525

2626
/// Generics below use `G: GroupElement' for the group of the VSS public key, and `EG: GroupElement'
2727
/// for the group of the ECIES public key.
28-
2928
/// Party in the DKG protocol.
3029
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
3130
pub struct Party<G: GroupElement, EG: GroupElement>
@@ -161,7 +160,7 @@ where
161160
{
162161
/// 1. Create a new ECIES private key and send the public key to all parties.
163162
/// 2. After *all* parties have sent their ECIES public keys, create the (same) set of nodes.
164-
163+
///
165164
/// 3. Create a new Party instance with the ECIES private key and the set of nodes.
166165
pub fn new<R: AllowedRng>(
167166
enc_sk: ecies_v1::PrivateKey<EG>,
@@ -360,7 +359,7 @@ where
360359
///
361360
/// We split this function into two parts: process_message and merge, so that the caller can
362361
/// process messages concurrently and then merge the results.
363-
362+
///
364363
/// [process_message] processes a message and returns an intermediate object ProcessedMessage.
365364
///
366365
/// Returns error InvalidMessage if the message is invalid and should be ignored (note that we

fastcrypto-tbls/src/dl_verification.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use fastcrypto::traits::AllowedRng;
88
use std::num::NonZeroU16;
99

1010
/// Helper functions for checking relations between scalars and group elements.
11-
1211
fn dot<S: Scalar>(v1: &[S], v2: &[S]) -> S {
1312
assert_eq!(v1.len(), v2.len());
1413
v1.iter()

fastcrypto-tbls/src/polynomial.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use std::num::NonZeroU16;
1818
use std::ops::{Add, AddAssign, Div, Index, Mul, MulAssign, SubAssign};
1919

2020
/// Types
21-
2221
pub type Eval<A> = IndexedValue<A>;
2322

2423
/// A polynomial that is using a scalar for the variable x and a generic
@@ -30,7 +29,6 @@ pub type PrivatePoly<C> = Poly<<C as GroupElement>::ScalarType>;
3029
pub type PublicPoly<C> = Poly<C>;
3130

3231
/// Vector related operations.
33-
3432
impl<C: GroupElement> Poly<C> {
3533
/// Returns an upper bound for the degree of the polynomial.
3634
/// The returned number is equal to the size of the underlying coefficient vector - 1,
@@ -116,7 +114,6 @@ impl<C: GroupElement> SubAssign<Poly<C>> for Poly<C> {
116114
}
117115

118116
/// GroupElement operations.
119-
120117
impl<C: GroupElement> Poly<C> {
121118
/// Returns a polynomial with the zero element.
122119
pub fn zero() -> Self {
@@ -326,7 +323,6 @@ impl<C: GroupElement> Poly<C> {
326323
}
327324

328325
/// Scalar operations.
329-
330326
impl<C: Scalar> Poly<C> {
331327
/// Returns a new polynomial of the given degree where each coefficients is
332328
/// sampled at random from the given RNG.
@@ -691,10 +687,7 @@ impl<C: GroupElement> Iterator for PolynomialEvaluator<C> {
691687
if self.first {
692688
self.first = false;
693689
} else {
694-
self.index = match self.index.checked_add(self.step.get()) {
695-
Some(new_index) => new_index,
696-
None => return None,
697-
};
690+
self.index = self.index.checked_add(self.step.get())?;
698691
Self::iterate_state(&mut self.state);
699692
}
700693
Some(Eval {

fastcrypto-tbls/src/tests/dkg_v1_tests.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ fn test_dkg_e2e_5_parties_min_weight_2_threshold_3() {
147147
MultiRecipientEncryption::encrypt(&pk_and_msgs, &ro.extend("encs 1"), &mut thread_rng());
148148
// d2 and d3 are ignored here (emulating slow parties).
149149

150-
let all_messages = vec![msg0.clone(), msg1, msg0.clone(), msg4.clone(), msg5.clone()]; // duplicates should be ignored
150+
let all_messages = [msg0.clone(), msg1, msg0.clone(), msg4.clone(), msg5.clone()]; // duplicates should be ignored
151151

152152
// expect failure - merge() requires t messages (even if some are duplicated)
153153
let proc0 = d0.process_message(msg0.clone(), &mut thread_rng()).unwrap();
154154
assert_eq!(
155-
d0.merge(&[proc0.clone()]).err(),
155+
d0.merge(std::slice::from_ref(&proc0)).err(),
156156
Some(FastCryptoError::NotEnoughInputs)
157157
);
158158
assert_eq!(
@@ -282,7 +282,7 @@ fn test_dkg_e2e_5_parties_min_weight_2_threshold_3() {
282282
S::partial_verify(&o3.vss_pk, &MSG, &sig30).unwrap();
283283
S::partial_verify(&o3.vss_pk, &MSG, &sig31).unwrap();
284284

285-
let sigs = vec![sig00, sig30, sig31];
285+
let sigs = [sig00, sig30, sig31];
286286
let sig = S::aggregate(d0.t(), sigs.iter()).unwrap();
287287
S::verify(o0.vss_pk.c0(), &MSG, &sig).unwrap();
288288
}
@@ -520,7 +520,7 @@ fn test_test_process_confirmations() {
520520
msg3.encrypted_shares =
521521
MultiRecipientEncryption::encrypt(&pk_and_msgs, &ro.extend("encs 3"), &mut thread_rng());
522522

523-
let all_messages = vec![msg0, msg1, msg3];
523+
let all_messages = [msg0, msg1, msg3];
524524

525525
let proc_msg0 = &all_messages
526526
.iter()
@@ -721,7 +721,7 @@ fn test_serialized_message_regression() {
721721
&mut rng,
722722
);
723723

724-
let all_messages = vec![msg0.clone(), msg1, msg3];
724+
let all_messages = [msg0.clone(), msg1, msg3];
725725

726726
let proc_msg0 = &all_messages
727727
.iter()
@@ -812,7 +812,7 @@ fn test_e2e_dkg_and_key_rotation() {
812812
nizk: d2.nizk_pop_of_secret(&mut thread_rng()),
813813
};
814814

815-
let all_messages = vec![msg0, msg1, msg2]; // duplicates should be ignored
815+
let all_messages = [msg0, msg1, msg2]; // duplicates should be ignored
816816

817817
// merge() should succeed and ignore duplicates and include 1 complaint
818818
let proc_msg0 = &all_messages
@@ -879,7 +879,7 @@ fn test_e2e_dkg_and_key_rotation() {
879879
S::partial_verify(&o0.vss_pk, &MSG, &sig1).unwrap();
880880
S::partial_verify(&o0.vss_pk, &MSG, &sig2).unwrap();
881881

882-
let sigs = vec![sig0, sig1, sig2];
882+
let sigs = [sig0, sig1, sig2];
883883
let sig = S::aggregate(d0.t(), sigs.iter()).unwrap();
884884
S::verify(o0.vss_pk.c0(), &MSG, &sig).unwrap();
885885

@@ -934,7 +934,7 @@ fn test_e2e_dkg_and_key_rotation() {
934934
o0.vss_pk.eval(ShareIndex::new(1).unwrap()).value,
935935
];
936936

937-
let all_messages = vec![msg0, msg1];
937+
let all_messages = [msg0, msg1];
938938

939939
// merge() should succeed and ignore duplicates and include 1 complaint
940940
let proc_msg0 = &all_messages
@@ -1013,7 +1013,7 @@ fn test_e2e_dkg_and_key_rotation() {
10131013
S::partial_verify(&no0.vss_pk, &MSG, &sig1).unwrap();
10141014
S::partial_verify(&no0.vss_pk, &MSG, &sig2).unwrap();
10151015

1016-
let sigs = vec![sig0, sig1, sig2];
1016+
let sigs = [sig0, sig1, sig2];
10171017
let sig = S::aggregate(nd0.t(), sigs.iter()).unwrap();
10181018
S::verify(o0.vss_pk.c0(), &MSG, &sig).unwrap();
10191019
}

0 commit comments

Comments
 (0)