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

RSA OAEP SHA256 decryption with CRT acceleration.

The ciphertext * c - is decrypted to the message returned in * m - .

  • m - The decrypted message. The buffer must be long enough to hold the message.
  • m_len - Length of * m - .
  • c - The ciphertext to decrypt.
  • c_len - Length of * c - .
  • label - The label associated with the message.
  • l_len - Length of * label - . May be 0.
  • key - A valid RSA secret key with CRT coefficients.
  • mem - The working memory. Length OCRYPTO_RSA_CRT_MEM_SIZE(bits).

Returns -1 If decryption failed. Returns -2 If the output buffer is too short (m_len < length of message). Returns n If a message of length n was successfully decrypted.

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