pub unsafe extern "C" fn ocrypto_rsa_oaep_sha256_encrypt(
    c: *mut u8,
    c_len: usize,
    m: *const u8,
    m_len: usize,
    label: *const u8,
    l_len: usize,
    seed: *const u8,
    pk: *const ocrypto_rsa_pub_key,
    mem: *mut u32
) -> c_int
Expand description

RSA OAEP SHA256 encryption.

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

  • c - The generated 128-byte ciphertext.
  • c_len - Length of * c - .
  • m - The message to be encrypted.
  • m_len - Length of * m - . 0 <= m_len <= key-size - 66.
  • label - The label associated with the message.
  • l_len - Length of * label - . May be 0.
  • seed - 32-byte random seed.
  • pk - A valid RSA public key.
  • mem - The working memory. Length OCRYPTO_RSA_PUB_MEM_SIZE(bits).

Returns -1 If the message is too long (m_len > key-size - 66). Returns 0 On success.

@remark The key * pk - should be initialized with * ocrypto_rsa_init_pub_key - . @remark * c - , * m - , and * mem - may be same.