Lines Matching refs:bn_ctx

80     BN_CTX *bn_ctx;  in SRP_Calc_server_key()  local
85 if ((bn_ctx = BN_CTX_new()) == NULL || (tmp = BN_new()) == NULL) in SRP_Calc_server_key()
90 if (!BN_mod_exp(tmp, v, u, N, bn_ctx)) in SRP_Calc_server_key()
92 if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) in SRP_Calc_server_key()
96 if (S != NULL && !BN_mod_exp(S, tmp, b, N, bn_ctx)) { in SRP_Calc_server_key()
101 BN_CTX_free(bn_ctx); in SRP_Calc_server_key()
111 BN_CTX *bn_ctx; in SRP_Calc_B_ex() local
114 (bn_ctx = BN_CTX_new_ex(libctx)) == NULL) in SRP_Calc_B_ex()
123 if (!BN_mod_exp(gb, g, b, N, bn_ctx) in SRP_Calc_B_ex()
125 || !BN_mod_mul(kv, v, k, N, bn_ctx) in SRP_Calc_B_ex()
126 || !BN_mod_add(B, gb, kv, N, bn_ctx)) { in SRP_Calc_B_ex()
131 BN_CTX_free(bn_ctx); in SRP_Calc_B_ex()
198 BN_CTX *bn_ctx; in SRP_Calc_A() local
201 if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) in SRP_Calc_A()
204 if ((A = BN_new()) != NULL && !BN_mod_exp(A, g, a, N, bn_ctx)) { in SRP_Calc_A()
208 BN_CTX_free(bn_ctx); in SRP_Calc_A()
218 BN_CTX *bn_ctx; in SRP_Calc_client_key_ex() local
221 || a == NULL || (bn_ctx = BN_CTX_new_ex(libctx)) == NULL) in SRP_Calc_client_key_ex()
232 if (!BN_mod_exp(tmp, g, xtmp, N, bn_ctx)) in SRP_Calc_client_key_ex()
236 if (!BN_mod_mul(tmp2, tmp, k, N, bn_ctx)) in SRP_Calc_client_key_ex()
238 if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx)) in SRP_Calc_client_key_ex()
240 if (!BN_mul(tmp3, u, xtmp, bn_ctx)) in SRP_Calc_client_key_ex()
245 if (K != NULL && !BN_mod_exp(K, tmp, tmp2, N, bn_ctx)) { in SRP_Calc_client_key_ex()
251 BN_CTX_free(bn_ctx); in SRP_Calc_client_key_ex()
269 BN_CTX *bn_ctx; in SRP_Verify_B_mod_N() local
272 if (B == NULL || N == NULL || (bn_ctx = BN_CTX_new()) == NULL) in SRP_Verify_B_mod_N()
278 if (!BN_nnmod(r, B, N, bn_ctx)) in SRP_Verify_B_mod_N()
282 BN_CTX_free(bn_ctx); in SRP_Verify_B_mod_N()