BN_mod_inverse 3 2003-07-24 0.9.9-dev OpenSSL

NAME

BN_mod_inverse - compute inverse modulo n

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 


 BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n,
           BN_CTX *ctx);

DESCRIPTION

_B_N___m_o_d___i_n_v_e_r_s_e_(_) computes the inverse of aa modulo nn places the result in rr ("(a*r)%n==1"). If rr is NULL, a new BBIIGGNNUUMM is created.

ccttxx is a previously allocated BBNN__CCTTXX used for temporary variables. rr may be the same BBIIGGNNUUMM as aa or nn.

RETURN VALUES

_B_N___m_o_d___i_n_v_e_r_s_e_(_) returns the BBIIGGNNUUMM containing the inverse, and NULL on error. The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3).

SEE ALSO

_o_p_e_n_s_s_l___b_n(3), _E_R_R___g_e_t___e_r_r_o_r(3), _B_N___a_d_d(3)

HISTORY

_B_N___m_o_d___i_n_v_e_r_s_e_(_) is available in all versions of SSLeay and OpenSSL.