pub unsafe extern "C" fn ocrypto_rsa2048_oaep_sha256_encrypt(
    c: *mut u8,
    m: *const u8,
    mlen: usize,
    label: *const u8,
    llen: usize,
    seed: *const u8,
    pk: *const ocrypto_rsa2048_pub_key
) -> c_int
Expand description

2048-bit RSA OAEP SHA256 encryption.

The message * m - is encrypted to a ciphertext returned in * c - .

  • c - The generated 256-byte ciphertext.
  • m - The message to be encrypted.
  • mlen - Length of * m - . 0 <= mlen <= 190.
  • label - The label associated with the message.
  • llen - Length of * label - . May be 0.
  • seed - 32-byte random seed.
  • pk - A valid 2048-bit RSA public key.

Returns -1 If the message is too long (mlen > 190). Returns 0 On success.

@remark The key * pk - should be initialized with * ocrypto_rsa2048_init_pub_key - . @remark * c - may be same as * m - .