#include
int BN_set_bit(BIGNUM *a, int n); int BN_clear_bit(BIGNUM *a, int n);
int BN_is_bit_set(const BIGNUM *a, int n);
int BN_mask_bits(BIGNUM *a, int n);
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); int BN_lshift1(BIGNUM *r, BIGNUM *a);
int BN_rshift(BIGNUM *r, BIGNUM *a, int n); int BN_rshift1(BIGNUM *r, BIGNUM *a);
_B_N___m_a_s_k___b_i_t_s_(_) truncates aa to an nn bit number ("a&=~((~0)>>n)"). An error occurs if aa already is shorter than nn bits.
_B_N___l_s_h_i_f_t_(_) shifts aa left by nn bits and places the result in rr ("r=a*2^n"). _B_N___l_s_h_i_f_t_1_(_) shifts aa left by one and places the result in rr ("r=2*a").
_B_N___r_s_h_i_f_t_(_) shifts aa right by nn bits and places the result in rr ("r=a/2^n"). _B_N___r_s_h_i_f_t_1_(_) shifts aa right by one and places the result in rr ("r=a/2").
For the shift functions, rr and aa may be the same variable.
All other functions return 1 for success, 0 on error. The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3).