diff --git a/src/range_proof.rs b/src/range_proof.rs index dd59e81..c353389 100644 --- a/src/range_proof.rs +++ b/src/range_proof.rs @@ -1314,6 +1314,16 @@ 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());