Lines Matching refs:dsa
22 static int dsa_precheck_params(const DSA *dsa, int *ret) in dsa_precheck_params() argument
24 if (dsa->params.p == NULL || dsa->params.q == NULL) { in dsa_precheck_params()
30 if (BN_num_bits(dsa->params.p) > OPENSSL_DSA_MAX_MODULUS_BITS) { in dsa_precheck_params()
36 if (BN_num_bits(dsa->params.q) >= BN_num_bits(dsa->params.p)) { in dsa_precheck_params()
45 int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret) in ossl_dsa_check_params() argument
47 if (!dsa_precheck_params(dsa, ret)) in ossl_dsa_check_params()
51 return ossl_ffc_params_simple_validate(dsa->libctx, &dsa->params, in ossl_dsa_check_params()
59 return ossl_ffc_params_full_validate(dsa->libctx, &dsa->params, in ossl_dsa_check_params()
66 int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) in ossl_dsa_check_pub_key() argument
68 if (!dsa_precheck_params(dsa, ret)) in ossl_dsa_check_pub_key()
71 return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret) in ossl_dsa_check_pub_key()
80 int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) in ossl_dsa_check_pub_key_partial() argument
82 if (!dsa_precheck_params(dsa, ret)) in ossl_dsa_check_pub_key_partial()
85 return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret) in ossl_dsa_check_pub_key_partial()
89 int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) in ossl_dsa_check_priv_key() argument
93 if (!dsa_precheck_params(dsa, ret)) in ossl_dsa_check_priv_key()
96 return ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret); in ossl_dsa_check_priv_key()
103 int ossl_dsa_check_pairwise(const DSA *dsa) in ossl_dsa_check_pairwise() argument
109 if (!dsa_precheck_params(dsa, &ret)) in ossl_dsa_check_pairwise()
112 if (dsa->params.g == NULL in ossl_dsa_check_pairwise()
113 || dsa->priv_key == NULL in ossl_dsa_check_pairwise()
114 || dsa->pub_key == NULL) in ossl_dsa_check_pairwise()
117 ctx = BN_CTX_new_ex(dsa->libctx); in ossl_dsa_check_pairwise()
125 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) in ossl_dsa_check_pairwise()
128 ret = BN_cmp(pub_key, dsa->pub_key) == 0; in ossl_dsa_check_pairwise()