Lines Matching refs:rsa
89 #include <openssl/rsa.h>
108 static int e_gmp_rsa_mod_exp(BIGNUM *r, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
330 static E_GMP_RSA_CTX *e_gmp_get_rsa(RSA *rsa)
332 E_GMP_RSA_CTX *hptr = RSA_get_ex_data(rsa, hndidx_rsa);
350 if(!bn2gmp(rsa->n, hptr->n) || !bn2gmp(rsa->e, hptr->e))
352 if(!rsa->p || !rsa->q || !rsa->d || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
357 if(!bn2gmp(rsa->d, hptr->d) || !bn2gmp(rsa->p, hptr->p) ||
358 !bn2gmp(rsa->q, hptr->q) || !bn2gmp(rsa->dmp1, hptr->dmp1) ||
359 !bn2gmp(rsa->dmq1, hptr->dmq1) || !bn2gmp(rsa->iqmp, hptr->iqmp))
362 RSA_set_ex_data(rsa, hndidx_rsa, hptr);
381 static int e_gmp_rsa_finish(RSA *rsa)
383 E_GMP_RSA_CTX *hptr = RSA_get_ex_data(rsa, hndidx_rsa);
398 RSA_set_ex_data(rsa, hndidx_rsa, NULL);
402 static int e_gmp_rsa_mod_exp(BIGNUM *r, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
407 hptr = e_gmp_get_rsa(rsa);
425 /* This is basically the CRT logic in crypto/rsa/rsa_eay.c reworded into