@@ -833,7 +833,6 @@ impl ExpandedSecretKey {
833
833
/// This definition is loose in its parameters so that end-users of the `hazmat` module can
834
834
/// change how the `ExpandedSecretKey` is calculated and which hash function to use.
835
835
#[ allow( non_snake_case) ]
836
- #[ allow( clippy:: unwrap_used) ]
837
836
#[ inline( always) ]
838
837
pub ( crate ) fn raw_sign < CtxDigest > (
839
838
& self ,
@@ -842,48 +841,24 @@ impl ExpandedSecretKey {
842
841
) -> Signature
843
842
where
844
843
CtxDigest : Digest < OutputSize = U64 > ,
845
- {
846
- // OK unwrap, update can't fail.
847
- self . raw_sign_byupdate (
848
- |h : & mut CtxDigest | {
849
- h. update ( message) ;
850
- Ok ( ( ) )
851
- } ,
852
- verifying_key,
853
- )
854
- . unwrap ( )
855
- }
856
-
857
- /// Sign a message provided in parts. The `msg_update` closure
858
- /// will be called twice to hash the message parts.
859
- #[ allow( non_snake_case) ]
860
- #[ inline( always) ]
861
- pub ( crate ) fn raw_sign_byupdate < CtxDigest , F > (
862
- & self ,
863
- msg_update : F ,
864
- verifying_key : & VerifyingKey ,
865
- ) -> Result < Signature , SignatureError >
866
- where
867
- CtxDigest : Digest < OutputSize = U64 > ,
868
- F : Fn ( & mut CtxDigest ) -> Result < ( ) , SignatureError > ,
869
844
{
870
845
let mut h = CtxDigest :: new ( ) ;
871
846
872
847
h. update ( self . hash_prefix ) ;
873
- msg_update ( & mut h ) ? ;
848
+ h . update ( message ) ;
874
849
875
850
let r = Scalar :: from_hash ( h) ;
876
851
let R : CompressedEdwardsY = EdwardsPoint :: mul_base ( & r) . compress ( ) ;
877
852
878
853
h = CtxDigest :: new ( ) ;
879
854
h. update ( R . as_bytes ( ) ) ;
880
855
h. update ( verifying_key. as_bytes ( ) ) ;
881
- msg_update ( & mut h ) ? ;
856
+ h . update ( message ) ;
882
857
883
858
let k = Scalar :: from_hash ( h) ;
884
859
let s: Scalar = ( k * self . scalar ) + r;
885
860
886
- Ok ( InternalSignature { R , s } . into ( ) )
861
+ InternalSignature { R , s } . into ( )
887
862
}
888
863
889
864
/// The prehashed signing function for Ed25519 (i.e., Ed25519ph). `CtxDigest` is the digest
0 commit comments