schnorr_sign

Function schnorr_sign 

Source
pub fn schnorr_sign(private_key: &Fq, message: &Fr) -> SchnorrSignature
Expand description

Sign a message with a Grumpkin private key using Schnorr.

The signing algorithm matches the Noir schnorr library:

  1. k = Blake2s(private_key || message) (deterministic nonce)
  2. R = k * G
  3. public_key = private_key * G
  4. e = Blake2s(pedersen_hash([R.x, public_key.x, public_key.y]) || message)
  5. s = k - private_key * e (mod Grumpkin scalar order)

Returns a SchnorrSignature containing (s, e).