BN_BLINDING_new(3) OpenSSL BN_BLINDING_new(3) NNAAMMEE BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_con- vert, BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLIND- ING_invert_ex, BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_get_flags, BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM functions. SSYYNNOOPPSSIISS #include BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); void BN_BLINDING_free(BN_BLINDING *b); int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx); int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx); #ifndef OPENSSL_NO_DEPRECATED unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); #endif CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx); DDEESSCCRRIIPPTTIIOONN _B_N___B_L_I_N_D_I_N_G___n_e_w_(_) allocates a new BBNN__BBLLIINNDDIINNGG structure and copies the AA and AAii values into the newly created BBNN__BBLLIINNDDIINNGG object. _B_N___B_L_I_N_D_I_N_G___f_r_e_e_(_) frees the BBNN__BBLLIINNDDIINNGG structure. _B_N___B_L_I_N_D_I_N_G___u_p_d_a_t_e_(_) updates the BBNN__BBLLIINNDDIINNGG parameters by squaring the AA and AAii or, after specific number of uses and if the necessary parame- ters are set, by re-creating the blinding parameters. _B_N___B_L_I_N_D_I_N_G___c_o_n_v_e_r_t___e_x_(_) multiplies nn with the blinding factor AA. If rr is not NULL a copy the inverse blinding factor AAii will be returned in rr (this is useful if a RRSSAA object is shared among several threads). _B_N___B_L_I_N_D_I_N_G___i_n_v_e_r_t___e_x_(_) multiplies nn with the inverse blinding factor AAii. If rr is not NULL it will be used as the inverse blinding. _B_N___B_L_I_N_D_I_N_G___c_o_n_v_e_r_t_(_) and _B_N___B_L_I_N_D_I_N_G___i_n_v_e_r_t_(_) are wrapper functions for _B_N___B_L_I_N_D_I_N_G___c_o_n_v_e_r_t___e_x_(_) and _B_N___B_L_I_N_D_I_N_G___i_n_v_e_r_t___e_x_(_) with rr set to NULL. _B_N___B_L_I_N_D_I_N_G___t_h_r_e_a_d___i_d_(_) provides access to the CCRRYYPPTTOO__TTHHRREEAADDIIDD object within the BBNN__BBLLIINNDDIINNGG structure. This is to help users provide proper locking if needed for multi-threaded use. The "thread id" object of a newly allocated BBNN__BBLLIINNDDIINNGG structure is initialised to the thread id in which _B_N___B_L_I_N_D_I_N_G___n_e_w_(_) was called. _B_N___B_L_I_N_D_I_N_G___g_e_t___f_l_a_g_s_(_) returns the BN_BLINDING flags. Currently there are two supported flags: BBNN__BBLLIINNDDIINNGG__NNOO__UUPPDDAATTEE and BBNN__BBLLIINNDD-- IINNGG__NNOO__RREECCRREEAATTEE. BBNN__BBLLIINNDDIINNGG__NNOO__UUPPDDAATTEE inhibits the automatic update of the BBNN__BBLLIINNDDIINNGG parameters after each use and BBNN__BBLLIINNDDIINNGG__NNOO__RREECCRREEAATTEE inhibits the automatic re-creation of the BBNN__BBLLIINNDDIINNGG parameters after a fixed number of uses (currently 32). In newly allocated BBNN__BBLLIINNDDIINNGG objects no flags are set. _B_N___B_L_I_N_D_I_N_G___s_e_t___f_l_a_g_s_(_) sets the BBNN__BBLLIINNDDIINNGG parameters flags. _B_N___B_L_I_N_D_I_N_G___c_r_e_a_t_e___p_a_r_a_m_(_) creates new BBNN__BBLLIINNDDIINNGG parameters using the exponent ee and the modulus mm. bbnn__mmoodd__eexxpp and mm__ccttxx can be used to pass special functions for exponentiation (normally _B_N___m_o_d___e_x_p___m_o_n_t_(_) and BBNN__MMOONNTT__CCTTXX). RREETTUURRNN VVAALLUUEESS _B_N___B_L_I_N_D_I_N_G___n_e_w_(_) returns the newly allocated BBNN__BBLLIINNDDIINNGG structure or NULL in case of an error. _B_N___B_L_I_N_D_I_N_G___u_p_d_a_t_e_(_), _B_N___B_L_I_N_D_I_N_G___c_o_n_v_e_r_t_(_), _B_N___B_L_I_N_D_I_N_G___i_n_v_e_r_t_(_), _B_N___B_L_I_N_D_I_N_G___c_o_n_v_e_r_t___e_x_(_) and _B_N___B_L_I_N_D_I_N_G___i_n_v_e_r_t___e_x_(_) return 1 on suc- cess and 0 if an error occured. _B_N___B_L_I_N_D_I_N_G___t_h_r_e_a_d___i_d_(_) returns a pointer to the thread id object within a BBNN__BBLLIINNDDIINNGG object. _B_N___B_L_I_N_D_I_N_G___g_e_t___f_l_a_g_s_(_) returns the currently set BBNN__BBLLIINNDDIINNGG flags (a uunnssiiggnneedd lloonngg value). _B_N___B_L_I_N_D_I_N_G___c_r_e_a_t_e___p_a_r_a_m_(_) returns the newly created BBNN__BBLLIINNDDIINNGG param- eters or NULL on error. SSEEEE AALLSSOO _b_n(3) HHIISSTTOORRYY BN_BLINDING_thread_id was first introduced in OpenSSL 1.0.0, and it deprecates BN_BLINDING_set_thread_id and BN_BLINDING_get_thread_id. BN_BLINDING_convert_ex, BN_BLINDIND_invert_ex, BN_BLIND- ING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_set_flags, BN_BLINDING_get_flags and BN_BLINDING_create_param were first intro- duced in OpenSSL 0.9.8 AAUUTTHHOORR Nils Larsch for the OpenSSL project (http://www.openssl.org). 1.0.1u 2016-09-22 BN_BLINDING_new(3)