Skip to content

Commit 23623f5

Browse files
authored
ecdsa: remove implementations of PrehashSignature (#1007)
1 parent 698356e commit 23623f5

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

ecdsa/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Removed
10+
- `signature::PrehashSignature` implementation for `Signature` ([#1007])
11+
712
## 0.16.9 (2023-11-16)
813
### Changed
914
- Loosen `signature` bound to `2.0, <2.3` ([#756])

ecdsa/src/der.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,16 +393,6 @@ fn find_scalar_range(outer: &[u8], inner: &[u8]) -> Result<Range<usize>> {
393393
Ok(Range { start, end })
394394
}
395395

396-
#[cfg(all(feature = "digest", feature = "hazmat"))]
397-
impl<C> signature::PrehashSignature for Signature<C>
398-
where
399-
C: EcdsaCurve + crate::hazmat::DigestAlgorithm,
400-
MaxSize<C>: ArraySize,
401-
<FieldBytesSize<C> as Add>::Output: Add<MaxOverhead> + ArraySize,
402-
{
403-
type Digest = C::Digest;
404-
}
405-
406396
#[cfg(all(test, feature = "arithmetic"))]
407397
mod tests {
408398
use elliptic_curve::dev::MockCurve;

ecdsa/src/hazmat.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,25 @@ use {
2828
};
2929

3030
#[cfg(feature = "digest")]
31-
use {
32-
elliptic_curve::FieldBytesSize,
33-
signature::{
34-
PrehashSignature,
35-
digest::{Digest, FixedOutput, FixedOutputReset, block_api::BlockSizeUser},
36-
},
37-
};
31+
use signature::digest::{Digest, FixedOutput, FixedOutputReset, block_api::BlockSizeUser};
3832

3933
#[cfg(feature = "rfc6979")]
4034
use elliptic_curve::FieldBytesEncoding;
4135

42-
#[cfg(any(feature = "arithmetic", feature = "digest"))]
36+
#[cfg(any(feature = "arithmetic", feature = "rfc6979"))]
4337
use crate::{Signature, elliptic_curve::array::ArraySize};
4438

4539
/// Bind a preferred [`Digest`] algorithm to an elliptic curve type.
4640
///
4741
/// Generally there is a preferred variety of the SHA-2 family used with ECDSA
4842
/// for a particular elliptic curve.
49-
///
50-
/// This trait can be used to specify it, and with it receive a blanket impl of
51-
/// [`PrehashSignature`], used by [`signature_derive`][1]) for the [`Signature`]
52-
/// type for a particular elliptic curve.
53-
///
54-
/// [1]: https://github.com/RustCrypto/traits/tree/master/signature/derive
5543
#[cfg(feature = "digest")]
5644
pub trait DigestAlgorithm: EcdsaCurve {
5745
/// Preferred digest to use when computing ECDSA signatures for this
5846
/// elliptic curve. This is typically a member of the SHA-2 family.
5947
type Digest: BlockSizeUser + Digest + FixedOutput + FixedOutputReset;
6048
}
6149

62-
#[cfg(feature = "digest")]
63-
impl<C> PrehashSignature for Signature<C>
64-
where
65-
C: DigestAlgorithm,
66-
<FieldBytesSize<C> as core::ops::Add>::Output: ArraySize,
67-
{
68-
type Digest = C::Digest;
69-
}
70-
7150
/// Partial implementation of the `bits2int` function as defined in
7251
/// [RFC6979 § 2.3.2] as well as [SEC1] § 2.3.8.
7352
///

0 commit comments

Comments
 (0)