@@ -85,9 +85,6 @@ use hybrid_array::{
8585use module_lattice:: Truncate ;
8686use sha3:: Shake256 ;
8787
88- #[ cfg( feature = "rand_core" ) ]
89- use signature:: rand_core:: CryptoRng ;
90-
9188/// A 32-byte array, defined here for brevity because it is used several times
9289pub type B32 = Array < u8 , U32 > ;
9390
@@ -258,47 +255,6 @@ impl ParameterSet for MlDsa87 {
258255 const TAU : usize = 60 ;
259256}
260257
261- /// A parameter set that knows how to generate key pairs.
262- #[ deprecated(
263- since = "0.1.0" ,
264- note = "use the `KeyInit` or `Generate` traits instead"
265- ) ]
266- pub trait KeyGen : MlDsaParams {
267- /// The type that is returned by key generation
268- type KeyPair : Keypair ;
269-
270- /// Generate a signing key pair from the specified RNG
271- #[ cfg( feature = "rand_core" ) ]
272- fn key_gen < R : CryptoRng + ?Sized > ( rng : & mut R ) -> Self :: KeyPair ;
273-
274- /// Deterministically generate a signing key pair from the specified seed
275- ///
276- /// This method reflects the ML-DSA.KeyGen_internal algorithm from FIPS 204.
277- fn from_seed ( xi : & B32 ) -> Self :: KeyPair ;
278- }
279-
280- #[ allow( deprecated, reason = "deprecated impl block" ) ]
281- impl < P > KeyGen for P
282- where
283- P : MlDsaParams ,
284- {
285- type KeyPair = SigningKey < P > ;
286-
287- /// Generate a signing key pair from the specified RNG
288- #[ cfg( feature = "rand_core" ) ]
289- fn key_gen < R : CryptoRng + ?Sized > ( rng : & mut R ) -> SigningKey < P > {
290- let mut xi = B32 :: default ( ) ;
291- rng. fill_bytes ( & mut xi) ;
292- Self :: from_seed ( & xi)
293- }
294-
295- /// Deterministically generate a signing key pair from the specified seed
296- // Algorithm 6 ML-DSA.KeyGen_internal
297- fn from_seed ( seed : & Seed ) -> SigningKey < P > {
298- SigningKey :: from_seed ( seed)
299- }
300- }
301-
302258/// Type which opportunistically uses `Box` when the `alloc` feature is available but falls back to
303259/// a stack-allocated type when it's unavailable.
304260#[ derive( Clone , Debug , PartialEq ) ]
0 commit comments