Skip to content

ecdsa: Remove implementations of PrehashSignature #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

carloskiki
Copy link

As discussed in RustCrypto/traits#1917.

I kept the DigestAlgorithm trait because it is still used as a bound in some places, but it could be removed. For example:

impl<C, D> DigestSigner<D, Signature<C>> for SigningKey<C>
where
    C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
    D: Digest + FixedOutput,
    Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
    SignatureSize<C>: ArraySize,
{
    fn try_sign_digest(&self, msg_digest: D) -> Result<Signature<C>> {
        self.sign_prehash(&msg_digest.finalize_fixed())
    }

Here, C: DigestAlgorithm is used, but DigestSigner is implemented for any D, not for <C as DigestAlgorithm>::Digest. Removing this trait bound would thus have no effect.

@carloskiki carloskiki changed the title remove: implementations of PrehashSignature ecdsa: Remove implementations of PrehashSignature Jun 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant