From 2787151e1dda0ad7e49c2c412737e12ef71a9d3a Mon Sep 17 00:00:00 2001 From: daxpedda Date: Tue, 31 Jan 2023 23:19:48 +0100 Subject: [PATCH] Update `curve25519-dalek` (#94) --- Cargo.toml | 3 ++- src/group/ristretto.rs | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f204b95..1c6b116 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,9 @@ serde = ["generic-array/serde", "serde_"] std = ["alloc"] [dependencies] -curve25519-dalek = { version = "=4.0.0-pre.5", default-features = false, features = [ +curve25519-dalek = { version = "=4.0.0-rc.0", default-features = false, features = [ "rand_core", + "zeroize", ], optional = true } derive-where = { version = "1", features = ["zeroize-on-drop"] } digest = "0.10" diff --git a/src/group/ristretto.rs b/src/group/ristretto.rs index d2eb03e..591ad4e 100644 --- a/src/group/ristretto.rs +++ b/src/group/ristretto.rs @@ -86,11 +86,8 @@ impl Group for Ristretto255 { } fn deserialize_elem(element_bits: &[u8]) -> Result { - if element_bits.len() != 32 { - return Err(Error::Deserialization); - } - CompressedRistretto::from_slice(element_bits) + .map_err(|_| Error::Deserialization)? .decompress() .filter(|point| point != &RistrettoPoint::identity()) .ok_or(Error::Deserialization)