Function winternitz::sign

source ·
pub fn sign(
    privkey: &[u8],
    msg: &[u8],
    sig: &mut [u8]
) -> Result<(), &'static str>
Expand description

Sign a message msg with privkey, returning the signature.

Arguments

  • privkey is private entropy that must have length of PRIVKEY_SIZE
  • msg is the message to be signed. It may have any length.
  • sig is a mutable slice of size SIG_SIZE, which we will clobber with the signature

Danger

Calling this function more than once with the same privkey can reveal the value of privkey!

Returns

This function returns the signature Ok(()) on success, or an Err if privkey or sig is of an incorrect length.