Function p256_cortex_m4_sys::p256_keygen[][src]

pub unsafe extern "C" fn p256_keygen(
    public_key_x: *mut u32,
    public_key_y: *mut u32,
    private_key: *const u32
) -> bool

Calculates the public key from a given private key for use by either ECDSA or ECDH.

The private key shall be taken from a random value that MUST have been generated by a cryptographically secure random number generator that generates 256 random bits. This function validates that the private key lies in the accepted range 1 to n-1, where n is the order of the elliptic curve, and returns true only if this validation succeeds. If random value is out of that range, false is returned and in this case a new random value needs to be generated and this function MUST be called again until true is returned.

The public key is created by performing a scalar multiplication of the private key and the base point of the curve.

Only use a keypair for either ECDSA or ECDH, not both, and don’t use the private key for any other purposes.