k256::ecdsa::hazmat

Function sign_prehashed

Source
pub fn sign_prehashed<C, K>(
    d: &<C as CurveArithmetic>::Scalar,
    k: K,
    z: &GenericArray<u8, <C as Curve>::FieldBytesSize>,
) -> Result<(Signature<C>, RecoveryId), Error>
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.