diff --git a/src/ristretto/ristretto_keys.rs b/src/ristretto/ristretto_keys.rs index 572f4d14..c70454cb 100644 --- a/src/ristretto/ristretto_keys.rs +++ b/src/ristretto/ristretto_keys.rs @@ -270,7 +270,8 @@ impl borsh::BorshSerialize for RistrettoPublicKey { #[cfg(feature = "borsh")] impl borsh::BorshDeserialize for RistrettoPublicKey { fn deserialize(buf: &mut &[u8]) -> io::Result { - Self::from_bytes(buf).map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e.to_string())) + let bytes: [u8; 32] = borsh::BorshDeserialize::deserialize(buf)?; + Self::from_bytes(&bytes).map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e.to_string())) } }