Home | History | Annotate | Download | only in rsa

Lines Matching refs:RSA

1 /* crypto/rsa/rsa_lib.c */
11 * apply to all code found in this distribution, be it the RC4, RSA,
64 #include <openssl/rsa.h>
70 int RSA_size(const RSA *r)
76 RSA *rsa, int padding)
79 if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD)
80 && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW))
86 return(rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding));
90 RSA *rsa, int padding)
93 if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD)
94 && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW))
100 return(rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding));
104 RSA *rsa, int padding)
107 if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD)
108 && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW))
114 return(rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding));
118 RSA *rsa, int padding)
121 if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD)
122 && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW))
128 return(rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding));
131 int RSA_flags(const RSA *r)
136 void RSA_blinding_off(RSA *rsa)
138 if (rsa->blinding != NULL)
140 BN_BLINDING_free(rsa->blinding);
141 rsa->blinding=NULL;
143 rsa->flags &= ~RSA_FLAG_BLINDING;
144 rsa->flags |= RSA_FLAG_NO_BLINDING;
147 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx)
151 if (rsa->blinding != NULL)
152 RSA_blinding_off(rsa);
154 rsa->blinding = RSA_setup_blinding(rsa, ctx);
155 if (rsa->blinding == NULL)
158 rsa->flags |= RSA_FLAG_BLINDING;
159 rsa->flags &= ~RSA_FLAG_NO_BLINDING;
190 BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx)
212 if (rsa->e == NULL)
214 e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx);
222 e = rsa->e;
225 if ((RAND_status() == 0) && rsa->d != NULL && rsa->d->d != NULL)
229 RAND_add(rsa->d->d, rsa->d->dmax * sizeof rsa->d->d[0], 0.0);
232 if (!(rsa->flags & RSA_FLAG_NO_CONSTTIME))
236 BN_with_flags(n, rsa->n, BN_FLG_CONSTTIME);
239 n = rsa->n;
242 rsa->meth->bn_mod_exp, rsa->_method_mod_n);
253 if(rsa->e == NULL)