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

RSA primitives.

This group of functions is used for basic RSA arithmetic. / /@{*/ / RSA public key exponentiation. c = m^e mod n

  • c - The generated ciphertext.
  • c_len - Length of * c - .
  • m - The message to be encrypted.
  • m_len - Length of * m - .
  • pk - A valid RSA public key.
  • mem - The working memory. Length OCRYPTO_RSA_PUB_MEM_SIZE(bits).

Returns -1 If the input is too large (m >= n). 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.