Lines Matching refs:rsa
1 /* $NetBSD: rsa-gmp.c,v 1.2 2017/01/28 21:31:47 christos Exp $ */
41 #include <rsa.h>
122 unsigned char* to, RSA* rsa, int padding)
131 size = RSA_size(rsa);
136 BN2mpz(n, rsa->n);
137 BN2mpz(e, rsa->e);
190 unsigned char* to, RSA* rsa, int padding)
199 if (flen > RSA_size(rsa))
202 BN2mpz(n, rsa->n);
203 BN2mpz(e, rsa->e);
233 assert(size <= RSA_size(rsa));
257 unsigned char* to, RSA* rsa, int padding)
266 size = RSA_size(rsa);
281 BN2mpz(n, rsa->n);
282 BN2mpz(e, rsa->e);
297 if (rsa->p && rsa->q && rsa->dmp1 && rsa->dmq1 && rsa->iqmp) {
300 BN2mpz(p, rsa->p);
301 BN2mpz(q, rsa->q);
302 BN2mpz(dmp1, rsa->dmp1);
303 BN2mpz(dmq1, rsa->dmq1);
304 BN2mpz(iqmp, rsa->iqmp);
316 BN2mpz(d, rsa->d);
338 unsigned char* to, RSA* rsa, int padding)
347 size = RSA_size(rsa);
354 BN2mpz(n, rsa->n);
355 BN2mpz(e, rsa->e);
365 if (rsa->p && rsa->q && rsa->dmp1 && rsa->dmq1 && rsa->iqmp) {
368 BN2mpz(p, rsa->p);
369 BN2mpz(q, rsa->q);
370 BN2mpz(dmp1, rsa->dmp1);
371 BN2mpz(dmq1, rsa->dmq1);
372 BN2mpz(iqmp, rsa->iqmp);
390 BN2mpz(d, rsa->d);
445 gmp_rsa_generate_key(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
517 rsa->e = mpz2BN(el);
518 rsa->p = mpz2BN(p);
519 rsa->q = mpz2BN(q);
520 rsa->n = mpz2BN(n);
521 rsa->d = mpz2BN(d);
522 rsa->dmp1 = mpz2BN(dmp1);
523 rsa->dmq1 = mpz2BN(dmq1);
524 rsa->iqmp = mpz2BN(iqmp);
544 gmp_rsa_init(RSA *rsa)
550 gmp_rsa_finish(RSA *rsa)