Function p256_cortex_m4_sys::p256_ecdh_calc_shared_secret[][src]

pub unsafe extern "C" fn p256_ecdh_calc_shared_secret(
    shared_secret: *mut u8,
    private_key: *const u32,
    others_public_key_x: *const u32,
    others_public_key_y: *const u32
) -> bool

Generates the shared secret according to the ECDH standard.

The shared secret parameter will contain the big endian encoding for the x coordinate of the scalar multiplication of the private key and the input point (other’s public key), if the function succeeds.

If the other’s public key point does not lie on the curve, this function fails and false is returned. Otherwise, shared secret is calculated and true is returned.

NOTE: The return value MUST be checked since the other’s public key point cannot generally be trusted.