Function p256_cortex_m4_sys::p256_sign[][src]

pub unsafe extern "C" fn p256_sign(
    r: *mut u32,
    s: *mut u32,
    hash: *const u8,
    hashlen_in_bytes: u32,
    private_key: *const u32,
    k: *const u32
) -> bool

Creates an ECDSA signature.

The parameter “k” shall consist of a 256-bit random integer value. This random value MUST be generated from a cryptographically secure random number generator, and MUST be unique for every pair of message hash and private key.

With a small probability (~ 2^-32), this function will fail and return false for the given “k” and this function MUST in that case be called again with a new random “k”, until true is returned. This is in line with the ECDSA standard.

As an alternative to using a random “k”, “k” might be derived deterministically from the input, using a sophisticated hash construction such as RFC 6979, or e.g. by hashing the private key, message hash and a retry counter, using a secure hash function such as SHA-256.