@@ -47,7 +47,7 @@ pub(crate) mod montgomery;
4747#[ cfg( feature = "signing" ) ]
4848pub ( crate ) mod sign;
4949
50- pub ( crate ) use field:: { GOLDILOCKS_BASE_POINT , TWISTED_EDWARDS_BASE_POINT } ;
50+ pub ( crate ) use field:: { FieldElement , GOLDILOCKS_BASE_POINT , TWISTED_EDWARDS_BASE_POINT } ;
5151
5252pub use decaf:: {
5353 AffinePoint as DecafAffinePoint , CompressedDecaf , DecafPoint , DecafScalar , DecafScalarBytes ,
@@ -57,18 +57,18 @@ pub use edwards::{
5757 AffinePoint , CompressedEdwardsY , EdwardsPoint , EdwardsScalar , EdwardsScalarBytes ,
5858 WideEdwardsScalarBytes ,
5959} ;
60- pub use field:: { MODULUS_LIMBS , ORDER , Scalar , WIDE_ORDER } ;
60+ pub use field:: { Decaf448Map , Elligator2 , MODULUS_LIMBS , ORDER , Scalar , WIDE_ORDER } ;
6161pub use montgomery:: { MontgomeryPoint , ProjectiveMontgomeryPoint } ;
6262#[ cfg( feature = "signing" ) ]
6363pub use sign:: * ;
6464
6565use elliptic_curve:: {
6666 Curve , FieldBytesEncoding , PrimeCurve ,
67- array:: typenum:: { U56 , U57 } ,
67+ array:: typenum:: { U28 , U56 , U57 , U84 } ,
6868 bigint:: { ArrayEncoding , Odd , U448 } ,
6969 point:: PointCompression ,
7070} ;
71- use hash2curve:: { ExpandMsgXof , GroupDigest } ;
71+ use hash2curve:: { ExpandMsgXof , GroupDigest , HashToCurve } ;
7272use sha3:: Shake256 ;
7373
7474/// Edwards448 curve.
@@ -116,11 +116,18 @@ impl elliptic_curve::CurveArithmetic for Ed448 {
116116 type Scalar = EdwardsScalar ;
117117}
118118
119+ impl HashToCurve for Ed448 {
120+ type SecurityLevel = U28 ;
121+ type FieldElement = FieldElement ;
122+ type Length = U84 ;
123+ }
124+
119125impl GroupDigest for Ed448 {
120126 const HASH_TO_CURVE_ID : & [ u8 ] = b"edwards448_XOF:SHAKE256_ELL2_RO_" ;
121127 const ENCODE_TO_CURVE_ID : & [ u8 ] = b"edwards448_XOF:SHAKE256_ELL2_NU_" ;
122128
123129 type ExpandMsg = ExpandMsgXof < Shake256 > ;
130+ type MapToCurve = Elligator2 ;
124131}
125132
126133/// Decaf448 curve.
@@ -168,9 +175,16 @@ impl elliptic_curve::CurveArithmetic for Decaf448 {
168175 type Scalar = DecafScalar ;
169176}
170177
178+ impl HashToCurve for Decaf448 {
179+ type SecurityLevel = U28 ;
180+ type FieldElement = FieldElement ;
181+ type Length = U56 ;
182+ }
183+
171184impl GroupDigest for Decaf448 {
172185 const HASH_TO_CURVE_ID : & [ u8 ] = b"decaf448_XOF:SHAKE256_D448MAP_RO_" ;
173186 const ENCODE_TO_CURVE_ID : & [ u8 ] = b"decaf448_XOF:SHAKE256_D448MAP_NU_" ;
174187
175188 type ExpandMsg = ExpandMsgXof < Shake256 > ;
189+ type MapToCurve = Decaf448Map ;
176190}
0 commit comments