@@ -14,9 +14,12 @@ use crate::{EcdsaCurve, Error, Result};
14
14
use core:: cmp;
15
15
use elliptic_curve:: { FieldBytes , array:: typenum:: Unsigned } ;
16
16
17
- #[ cfg( feature = "arithmetic " ) ]
17
+ #[ cfg( feature = "algorithm " ) ]
18
18
use {
19
- crate :: { RecoveryId , SignatureSize } ,
19
+ crate :: {
20
+ RecoveryId , Signature , SignatureSize ,
21
+ elliptic_curve:: { FieldBytesEncoding , array:: ArraySize } ,
22
+ } ,
20
23
elliptic_curve:: {
21
24
CurveArithmetic , NonZeroScalar , ProjectivePoint , Scalar ,
22
25
ff:: PrimeField ,
27
30
} ,
28
31
} ;
29
32
30
- #[ cfg( feature = "arithmetic" ) ]
31
- use crate :: {
32
- Signature ,
33
- elliptic_curve:: { FieldBytesEncoding , array:: ArraySize } ,
34
- } ;
35
-
36
- #[ cfg( any( feature = "arithmetic" , feature = "digest" ) ) ]
37
- use hmac:: EagerHash ;
33
+ #[ cfg( feature = "digest" ) ]
34
+ use digest:: block_api:: EagerHash ;
38
35
39
36
/// Bind a preferred [`Digest`] algorithm to an elliptic curve type.
40
37
///
@@ -102,7 +99,7 @@ pub fn bits2field<C: EcdsaCurve>(bits: &[u8]) -> Result<FieldBytes<C>> {
102
99
///
103
100
/// This will return an error if a zero-scalar was generated. It can be tried again with a
104
101
/// different `k`.
105
- #[ cfg( feature = "arithmetic " ) ]
102
+ #[ cfg( feature = "algorithm " ) ]
106
103
#[ allow( non_snake_case) ]
107
104
pub fn sign_prehashed < C > (
108
105
d : & NonZeroScalar < C > ,
@@ -159,7 +156,7 @@ where
159
156
/// entropy `ad`.
160
157
///
161
158
/// [RFC6979]: https://datatracker.ietf.org/doc/html/rfc6979
162
- #[ cfg( feature = "arithmetic " ) ]
159
+ #[ cfg( feature = "algorithm " ) ]
163
160
pub fn sign_prehashed_rfc6979 < C , D > (
164
161
d : & NonZeroScalar < C > ,
165
162
z : & FieldBytes < C > ,
@@ -201,7 +198,7 @@ where
201
198
/// # Low-S Normalization
202
199
///
203
200
/// This is a low-level function that does *NOT* apply the `EcdsaCurve::NORMALIZE_S` checks.
204
- #[ cfg( feature = "arithmetic " ) ]
201
+ #[ cfg( feature = "algorithm " ) ]
205
202
pub fn verify_prehashed < C > (
206
203
q : & ProjectivePoint < C > ,
207
204
z : & FieldBytes < C > ,
0 commit comments