@@ -14,9 +14,12 @@ use crate::{EcdsaCurve, Error, Result};
1414use core:: cmp;
1515use elliptic_curve:: { FieldBytes , array:: typenum:: Unsigned } ;
1616
17- #[ cfg( feature = "arithmetic " ) ]
17+ #[ cfg( feature = "algorithm " ) ]
1818use {
19- crate :: { RecoveryId , SignatureSize } ,
19+ crate :: {
20+ RecoveryId , Signature , SignatureSize ,
21+ elliptic_curve:: { FieldBytesEncoding , array:: ArraySize } ,
22+ } ,
2023 elliptic_curve:: {
2124 CurveArithmetic , NonZeroScalar , ProjectivePoint , Scalar ,
2225 ff:: PrimeField ,
2730 } ,
2831} ;
2932
30- #[ cfg( feature = "arithmetic" ) ]
31- use crate :: {
32- Signature ,
33- elliptic_curve:: { FieldBytesEncoding , array:: ArraySize } ,
34- } ;
35-
36- #[ cfg( any( feature = "arithmetic" , feature = "digest" ) ) ]
33+ #[ cfg( feature = "digest" ) ]
3734use digest:: block_api:: EagerHash ;
3835
3936/// Bind a preferred [`Digest`] algorithm to an elliptic curve type.
@@ -102,7 +99,7 @@ pub fn bits2field<C: EcdsaCurve>(bits: &[u8]) -> Result<FieldBytes<C>> {
10299///
103100/// This will return an error if a zero-scalar was generated. It can be tried again with a
104101/// different `k`.
105- #[ cfg( feature = "arithmetic " ) ]
102+ #[ cfg( feature = "algorithm " ) ]
106103#[ allow( non_snake_case) ]
107104pub fn sign_prehashed < C > (
108105 d : & NonZeroScalar < C > ,
@@ -159,7 +156,7 @@ where
159156/// entropy `ad`.
160157///
161158/// [RFC6979]: https://datatracker.ietf.org/doc/html/rfc6979
162- #[ cfg( feature = "arithmetic " ) ]
159+ #[ cfg( feature = "algorithm " ) ]
163160pub fn sign_prehashed_rfc6979 < C , D > (
164161 d : & NonZeroScalar < C > ,
165162 z : & FieldBytes < C > ,
@@ -201,7 +198,7 @@ where
201198/// # Low-S Normalization
202199///
203200/// This is a low-level function that does *NOT* apply the `EcdsaCurve::NORMALIZE_S` checks.
204- #[ cfg( feature = "arithmetic " ) ]
201+ #[ cfg( feature = "algorithm " ) ]
205202pub fn verify_prehashed < C > (
206203 q : & ProjectivePoint < C > ,
207204 z : & FieldBytes < C > ,
0 commit comments