11use crate :: {
22 bls12381:: primitives:: group:: { Scalar , G1 } ,
3- ed25519,
3+ ed25519:: { self , core as ed_core } ,
44 transcript:: { Summary , Transcript } ,
55 Secret ,
66} ;
@@ -15,7 +15,7 @@ use core::{
1515 ops:: Deref ,
1616} ;
1717use curve25519_dalek:: edwards:: CompressedEdwardsY ;
18- use ed25519_consensus :: VerificationKey ;
18+ use ed_core :: VerificationKey ;
1919use rand_core:: CryptoRngCore ;
2020use sha2:: { Digest , Sha512 } ;
2121use std:: num:: NonZeroU32 ;
@@ -25,13 +25,13 @@ const PUBLIC_KEY_LENGTH: usize = 32;
2525
2626#[ derive( Clone , Debug ) ]
2727pub struct PrivateKey {
28- inner : Secret < ed25519_consensus :: SigningKey > ,
28+ inner : Secret < ed_core :: SigningKey > ,
2929}
3030
3131impl Random for PrivateKey {
3232 fn random ( rng : impl CryptoRngCore ) -> Self {
3333 Self {
34- inner : Secret :: new ( ed25519_consensus :: SigningKey :: new ( rng) ) ,
34+ inner : Secret :: new ( ed_core :: SigningKey :: new ( rng) ) ,
3535 }
3636 }
3737}
@@ -149,7 +149,7 @@ impl Read for PrivateKey {
149149
150150 fn read_cfg ( buf : & mut impl Buf , _: & ( ) ) -> Result < Self , CodecError > {
151151 let raw = Zeroizing :: new ( <[ u8 ; Self :: SIZE ] >:: read ( buf) ?) ;
152- let key = ed25519_consensus :: SigningKey :: from ( * raw) ;
152+ let key = ed_core :: SigningKey :: from ( * raw) ;
153153 Ok ( Self {
154154 inner : Secret :: new ( key) ,
155155 } )
@@ -175,7 +175,7 @@ impl crate::Verifier for PublicKey {
175175 let payload = union_unique ( namespace, msg) ;
176176 self . inner
177177 . verify (
178- & ed25519_consensus :: Signature :: from ( <[ u8 ; 64 ] >:: try_from ( sig. as_ref ( ) ) . unwrap ( ) ) ,
178+ & ed_core :: Signature :: from ( <[ u8 ; 64 ] >:: try_from ( sig. as_ref ( ) ) . unwrap ( ) ) ,
179179 & payload,
180180 )
181181 . is_ok ( )
@@ -196,7 +196,7 @@ impl Read for PublicKey {
196196 fn read_cfg ( buf : & mut impl Buf , _: & ( ) ) -> Result < Self , CodecError > {
197197 let raw = <[ u8 ; PUBLIC_KEY_LENGTH ] >:: read_cfg ( buf, & ( ) ) ?;
198198 let inner = VerificationKey :: try_from ( raw)
199- . map_err ( |e : ed25519_consensus :: Error | CodecError :: Wrapped ( "evrf" , e. into ( ) ) ) ?;
199+ . map_err ( |e : ed_core :: Error | CodecError :: Wrapped ( "evrf" , e. into ( ) ) ) ?;
200200 Ok ( Self { inner } )
201201 }
202202}
0 commit comments