File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ use elliptic_curve::{
5353 FieldBytesEncoding ,
5454 array:: Array ,
5555 bigint:: { Odd , cpubits} ,
56- consts:: U66 ,
56+ consts:: { U66 , U67 } ,
5757} ;
5858
5959cpubits ! {
@@ -106,7 +106,7 @@ impl pkcs8::AssociatedOid for NistP521 {
106106}
107107
108108/// Compressed SEC1-encoded NIST P-521 curve point.
109- pub type CompressedPoint = Array < u8 , U66 > ;
109+ pub type CompressedPoint = Array < u8 , U67 > ;
110110
111111/// NIST P-521 SEC1 encoded point.
112112pub type Sec1Point = elliptic_curve:: sec1:: Sec1Point < NistP521 > ;
@@ -135,3 +135,19 @@ impl hash2curve::OprfParameters for NistP521 {
135135 /// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.5-1>.
136136 const ID : & ' static [ u8 ] = b"P521-SHA512" ;
137137}
138+
139+ #[ cfg( test) ]
140+ mod tests {
141+ use super :: { CompressedPoint , NistP521 } ;
142+ use core:: mem:: size_of;
143+ use elliptic_curve:: sec1:: CompressedPoint as Sec1Compressed ;
144+
145+ #[ test]
146+ fn compressed_point_size_matches_sec1 ( ) {
147+ assert_eq ! ( size_of:: <CompressedPoint >( ) , 67 ) ;
148+ assert_eq ! (
149+ size_of:: <CompressedPoint >( ) ,
150+ size_of:: <Sec1Compressed <NistP521 >>( ) ,
151+ ) ;
152+ }
153+ }
You can’t perform that action at this time.
0 commit comments