/openssl/crypto/dsa/ |
H A D | dsa_ossl.c | 37 static int dsa_init(DSA *dsa); 88 if (dsa->params.p == NULL in ossl_dsa_do_sign_int() 156 if (!BN_mod_mul(tmp, blind, dsa->priv_key, dsa->params.q, ctx)) in ossl_dsa_do_sign_int() 229 if (!dsa->params.p || !dsa->params.q || !dsa->params.g) { in dsa_sign_setup() 299 dsa->lock, dsa->params.p, ctx)) 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() 429 dsa->lock, dsa->params.p, ctx); in dsa_do_verify() 435 if (!dsa->meth->dsa_mod_exp(dsa, t1, dsa->params.g, u1, dsa->pub_key, u2, in dsa_do_verify() 439 if (!BN_mod_exp2_mont(t1, dsa->params.g, u1, dsa->pub_key, u2, in dsa_do_verify() [all …]
|
H A D | dsa_check.c | 24 if (dsa->params.p == NULL || dsa->params.q == NULL) { in dsa_precheck_params() 36 if (BN_num_bits(dsa->params.q) >= BN_num_bits(dsa->params.p)) { in dsa_precheck_params() 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() 68 if (!dsa_precheck_params(dsa, ret)) in ossl_dsa_check_pub_key() 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() [all …]
|
H A D | dsa_key.c | 31 static int dsa_keygen(DSA *dsa); 33 int DSA_generate_key(DSA *dsa) in DSA_generate_key() argument 37 return dsa->meth->dsa_keygen(dsa); in DSA_generate_key() 39 return dsa_keygen(dsa); in DSA_generate_key() 53 if (!BN_mod_exp(pub_key, dsa->params.g, prk, dsa->params.p, ctx)) in ossl_dsa_generate_public_key() 93 if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key2)) in dsa_keygen_knownanswer_test() 147 static int dsa_keygen(DSA *dsa) in dsa_keygen() argument 164 if (!ossl_ffc_params_simple_validate(dsa->libctx, &dsa->params, in dsa_keygen() 188 dsa->priv_key = priv_key; in dsa_keygen() 189 dsa->pub_key = pub_key; in dsa_keygen() [all …]
|
H A D | dsa_ameth.c | 39 DSA *dsa = NULL; in dsa_pub_decode() local 82 DSA_free(dsa); in dsa_pub_decode() 89 DSA *dsa; in dsa_pub_encode() local 97 dsa = pkey->pkey.dsa; in dsa_pub_encode() 235 DSA *dsa; in dsa_missing_parameters() local 236 dsa = pkey->pkey.dsa; in dsa_missing_parameters() 323 DSA *dsa; in dsa_param_decode() local 359 DSA *dsa; in old_dsa_priv_decode() local 433 DSA *dsa = from->pkey.dsa; in dsa_pkey_export_to() local 435 const BIGNUM *p = DSA_get0_p(dsa), *g = DSA_get0_g(dsa); in dsa_pkey_export_to() [all …]
|
H A D | dsa_gen.c | 26 int ossl_dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits, in ossl_dsa_generate_ffc_parameters() argument 33 ret = ossl_ffc_params_FIPS186_2_generate(dsa->libctx, &dsa->params, in ossl_dsa_generate_ffc_parameters() 38 ret = ossl_ffc_params_FIPS186_4_generate(dsa->libctx, &dsa->params, in ossl_dsa_generate_ffc_parameters() 42 dsa->dirty_cnt++; in ossl_dsa_generate_ffc_parameters() 47 int DSA_generate_parameters_ex(DSA *dsa, int bits, in DSA_generate_parameters_ex() argument 52 if (dsa->meth->dsa_paramgen) in DSA_generate_parameters_ex() 53 return dsa->meth->dsa_paramgen(dsa, bits, seed_in, seed_len, in DSA_generate_parameters_ex() 56 && !ossl_ffc_params_set_validate_params(&dsa->params, seed_in, seed_len, in DSA_generate_parameters_ex() 62 if (!ossl_dsa_generate_ffc_parameters(dsa, DSA_PARAMGEN_TYPE_FIPS_186_2, in DSA_generate_parameters_ex() 72 *counter_ret = dsa->params.pcounter; in DSA_generate_parameters_ex() [all …]
|
H A D | dsa_backend.c | 36 if (dsa == NULL) in ossl_dsa_key_fromdata() 66 int ossl_dsa_is_foreign(const DSA *dsa) in ossl_dsa_is_foreign() argument 69 if (dsa->engine != NULL || DSA_get_method((DSA *)dsa) != DSA_OpenSSL()) in ossl_dsa_is_foreign() 87 if (ossl_dsa_is_foreign(dsa)) in ossl_dsa_dup() 97 dupkey->flags = dsa->flags; in ossl_dsa_dup() 137 DSA *dsa = NULL; in ossl_dsa_key_from_pkcs8() local 169 dsa_p = DSA_get0_p(dsa); in ossl_dsa_key_from_pkcs8() 170 dsa_g = DSA_get0_g(dsa); in ossl_dsa_key_from_pkcs8() 188 DSA_free(dsa); in ossl_dsa_key_from_pkcs8() 189 dsa = NULL; in ossl_dsa_key_from_pkcs8() [all …]
|
H A D | dsa_sign.c | 22 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) in DSA_do_sign() argument 24 return dsa->meth->dsa_do_sign(dgst, dlen, dsa); in DSA_do_sign() 30 return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); in DSA_sign_setup() 119 int DSA_size(const DSA *dsa) in DSA_size() argument 124 if (dsa->params.q != NULL) { in DSA_size() 125 sig.r = sig.s = dsa->params.q; in DSA_size() 161 *siglen = DSA_size(dsa); in ossl_dsa_sign_int() 166 if (dsa->libctx == NULL || dsa->meth != DSA_get_default_method()) in ossl_dsa_sign_int() 167 s = DSA_do_sign(dgst, dlen, dsa); in ossl_dsa_sign_int() 169 s = ossl_dsa_do_sign_int(dgst, dlen, dsa, in ossl_dsa_sign_int() [all …]
|
H A D | dsa_local.h | 48 DSA_SIG *(*dsa_do_sign) (const unsigned char *dgst, int dlen, DSA *dsa); 49 int (*dsa_sign_setup) (DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, 52 DSA_SIG *sig, DSA *dsa); 53 int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, const BIGNUM *a1, 57 int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 59 int (*init) (DSA *dsa); 60 int (*finish) (DSA *dsa); 64 int (*dsa_paramgen) (DSA *dsa, int bits, 69 int (*dsa_keygen) (DSA *dsa); 72 DSA_SIG *ossl_dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa,
|
H A D | dsa_pmeth.c | 89 DSA *dsa = (DSA *)EVP_PKEY_get0_DSA(ctx->pkey); in pkey_dsa_sign() local 118 DSA *dsa = (DSA *)EVP_PKEY_get0_DSA(ctx->pkey); in pkey_dsa_verify() local 222 DSA *dsa = NULL; in pkey_dsa_paramgen() local 234 dsa = DSA_new(); in pkey_dsa_paramgen() 235 if (dsa == NULL) { in pkey_dsa_paramgen() 247 EVP_PKEY_assign_DSA(pkey, dsa); in pkey_dsa_paramgen() 249 DSA_free(dsa); in pkey_dsa_paramgen() 255 DSA *dsa = NULL; in pkey_dsa_keygen() local 261 dsa = DSA_new(); in pkey_dsa_keygen() 262 if (dsa == NULL) in pkey_dsa_keygen() [all …]
|
H A D | dsa_lib.c | 113 mtmp = dsa->meth; in DSA_set_method() 115 mtmp->finish(dsa); in DSA_set_method() 117 ENGINE_finish(dsa->engine); in DSA_set_method() 118 dsa->engine = NULL; in DSA_set_method() 120 dsa->meth = meth; in DSA_set_method() 122 meth->init(dsa); in DSA_set_method() 341 int DSA_bits(const DSA *dsa) in DSA_bits() argument 343 if (dsa->params.p != NULL) in DSA_bits() 344 return BN_num_bits(dsa->params.p); in DSA_bits() 350 return &dsa->params; in ossl_dsa_get0_params() [all …]
|
H A D | dsa_vrf.c | 20 DSA *dsa) in DSA_do_verify() argument 22 return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); in DSA_do_verify()
|
/openssl/include/crypto/ |
H A D | dsa.h | 30 int ossl_dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits, 34 unsigned char *sig, unsigned int *siglen, DSA *dsa, 38 FFC_PARAMS *ossl_dsa_get0_params(DSA *dsa); 39 int ossl_dsa_ffc_params_fromdata(DSA *dsa, const OSSL_PARAM params[]); 40 int ossl_dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[], 45 int ossl_dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa, 47 int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret); 49 int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, 52 int ossl_dsa_check_pairwise(const DSA *dsa); 53 int ossl_dsa_is_foreign(const DSA *dsa); [all …]
|
/openssl/providers/implementations/keymgmt/ |
H A D | dsa_kmgmt.c | 106 if (dsa == NULL) in dsa_key_todata() 148 ok = ok && (DSA_get0_p(dsa) != NULL && DSA_get0_g(dsa) != NULL); in dsa_has() 196 DSA *dsa = keydata; in dsa_import() local 317 DSA *dsa = key; in dsa_get_params() local 442 DSA *dsa = templ; in dsa_gen_set_template() local 597 DSA *dsa = NULL; in dsa_gen() local 617 if (dsa == NULL) in dsa_gen() 683 dsa = NULL; in dsa_gen() 686 return dsa; in dsa_gen() 704 DSA *dsa = NULL; in dsa_load() local [all …]
|
/openssl/test/ |
H A D | dsatest.c | 64 DSA *dsa = NULL; in dsa_test() local 86 if (!TEST_ptr(dsa = DSA_new()) in dsa_test() 96 DSA_get0_pqg(dsa, &p, &q, &g); in dsa_test() 112 if (!TEST_true(DSA_generate_key(dsa))) in dsa_test() 119 DSA_free(dsa); in dsa_test() 331 DSA *dsa = NULL; in test_dsa_sig_infinite_loop() local 364 || !TEST_ptr(dsa = DSA_new())) in test_dsa_sig_infinite_loop() 415 DSA_free(dsa); in test_dsa_sig_infinite_loop() 422 DSA *dsa = NULL; in test_dsa_sig_neg_param() local 448 || !TEST_ptr(dsa = DSA_new())) in test_dsa_sig_neg_param() [all …]
|
H A D | pem_read_depr_test.c | 89 DSA *dsa = NULL; in test_read_dsa_params() local 94 dsa = PEM_read_bio_DSAparams(infile, NULL, NULL, NULL); in test_read_dsa_params() 95 if (!TEST_ptr(dsa)) in test_read_dsa_params() 102 DSA_free(dsa); in test_read_dsa_params() 110 DSA *dsa = NULL; in test_read_dsa_private() local 116 if (!TEST_ptr(dsa)) in test_read_dsa_private() 123 DSA_free(dsa); in test_read_dsa_private() 131 DSA *dsa = NULL; in test_read_dsa_public() local 136 dsa = PEM_read_bio_DSA_PUBKEY(infile, NULL, NULL, NULL); in test_read_dsa_public() 137 if (!TEST_ptr(dsa)) in test_read_dsa_public() [all …]
|
H A D | dsa_no_digest_size_test.c | 98 DSA *dsa = DSA_new(); in load_dsa_params() local 101 if (dsa == NULL) in load_dsa_params() 103 if (!DSA_set0_pqg(dsa, p = BN_bin2bn(dsap_2048, sizeof(dsap_2048), NULL), in load_dsa_params() 106 DSA_free(dsa); in load_dsa_params() 112 return dsa; in load_dsa_params()
|
/openssl/providers/common/der/ |
H A D | DSA.asn1 | 14 id-dsa OBJECT IDENTIFIER ::= { 19 id-dsa-with-sha1 OBJECT IDENTIFIER ::= { 28 id-dsa-with-sha224 OBJECT IDENTIFIER ::= { sigAlgs 1 } 29 id-dsa-with-sha256 OBJECT IDENTIFIER ::= { sigAlgs 2 } 30 id-dsa-with-sha384 OBJECT IDENTIFIER ::= { sigAlgs 3 } 31 id-dsa-with-sha512 OBJECT IDENTIFIER ::= { sigAlgs 4 } 33 id-dsa-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 5 } 34 id-dsa-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 6 } 35 id-dsa-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 7 } 36 id-dsa-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 8 }
|
/openssl/apps/ |
H A D | testdsa.h | 204 st.priv = dsa##bits##_priv; \ 205 st.pub = dsa##bits##_pub; \ 206 st.p = dsa##bits##_p; \ 207 st.g = dsa##bits##_g; \ 208 st.q = dsa##bits##_q; \ 209 st.priv_l = sizeof(dsa##bits##_priv); \ 210 st.pub_l = sizeof(dsa##bits##_pub); \ 211 st.p_l = sizeof(dsa##bits##_p); \ 212 st.g_l = sizeof(dsa##bits##_g); \ 213 st.q_l = sizeof(dsa##bits##_q); \
|
/openssl/doc/man3/ |
H A D | DSA_size.pod | 9 #include <openssl/dsa.h> 15 int DSA_bits(const DSA *dsa); 17 int DSA_size(const DSA *dsa); 19 int DSA_security_bits(const DSA *dsa); 27 DSA_bits() returns the number of bits in key I<dsa>: this is the number 31 for key I<dsa> in bytes. It can be used to determine how much memory must 34 DSA_security_bits() returns the number of security bits of the given I<dsa> 40 I<dsa> doesn't hold any key parameters. 42 DSA_bits() returns the number of bits in the key, or -1 if I<dsa> doesn't 45 DSA_size() returns the signature size in bytes, or -1 if I<dsa> doesn't
|
H A D | DSA_sign.pod | 9 #include <openssl/dsa.h> 16 unsigned char *sigret, unsigned int *siglen, DSA *dsa); 18 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp); 21 unsigned char *sigbuf, int siglen, DSA *dsa); 30 digest B<dgst> using the private key B<dsa> and places its ASN.1 DER 32 *B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory. 43 B<dsa> is the signer's public key.
|
/openssl/crypto/pem/ |
H A D | pem_all.c | 30 static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); 93 static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa) in IMPLEMENT_PEM_write_cb() 102 if (dsa) { in IMPLEMENT_PEM_write_cb() 103 DSA_free(*dsa); in IMPLEMENT_PEM_write_cb() 104 *dsa = dtmp; in IMPLEMENT_PEM_write_cb() 109 DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **dsa, pem_password_cb *cb, in PEM_read_bio_DSAPrivateKey() argument 114 return pkey_get_dsa(pktmp, dsa); /* will free pktmp */ in PEM_read_bio_DSAPrivateKey() 120 DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb, void *u) in IMPLEMENT_PEM_write_cb() 124 return pkey_get_dsa(pktmp, dsa); /* will free pktmp */ in IMPLEMENT_PEM_write_cb()
|
/openssl/demos/pkey/ |
H A D | Makefile | 20 EVP_PKEY_DSA_keygen.o: EVP_PKEY_DSA_keygen.c dsa.inc 21 EVP_PKEY_DSA_paramgen.o: EVP_PKEY_DSA_paramgen.c dsa.inc 22 EVP_PKEY_DSA_paramvalidate.o: EVP_PKEY_DSA_paramvalidate.c dsa.inc 23 EVP_PKEY_DSA_paramfromdata.o: EVP_PKEY_DSA_paramfromdata.c dsa.inc
|
/openssl/providers/implementations/encode_decode/ |
H A D | encode_key2any.c | 573 const BIGNUM *p = DSA_get0_p(dsa); in prepare_dsa_params() 1320 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, type_specific, der); 1339 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, type_specific, pem); 1383 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, EncryptedPrivateKeyInfo, der); 1384 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, EncryptedPrivateKeyInfo, pem); 1385 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, PrivateKeyInfo, der); 1386 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, PrivateKeyInfo, pem); 1387 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, SubjectPublicKeyInfo, der); 1388 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, SubjectPublicKeyInfo, pem); 1450 MAKE_ENCODER(dsa, dsa, EVP_PKEY_DSA, DSA, der); [all …]
|
/openssl/providers/common/ |
H A D | securitycheck.c | 148 int ossl_dsa_check_key(const DSA *dsa, int sign) in ossl_dsa_check_key() argument 153 if (dsa == NULL) in ossl_dsa_check_key() 156 p = DSA_get0_p(dsa); in ossl_dsa_check_key() 157 q = DSA_get0_q(dsa); in ossl_dsa_check_key()
|
/openssl/providers/ |
H A D | decoders.inc | 23 #define DECODER_STRUCTURE_DSA "dsa" 49 DECODER_w_structure("DSA", der, PrivateKeyInfo, dsa, yes), 50 DECODER_w_structure("DSA", der, SubjectPublicKeyInfo, dsa, yes), 51 DECODER_w_structure("DSA", der, type_specific, dsa, yes), 52 DECODER_w_structure("DSA", der, DSA, dsa, yes), 53 DECODER("DSA", msblob, dsa, yes), 54 DECODER("DSA", pvk, dsa, yes),
|