ecdsa::hazmat

Function sign_prehashed

Source
pub fn sign_prehashed<C, K>(
    d: &Scalar<C>,
    k: K,
    z: &FieldBytes<C>,
) -> Result<(Signature<C>, RecoveryId)>
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.