Trait coins_bip32::ecdsa::signature::RandomizedDigestSigner
source · [−]pub trait RandomizedDigestSigner<D, S> where
D: Digest,
S: Signature, {
fn try_sign_digest_with_rng(
&self,
rng: impl CryptoRng + RngCore,
digest: D
) -> Result<S, Error>;
fn sign_digest_with_rng(&self, rng: impl CryptoRng + RngCore, digest: D) -> S { ... }
}
Expand description
Combination of DigestSigner
and RandomizedSigner
with support for
computing a signature over a digest which requires entropy from an RNG.
Required Methods
Provided Methods
fn sign_digest_with_rng(&self, rng: impl CryptoRng + RngCore, digest: D) -> S
fn sign_digest_with_rng(&self, rng: impl CryptoRng + RngCore, digest: D) -> S
Sign the given prehashed message Digest
, returning a signature.
Panics in the event of a signing error.
Implementations on Foreign Types
sourceimpl<D> RandomizedDigestSigner<D, Signature> for SigningKey where
D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,
impl<D> RandomizedDigestSigner<D, Signature> for SigningKey where
D: Digest<OutputSize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> + FixedOutput,
impl<C, D> RandomizedDigestSigner<D, Signature<C>> for SigningKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
D: Digest<OutputSize = <<C as Curve>::UInt as ArrayEncoding>::ByteSize> + BlockSizeUser + FixedOutput + FixedOutputReset,
<C as Curve>::UInt: for<'a> From<&'a <C as ScalarArithmetic>::Scalar>,
<C as ScalarArithmetic>::Scalar: Invert,
<C as ScalarArithmetic>::Scalar: Reduce<<C as Curve>::UInt>,
<C as ScalarArithmetic>::Scalar: SignPrimitive<C>,
<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output: ArrayLength<u8>,
<<C as ScalarArithmetic>::Scalar as Invert>::Output == CtOption<<C as ScalarArithmetic>::Scalar>,
impl<C, D> RandomizedDigestSigner<D, Signature<C>> for SigningKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
D: Digest<OutputSize = <<C as Curve>::UInt as ArrayEncoding>::ByteSize> + BlockSizeUser + FixedOutput + FixedOutputReset,
<C as Curve>::UInt: for<'a> From<&'a <C as ScalarArithmetic>::Scalar>,
<C as ScalarArithmetic>::Scalar: Invert,
<C as ScalarArithmetic>::Scalar: Reduce<<C as Curve>::UInt>,
<C as ScalarArithmetic>::Scalar: SignPrimitive<C>,
<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output: ArrayLength<u8>,
<<C as ScalarArithmetic>::Scalar as Invert>::Output == CtOption<<C as ScalarArithmetic>::Scalar>,
fn try_sign_digest_with_rng(
&self,
rng: impl CryptoRng + RngCore,
msg_digest: D
) -> Result<Signature<C>, Error>
fn try_sign_digest_with_rng(
&self,
rng: impl CryptoRng + RngCore,
msg_digest: D
) -> Result<Signature<C>, Error>
Sign message prehash using an ephemeral scalar (k
) derived according
to a variant of RFC 6979 (Section 3.6) which supplies additional
entropy from an RNG.