Function ecdsa::hazmat::sign_prehashed

source ·
pub fn sign_prehashed<C, K>(
    d: &Scalar<C>,
    k: K,
    z: &FieldBytes<C>,
) -> Result<(Signature<C>, RecoveryId)>
where C: PrimeCurve + CurveArithmetic, K: AsRef<Scalar<C>> + Invert<Output = CtOption<Scalar<C>>>, SignatureSize<C>: ArrayLength<u8>,
Available on crate features hazmat and arithmetic only.
Expand description

Sign a prehashed message digest using the provided secret scalar and ephemeral scalar, returning an ECDSA signature.

Accepts the following arguments:

  • d: signing key. MUST BE UNIFORMLY RANDOM!!!
  • k: ephemeral scalar value. MUST BE UNIFORMLY RANDOM!!!
  • z: message digest to be signed. MUST BE OUTPUT OF A CRYPTOGRAPHICALLY SECURE DIGEST ALGORITHM!!!

§Returns

ECDSA Signature and, when possible/desired, a RecoveryId which can be used to recover the verifying key for a given signature.