• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/openssl-1.0.2h/engines/ccgost/

Lines Matching defs:dsa

13 #include <openssl/dsa.h>
53 DSA_SIG *gost_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
77 BN_mod(tmp, md, dsa->q, ctx);
86 BN_rand_range(k, dsa->q);
88 BN_mod_exp(tmp, dsa->g, k, dsa->p, ctx);
96 BN_mod(newsig->r, tmp, dsa->q, ctx);
100 BN_mod_mul(tmp, dsa->priv_key, newsig->r, dsa->q, ctx);
101 BN_mod_mul(tmp2, k, md, dsa->q, ctx);
109 BN_mod_add(newsig->s, tmp, tmp2, dsa->q, ctx);
163 DSA_SIG *sig, DSA *dsa)
177 if (BN_cmp(sig->s, dsa->q) >= 1 || BN_cmp(sig->r, dsa->q) >= 1) {
196 BN_mod(tmp, md, dsa->q, ctx);
200 BN_copy(q2, dsa->q);
202 BN_mod_exp(v, md, q2, dsa->q, ctx);
203 BN_mod_mul(z1, sig->s, v, dsa->q, ctx);
204 BN_sub(tmp, dsa->q, sig->r);
205 BN_mod_mul(z2, tmp, v, dsa->p, ctx);
206 BN_mod_exp(tmp, dsa->g, z1, dsa->p, ctx);
207 BN_mod_exp(tmp2, dsa->pub_key, z2, dsa->p, ctx);
208 BN_mod_mul(tmp3, tmp, tmp2, dsa->p, ctx);
209 BN_mod(u, tmp3, dsa->q, ctx);
228 int gost94_compute_public(DSA *dsa)
232 if (!dsa->g) {
242 dsa->pub_key = BN_new();
243 if(!dsa->pub_key) {
249 BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx);
259 int fill_GOST94_params(DSA *dsa, int nid)
269 if (dsa->p) {
270 BN_free(dsa->p);
272 dsa->p = NULL;
273 BN_dec2bn(&(dsa->p), params->p);
274 if (dsa->q) {
275 BN_free(dsa->q);
277 dsa->q = NULL;
278 BN_dec2bn(&(dsa->q), params->q);
279 if (dsa->g) {
280 BN_free(dsa->g);
282 dsa->g = NULL;
283 BN_dec2bn(&(dsa->g), params->a);
292 int gost_sign_keygen(DSA *dsa)
294 dsa->priv_key = BN_new();
295 if(!dsa->priv_key) {
299 BN_rand_range(dsa->priv_key, dsa->q);
300 return gost94_compute_public(dsa);