Trait coins_bip32::ecdsa::signature::hazmat::PrehashSigner
pub trait PrehashSigner<S> {
// Required method
fn sign_prehash(&self, prehash: &[u8]) -> Result<S, Error>;
}
Expand description
Sign the provided message prehash, returning a digital signature.
Required Methods§
fn sign_prehash(&self, prehash: &[u8]) -> Result<S, Error>
fn sign_prehash(&self, prehash: &[u8]) -> Result<S, Error>
Attempt to sign the given message digest, returning a digital signature on success, or an error if something went wrong.
The prehash
parameter should be the output of a secure cryptographic
hash function.
This API takes a prehash
byte slice as there can potentially be many
compatible lengths for the message digest for a given concrete signature
algorithm.
Allowed lengths are algorithm-dependent and up to a particular implementation to decide.
Implementations on Foreign Types§
source§impl PrehashSigner<Signature> for SigningKey
impl PrehashSigner<Signature> for SigningKey
§impl<C> PrehashSigner<Signature<C>> for SigningKey<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>,
<<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8> + Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
<<<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
impl<C> PrehashSigner<Signature<C>> for SigningKey<C>where C: PrimeCurve + CurveArithmetic + DigestPrimitive, <C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>, <<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8> + Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>, <<<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature<C>, Error>
§impl<C> PrehashSigner<(Signature<C>, RecoveryId)> for SigningKey<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>,
<<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8>,
impl<C> PrehashSigner<(Signature<C>, RecoveryId)> for SigningKey<C>where C: PrimeCurve + CurveArithmetic + DigestPrimitive, <C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>, <<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8>,
fn sign_prehash( &self, prehash: &[u8] ) -> Result<(Signature<C>, RecoveryId), Error>
§impl<C> PrehashSigner<Signature<C>> for SigningKey<C>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
<C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>,
<<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8>,
impl<C> PrehashSigner<Signature<C>> for SigningKey<C>where C: PrimeCurve + CurveArithmetic + DigestPrimitive, <C as CurveArithmetic>::Scalar: Invert<Output = CtOption<<C as CurveArithmetic>::Scalar>> + SignPrimitive<C>, <<C as Curve>::FieldBytesSize as Add<<C as Curve>::FieldBytesSize>>::Output: ArrayLength<u8>,
Sign message prehash using a deterministic ephemeral scalar (k
)
computed using the algorithm described in RFC6979 § 3.2.