pub unsafe extern "C" fn ocrypto_ecdh_p256_public_key(
    pk: *mut u8,
    sk: *const u8
) -> c_int
Expand description

ECDH P-256 public key generation.

Given a secret key * sk - the corresponding public key is computed and put into * pk - .

  • pk - Generated public key.
  • sk - Secret key. Must be pre-filled with random data.

Returns 0 If * sk - is a valid secret key. Returns -1 Otherwise.

@remark * pk - may be same as * sk - . @remark To generate a valid key pair use the following code pattern: @code{.c} do get_random(sk); while (ocrypto_ecdh_p256_public_key(pk, sk)); @endcode