Lines Matching refs:N
26 static BIGNUM *srp_Calc_xy(const BIGNUM *x, const BIGNUM *y, const BIGNUM *N, in srp_Calc_xy() argument
31 int numN = BN_num_bytes(N); in srp_Calc_xy()
38 if (x != N && BN_ucmp(x, N) >= 0) in srp_Calc_xy()
40 if (y != N && BN_ucmp(y, N) >= 0) in srp_Calc_xy()
55 static BIGNUM *srp_Calc_k(const BIGNUM *N, const BIGNUM *g, in srp_Calc_k() argument
60 return srp_Calc_xy(N, g, N, libctx, propq); in srp_Calc_k()
63 BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N, in SRP_Calc_u_ex() argument
67 return srp_Calc_xy(A, B, N, libctx, propq); in SRP_Calc_u_ex()
70 BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N) in SRP_Calc_u() argument
73 return srp_Calc_xy(A, B, N, NULL, NULL); in SRP_Calc_u()
77 const BIGNUM *b, const BIGNUM *N) in SRP_Calc_server_key() argument
82 if (u == NULL || A == NULL || v == NULL || b == NULL || N == 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()
106 BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, in SRP_Calc_B_ex() argument
113 if (b == NULL || N == NULL || g == NULL || v == NULL || in SRP_Calc_B_ex()
123 if (!BN_mod_exp(gb, g, b, N, bn_ctx) in SRP_Calc_B_ex()
124 || (k = srp_Calc_k(N, g, libctx, propq)) == NULL 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()
138 BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, in SRP_Calc_B() argument
141 return SRP_Calc_B_ex(b, N, g, v, NULL, NULL); in SRP_Calc_B()
196 BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g) in SRP_Calc_A() argument
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()
212 BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, in SRP_Calc_client_key_ex() argument
220 if (u == NULL || B == NULL || N == NULL || g == NULL || x == NULL in SRP_Calc_client_key_ex()
232 if (!BN_mod_exp(tmp, g, xtmp, N, bn_ctx)) in SRP_Calc_client_key_ex()
234 if ((k = srp_Calc_k(N, g, libctx, propq)) == NULL) 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()
245 if (K != NULL && !BN_mod_exp(K, tmp, tmp2, N, bn_ctx)) { in SRP_Calc_client_key_ex()
260 BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, in SRP_Calc_client_key() argument
263 return SRP_Calc_client_key_ex(N, B, g, x, a, u, NULL, NULL); in SRP_Calc_client_key()
266 int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N) in SRP_Verify_B_mod_N() argument
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()
287 int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N) in SRP_Verify_A_mod_N() argument
290 return SRP_Verify_B_mod_N(A, N); in SRP_Verify_A_mod_N()
309 char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N) in SRP_check_known_gN_param() argument
312 if ((g == NULL) || (N == NULL)) in SRP_check_known_gN_param()
316 if (BN_cmp(knowngN[i].g, g) == 0 && BN_cmp(knowngN[i].N, N) == 0) in SRP_check_known_gN_param()