Skip to content

Commit

Permalink
Check that the serialization constant is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeickert committed Apr 1, 2024
1 parent 8eea17f commit ba917b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/range_proof.rs
Expand Up @@ -1314,6 +1314,13 @@ mod tests {
BulletproofGens,
};

#[test]
fn test_serialized_element_size() {
// Check that the serialized proof element size constant is correct (at least for Ristretto)
assert_eq!(RistrettoPoint::identity().compress().as_bytes().len(), SERIALIZED_ELEMENT_SIZE);
assert_eq!(Scalar::ZERO.as_bytes().len(), SERIALIZED_ELEMENT_SIZE);
}

#[test]
fn test_from_bytes() {
assert!((RistrettoRangeProof::from_bytes(&[])).is_err());
Expand Down

0 comments on commit ba917b9

Please sign in to comment.