Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge queue: embarking main (7685ff3) and #797 together #803

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frost-core/src/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
/// Deserialize an Identifier from a serialized buffer.
/// Returns an error if it attempts to deserialize zero.
pub fn deserialize(bytes: &[u8]) -> Result<Self, Error<C>> {
Ok(Self(SerializableScalar::deserialize(bytes)?))
Self::new(SerializableScalar::deserialize(bytes)?.0)
}
}

Expand Down
9 changes: 9 additions & 0 deletions frost-secp256k1/src/tests/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ fn check_deserialize_identity() {
let r = <Secp256K1Sha256 as Ciphersuite>::Group::deserialize(&encoded_identity);
assert_eq!(r, Err(GroupError::MalformedElement));
}

// Test if deserializing the identifier 0 fails.
// https://github.com/ZcashFoundation/frost/issues/793
#[test]
fn check_zero_identifier_deserialization() {
let arr: [u8; 32] = [0; 32];
let r = Identifier::deserialize(&arr);
assert_eq!(r, Err(Error::FieldError(FieldError::InvalidZeroScalar)));
}
Loading