Lines Matching refs:rsa

25 int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1,  in RSA_X931_derive_ex()  argument
34 if (rsa == NULL) in RSA_X931_derive_ex()
37 ctx = BN_CTX_new_ex(rsa->libctx); in RSA_X931_derive_ex()
49 if (!rsa->e) { in RSA_X931_derive_ex()
50 rsa->e = BN_dup(e); in RSA_X931_derive_ex()
51 if (!rsa->e) in RSA_X931_derive_ex()
54 e = rsa->e; in RSA_X931_derive_ex()
62 if (Xp && rsa->p == NULL) { in RSA_X931_derive_ex()
63 rsa->p = BN_new(); in RSA_X931_derive_ex()
64 if (rsa->p == NULL) in RSA_X931_derive_ex()
67 if (!BN_X931_derive_prime_ex(rsa->p, p1, p2, in RSA_X931_derive_ex()
72 if (Xq && rsa->q == NULL) { in RSA_X931_derive_ex()
73 rsa->q = BN_new(); in RSA_X931_derive_ex()
74 if (rsa->q == NULL) in RSA_X931_derive_ex()
76 if (!BN_X931_derive_prime_ex(rsa->q, q1, q2, in RSA_X931_derive_ex()
81 if (rsa->p == NULL || rsa->q == NULL) { in RSA_X931_derive_ex()
93 rsa->n = BN_new(); in RSA_X931_derive_ex()
94 if (rsa->n == NULL) in RSA_X931_derive_ex()
96 if (!BN_mul(rsa->n, rsa->p, rsa->q, ctx)) in RSA_X931_derive_ex()
100 if (!BN_sub(r1, rsa->p, BN_value_one())) in RSA_X931_derive_ex()
102 if (!BN_sub(r2, rsa->q, BN_value_one())) in RSA_X931_derive_ex()
117 rsa->d = BN_mod_inverse(NULL, rsa->e, r0, ctx2); /* d */ in RSA_X931_derive_ex()
118 if (rsa->d == NULL) in RSA_X931_derive_ex()
122 rsa->dmp1 = BN_new(); in RSA_X931_derive_ex()
123 if (rsa->dmp1 == NULL) in RSA_X931_derive_ex()
125 if (!BN_mod(rsa->dmp1, rsa->d, r1, ctx)) in RSA_X931_derive_ex()
129 rsa->dmq1 = BN_new(); in RSA_X931_derive_ex()
130 if (rsa->dmq1 == NULL) in RSA_X931_derive_ex()
132 if (!BN_mod(rsa->dmq1, rsa->d, r2, ctx)) in RSA_X931_derive_ex()
136 rsa->iqmp = BN_mod_inverse(NULL, rsa->q, rsa->p, ctx2); in RSA_X931_derive_ex()
137 if (rsa->iqmp == NULL) in RSA_X931_derive_ex()
140 rsa->dirty_cnt++; in RSA_X931_derive_ex()
150 int RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, in RSA_X931_generate_key_ex() argument
157 ctx = BN_CTX_new_ex(rsa->libctx); in RSA_X931_generate_key_ex()
169 rsa->p = BN_new(); in RSA_X931_generate_key_ex()
170 rsa->q = BN_new(); in RSA_X931_generate_key_ex()
171 if (rsa->p == NULL || rsa->q == NULL) in RSA_X931_generate_key_ex()
176 if (!BN_X931_generate_prime_ex(rsa->p, NULL, NULL, NULL, NULL, Xp, in RSA_X931_generate_key_ex()
180 if (!BN_X931_generate_prime_ex(rsa->q, NULL, NULL, NULL, NULL, Xq, in RSA_X931_generate_key_ex()
189 if (!RSA_X931_derive_ex(rsa, NULL, NULL, NULL, NULL, in RSA_X931_generate_key_ex()
193 rsa->dirty_cnt++; in RSA_X931_generate_key_ex()