Lines Matching refs:k
39 static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q,
224 BIGNUM *k, *kinv = NULL, *r = *rp; in dsa_sign_setup() local
248 k = BN_new(); in dsa_sign_setup()
250 if (k == NULL || l == NULL) in dsa_sign_setup()
264 || !bn_wexpand(k, q_words + 2) in dsa_sign_setup()
273 if (!ossl_gen_deterministic_nonce_rfc6979(k, dsa->params.q, in dsa_sign_setup()
285 if (!ossl_bn_gen_dsa_nonce_fixed_top(k, dsa->params.q, in dsa_sign_setup()
290 } else if (!ossl_bn_priv_rand_range_fixed_top(k, dsa->params.q, 0, ctx)) in dsa_sign_setup()
292 } while (ossl_bn_is_word_fixed_top(k, 0)); in dsa_sign_setup()
294 BN_set_flags(k, BN_FLG_CONSTTIME); in dsa_sign_setup()
318 if (!BN_add(l, k, dsa->params.q) in dsa_sign_setup()
319 || !BN_add(k, l, dsa->params.q)) in dsa_sign_setup()
322 BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); in dsa_sign_setup()
325 if (!dsa->meth->bn_mod_exp(dsa, r, dsa->params.g, k, dsa->params.p, in dsa_sign_setup()
329 if (!BN_mod_exp_mont(r, dsa->params.g, k, dsa->params.p, ctx, in dsa_sign_setup()
338 if ((kinv = dsa_mod_inverse_fermat(k, dsa->params.q, ctx)) == NULL) in dsa_sign_setup()
350 BN_clear_free(k); in dsa_sign_setup()
483 static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, in dsa_mod_inverse_fermat() argument
496 && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) in dsa_mod_inverse_fermat()