pub unsafe extern "C" fn ocrypto_rsa2048_init_crt_key(
    sk: *mut ocrypto_rsa2048_crt_key,
    p: *const u8,
    p_len: usize,
    q: *const u8,
    q_len: usize,
    dp: *const u8,
    dp_len: usize,
    dq: *const u8,
    dq_len: usize,
    qinv: *const u8,
    qi_len: usize
) -> c_int
Expand description

2048-bit RSA secret key setup with CRT coefficients.

  • sk - The initialized secret key.
  • p - The 1. RSA prime. Must be exactly 1024 bits.
  • p_len - Length of * p - .
  • q - The 2. RSA prime. Must be exactly 1024 bits.
  • q_len - Length of * q - .
  • dp - The 1. CRT exponent. dp = d mod (p-1).
  • dp_len - Length of * dp - .
  • dq - The 2. CRT exponent. dq = d mod (q-1).
  • dq_len - Length of * dq - .
  • qinv - The CRT coefficient. qinv = 1/q mod p.
  • qi_len - Length of * qinv - .

Returns -1 If the input length is invalid. Returns 0 On success.