diff --git a/p521/src/lib.rs b/p521/src/lib.rs index 0dde8b812..959d8d687 100644 --- a/p521/src/lib.rs +++ b/p521/src/lib.rs @@ -53,7 +53,7 @@ use elliptic_curve::{ FieldBytesEncoding, array::Array, bigint::{Odd, cpubits}, - consts::U66, + consts::{U66, U67}, }; cpubits! { @@ -106,7 +106,7 @@ impl pkcs8::AssociatedOid for NistP521 { } /// Compressed SEC1-encoded NIST P-521 curve point. -pub type CompressedPoint = Array; +pub type CompressedPoint = Array; /// NIST P-521 SEC1 encoded point. pub type Sec1Point = elliptic_curve::sec1::Sec1Point; @@ -135,3 +135,19 @@ impl hash2curve::OprfParameters for NistP521 { /// See . const ID: &'static [u8] = b"P521-SHA512"; } + +#[cfg(test)] +mod tests { + use super::{CompressedPoint, NistP521}; + use core::mem::size_of; + use elliptic_curve::sec1::CompressedPoint as Sec1Compressed; + + #[test] + fn compressed_point_size_matches_sec1() { + assert_eq!(size_of::(), 67); + assert_eq!( + size_of::(), + size_of::>(), + ); + } +}