Lines Matching refs:dsa
1 /* crypto/dsa/dsa_key.c */
64 # include <openssl/dsa.h>
69 static int dsa_builtin_keygen(DSA *dsa);
71 int DSA_generate_key(DSA *dsa)
73 if (dsa->meth->dsa_keygen)
74 return dsa->meth->dsa_keygen(dsa);
75 return dsa_builtin_keygen(dsa);
78 static int dsa_builtin_keygen(DSA *dsa)
87 if (dsa->priv_key == NULL) {
91 priv_key = dsa->priv_key;
94 if (!BN_rand_range(priv_key, dsa->q))
98 if (dsa->pub_key == NULL) {
102 pub_key = dsa->pub_key;
108 if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0) {
115 if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx))
119 dsa->priv_key = priv_key;
120 dsa->pub_key = pub_key;
124 if ((pub_key != NULL) && (dsa->pub_key == NULL))
126 if ((priv_key != NULL) && (dsa->priv_key == NULL))