Skip to content

Commit 2146c15

Browse files
committed
fix rand_core dep, update Scalar from_bytes
1 parent 143174b commit 2146c15

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

rust/catalyst-voting/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ workspace = true
1212

1313
[dependencies]
1414
anyhow = "1.0.89"
15-
rand_core = "0.6.4"
15+
rand_core = { version = "0.6.4", features = ["getrandom"] }
1616
rand_chacha = "0.3.1"
1717
curve25519-dalek = { version = "4.1.3", features = ["digest", "rand_core"] }
1818
ed25519-dalek = { version = "2.1.1", features = ["rand_core"] }

rust/catalyst-voting/src/crypto/group/ristretto255/decoding.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ impl Scalar {
1414
/// # Errors
1515
/// - Cannot decode scalar.
1616
pub fn from_bytes(bytes: [u8; Self::BYTES_SIZE]) -> anyhow::Result<Scalar> {
17-
IScalar::from_canonical_bytes(bytes)
17+
Into::<Option<_>>::into(IScalar::from_canonical_bytes(bytes))
1818
.map(Scalar)
19-
.into_option()
2019
.ok_or(anyhow!("Cannot decode scalar."))
2120
}
2221

0 commit comments

Comments
 (0)