BN_set_bit(3) OpenSSL BN_set_bit(3) NNAAMMEE BN_set_bit, BN_clear_bit, BN_is_bit_set, BN_mask_bits, BN_lshift, BN_lshift1, BN_rshift, BN_rshift1 - bit operations on BIGNUMs SSYYNNOOPPSSIISS #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); DDEESSCCRRIIPPTTIIOONN _B_N___s_e_t___b_i_t_(_) sets bit nn in aa to 1 ("a|=(1<>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"). Note that nn must be non-negative. _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"). Note that nn must be non-negative. _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. RREETTUURRNN VVAALLUUEESS _B_N___i_s___b_i_t___s_e_t_(_) returns 1 if the bit is set, 0 otherwise. 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). SSEEEE AALLSSOO _b_n(3), _B_N___n_u_m___b_y_t_e_s(3), _B_N___a_d_d(3) HHIISSTTOORRYY _B_N___s_e_t___b_i_t_(_), _B_N___c_l_e_a_r___b_i_t_(_), _B_N___i_s___b_i_t___s_e_t_(_), _B_N___m_a_s_k___b_i_t_s_(_), _B_N___l_s_h_i_f_t_(_), _B_N___l_s_h_i_f_t_1_(_), _B_N___r_s_h_i_f_t_(_), and _B_N___r_s_h_i_f_t_1_(_) are available in all versions of SSLeay and OpenSSL. 1.0.2u 2019-12-20 BN_set_bit(3)