/openssl/demos/signature/ |
H A D | EVP_ED_Signature_demo.c | 28 static int demo_sign(EVP_PKEY *priv, in demo_sign() argument 131 EVP_PKEY *priv = NULL, *pub = NULL; in create_key() local 140 priv = EVP_PKEY_Q_keygen(libctx, NULL, "ED25519"); in create_key() 141 if (priv == NULL) { in create_key() 146 if (!EVP_PKEY_get_octet_string_param(priv, in create_key() 163 *privout = priv; in create_key() 165 EVP_PKEY_free(priv); in create_key() 176 EVP_PKEY *priv = NULL, *pub = NULL; in main() local 183 if (!create_key(libctx, &priv, &pub)) { in main() 188 if (!demo_sign(priv, hamlet, sizeof(hamlet), libctx, in main() [all …]
|
/openssl/test/ |
H A D | ffc_internal_test.c | 543 BIGNUM *priv = NULL; in ffc_private_validate_test() local 546 if (!TEST_ptr(priv = BN_new())) in ffc_private_validate_test() 553 if (!TEST_true(BN_set_word(priv, 1))) in ffc_private_validate_test() 555 BN_set_negative(priv, 1); in ffc_private_validate_test() 562 if (!TEST_true(BN_set_word(priv, 0))) in ffc_private_validate_test() 575 if (!TEST_ptr(BN_copy(priv, params->q))) in ffc_private_validate_test() 583 if (!TEST_true(BN_sub_word(priv, 1))) in ffc_private_validate_test() 602 BN_free(priv); in ffc_private_validate_test() 610 BIGNUM *priv = NULL; in ffc_private_gen_test() local 617 if (!TEST_ptr(priv = BN_new())) in ffc_private_gen_test() [all …]
|
H A D | sm2_internal_test.c | 141 BIGNUM *priv = NULL; in test_sm2_crypt() local 153 || !TEST_true(BN_hex2bn(&priv, privkey_hex))) in test_sm2_crypt() 159 || !TEST_true(EC_KEY_set_private_key(key, priv))) in test_sm2_crypt() 164 || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL)) in test_sm2_crypt() 200 BN_free(priv); in test_sm2_crypt() 313 BIGNUM *priv = NULL; in test_sm2_sign() local 322 if (!TEST_true(BN_hex2bn(&priv, privkey_hex))) in test_sm2_sign() 328 || !TEST_true(EC_KEY_set_private_key(key, priv))) in test_sm2_sign() 334 || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL)) in test_sm2_sign() 366 BN_free(priv); in test_sm2_sign()
|
H A D | dsatest.c | 332 BIGNUM *p = NULL, *q = NULL, *g = NULL, *priv = NULL, *pub = NULL, *priv2 = NULL; in test_dsa_sig_infinite_loop() local 358 || !TEST_ptr(priv = BN_bin2bn(out_priv, sizeof(out_priv), NULL)) in test_dsa_sig_infinite_loop() 359 || !TEST_ptr(priv2 = BN_dup(priv)) in test_dsa_sig_infinite_loop() 371 if (!TEST_true(DSA_set0_key(dsa, pub, priv))) in test_dsa_sig_infinite_loop() 373 pub = priv = NULL; in test_dsa_sig_infinite_loop() 410 BN_free(priv); in test_dsa_sig_infinite_loop() 423 BIGNUM *p = NULL, *q = NULL, *g = NULL, *priv = NULL, *pub = NULL; in test_dsa_sig_neg_param() local 447 || !TEST_ptr(priv = BN_bin2bn(out_priv, sizeof(out_priv), NULL)) in test_dsa_sig_neg_param() 455 if (!TEST_true(DSA_set0_key(dsa, pub, priv))) in test_dsa_sig_neg_param() 457 pub = priv = NULL; in test_dsa_sig_neg_param() [all …]
|
H A D | evp_pkey_dhkem_test.c | 123 BIGNUM *priv = NULL; in test_ec_dhkem_derivekey_fail() local 161 BN_free(priv); in test_ec_dhkem_derivekey_fail() 272 EVP_PKEY *priv = NULL; in test_ec_invalid_private_key() local 285 EVP_PKEY_free(priv); in test_ec_invalid_private_key() 397 EVP_PKEY *priv = NULL; in test_nopublic() local 422 EVP_PKEY_free(priv); in test_nopublic() 475 BIGNUM *priv = NULL; in test_ec_dhkem_derivekey() local 491 &priv)) in test_ec_dhkem_derivekey() 492 && TEST_int_gt(privkeylen = BN_bn2bin(priv, privkey), 0) in test_ec_dhkem_derivekey() 497 BN_free(priv); in test_ec_dhkem_derivekey() [all …]
|
H A D | evp_libctx_test.c | 544 static int rsa_keygen(int bits, EVP_PKEY **pub, EVP_PKEY **priv) in rsa_keygen() argument 552 if (!TEST_ptr(*priv = EVP_PKEY_Q_keygen(libctx, NULL, "RSA", (size_t)bits)) in rsa_keygen() 554 OSSL_ENCODER_CTX_new_for_pkey(*priv, in rsa_keygen() 574 EVP_PKEY *priv = NULL; in kem_rsa_gen_recover() local 582 ret = TEST_true(rsa_keygen(bits, &pub, &priv)) in kem_rsa_gen_recover() 595 && TEST_ptr(rctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL)) in kem_rsa_gen_recover() 619 EVP_PKEY_free(priv); in kem_rsa_gen_recover() 662 EVP_PKEY *priv = NULL; in kem_rsa_params() local 668 ret = TEST_true(rsa_keygen(2048, &pub, &priv)) in kem_rsa_params() 670 && TEST_ptr(privctx = EVP_PKEY_CTX_new_from_pkey(libctx, priv, NULL)) in kem_rsa_params() [all …]
|
H A D | acvp_test.c | 147 unsigned char *priv = NULL; in ecdsa_keygen_test() local 166 test_output_memory("d", priv, priv_len); in ecdsa_keygen_test() 171 OPENSSL_clear_free(priv, priv_len); in ecdsa_keygen_test() 491 unsigned char *priv = NULL, *pub = NULL; in eddsa_keygen_test() local 511 OPENSSL_clear_free(priv, priv_len); in eddsa_keygen_test() 579 OPENSSL_clear_free(priv, priv_len); in dsa_keygen_test() 582 pub = priv = NULL; in dsa_keygen_test() 586 OPENSSL_clear_free(priv, priv_len); in dsa_keygen_test() 1163 if (priv != NULL) { in dh_create_pkey() 1191 unsigned char *priv = NULL; in dh_safe_prime_keygen_test() local [all …]
|
H A D | fake_rsaprov.h | 17 OSSL_PARAM *fake_rsa_key_params(int priv);
|
H A D | evp_pkey_provided_test.c | 906 BIGNUM *pub = NULL, *priv = NULL; in test_fromdata_dh_named_group() local 953 || !TEST_ptr(priv = BN_bin2bn(priv_data, sizeof(priv_data), NULL)) in test_fromdata_dh_named_group() 1023 || !TEST_BN_eq(priv, priv_out) in test_fromdata_dh_named_group() 1100 BN_free(priv); in test_fromdata_dh_named_group() 1120 BIGNUM *pub = NULL, *priv = NULL; in test_fromdata_dh_fips186_4() local 1206 || !TEST_BN_eq(priv, priv_out) in test_fromdata_dh_fips186_4() 1278 BN_free(priv); in test_fromdata_dh_fips186_4() 1852 BIGNUM *pub = NULL, *priv = NULL; in test_fromdata_dsa_fips186_4() local 1987 priv)) in test_fromdata_dsa_fips186_4() 2017 || !TEST_BN_eq(priv, priv_out) in test_fromdata_dsa_fips186_4() [all …]
|
/openssl/crypto/ec/ |
H A D | ecx_key.c | 107 int ossl_ecx_compute_key(ECX_KEY *peer, ECX_KEY *priv, size_t keylen, in ossl_ecx_compute_key() argument 110 if (priv == NULL in ossl_ecx_compute_key() 111 || priv->privkey == NULL in ossl_ecx_compute_key() 136 if (s390x_x25519_mul(secret, peer->pubkey, priv->privkey) == 0) { in ossl_ecx_compute_key() 142 if (ossl_x25519(secret, priv->privkey, peer->pubkey) == 0) { in ossl_ecx_compute_key() 150 if (s390x_x448_mul(secret, peer->pubkey, priv->privkey) == 0) { in ossl_ecx_compute_key() 156 if (ossl_x448(secret, priv->privkey, peer->pubkey) == 0) { in ossl_ecx_compute_key()
|
H A D | ecx_meth.c | 259 static int ecx_set_priv_key(EVP_PKEY *pkey, const unsigned char *priv, in ecx_set_priv_key() argument 268 ecx = ossl_ecx_key_op(NULL, priv, len, pkey->ameth->pkey_id, in ecx_set_priv_key() 296 static int ecx_get_priv_key(const EVP_PKEY *pkey, unsigned char *priv, in ecx_get_priv_key() argument 301 if (priv == NULL) { in ecx_get_priv_key() 312 memcpy(priv, key->privkey, *len); in ecx_get_priv_key() 1195 unsigned char priv[32]; in s390x_pkey_ecd_digestsign25519() member 1218 memcpy(param.ed25519.priv, edkey->privkey, sizeof(param.ed25519.priv)); in s390x_pkey_ecd_digestsign25519() 1221 OPENSSL_cleanse(param.ed25519.priv, sizeof(param.ed25519.priv)); in s390x_pkey_ecd_digestsign25519() 1240 unsigned char priv[64]; in s390x_pkey_ecd_digestsign448() member 1263 memcpy(param.ed448.priv + 64 - 57, edkey->privkey, 57); in s390x_pkey_ecd_digestsign448() [all …]
|
/openssl/demos/keyexch/ |
H A D | ecdh.c | 30 EVP_PKEY *priv; /* private keypair */ member 50 if (!EVP_PKEY_get_octet_string_param(peer->priv, OSSL_PKEY_PARAM_PUB_KEY, in get_peer_public_key() 87 || EVP_PKEY_generate(ctx, &peer->priv) <= 0 in create_peer() 89 EVP_PKEY_free(peer->priv); in create_peer() 90 peer->priv = NULL; in create_peer() 101 EVP_PKEY_free(peer->priv); in destroy_peer() 113 derivectx = EVP_PKEY_CTX_new_from_pkey(libctx, peerA->priv, NULL); in generate_secret()
|
/openssl/crypto/ffc/ |
H A D | ffc_key_generate.c | 23 int N, int s, BIGNUM *priv) in ossl_ffc_generate_private_key() argument 48 if (!BN_priv_rand_range_ex(priv, two_powN, 0, ctx) in ossl_ffc_generate_private_key() 49 || !BN_add_word(priv, 1)) in ossl_ffc_generate_private_key() 52 if (BN_cmp(priv, m) < 0) in ossl_ffc_generate_private_key()
|
H A D | ffc_key_validate.c | 102 int ossl_ffc_validate_private_key(const BIGNUM *upper, const BIGNUM *priv, in ossl_ffc_validate_private_key() argument 109 if (priv == NULL || upper == NULL) { in ossl_ffc_validate_private_key() 113 if (BN_cmp(priv, BN_value_one()) < 0) { in ossl_ffc_validate_private_key() 117 if (BN_cmp(priv, upper) >= 0) { in ossl_ffc_validate_private_key()
|
/openssl/crypto/evp/ |
H A D | p_dec.c | 22 EVP_PKEY *priv) in EVP_PKEY_decrypt_old() argument 27 if (EVP_PKEY_get_id(priv) != EVP_PKEY_RSA) { in EVP_PKEY_decrypt_old() 32 rsa = evp_pkey_get0_RSA_int(priv); in EVP_PKEY_decrypt_old()
|
H A D | p_open.c | 20 EVP_PKEY *priv) in EVP_OpenInit() argument 33 if (priv == NULL) in EVP_OpenInit() 36 if ((pctx = EVP_PKEY_CTX_new(priv, NULL)) == NULL) { in EVP_OpenInit()
|
/openssl/crypto/asn1/ |
H A D | p8_pkey.c | 38 int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, 43 if (!ASN1_INTEGER_set(priv->version, version)) 46 if (!X509_ALGOR_set0(priv->pkeyalg, aobj, ptype, pval)) 49 ASN1_STRING_set0(priv->pkey, penc, penclen);
|
/openssl/crypto/dh/ |
H A D | dh_backend.c | 106 const BIGNUM *priv = NULL, *pub = NULL; in ossl_dh_key_todata() local 111 DH_get0_key(dh, &pub, &priv); in ossl_dh_key_todata() 112 if (priv != NULL in ossl_dh_key_todata() 114 && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv)) in ossl_dh_key_todata()
|
/openssl/apps/ |
H A D | testdsa.h | 190 unsigned char *priv; member 204 st.priv = dsa##bits##_priv; \ 242 priv_key = BN_bin2bn(dsa_t.priv, dsa_t.priv_l, NULL); in get_dsa()
|
/openssl/doc/man3/ |
H A D | EVP_OpenInit.pod | 12 int ekl, unsigned char *iv, EVP_PKEY *priv); 25 B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. 36 EVP_DecryptInit(). The first call should have B<priv> set to NULL
|
H A D | EVP_PKEY_fromdata.pod | 171 BIGNUM *priv; 176 priv = BN_bin2bn(priv_data, sizeof(priv_data), NULL); 179 if (priv != NULL && param_bld != NULL 182 && OSSL_PARAM_BLD_push_BN(param_bld, "priv", priv) 201 BN_free(priv);
|
/openssl/providers/implementations/kem/ |
H A D | ec_kem.c | 71 const BIGNUM *priv = EC_KEY_get0_private_key(ec); in eckey_check() local 79 if (priv == NULL) { in eckey_check() 90 rv = BN_mod(rem, priv, order, bnctx) in eckey_check() 381 int ossl_ec_dhkem_derive_private(EC_KEY *ec, BIGNUM *priv, in ossl_ec_dhkem_derive_private() argument 432 if (BN_bin2bn(privbuf, info->Nsk, priv) == NULL) in ossl_ec_dhkem_derive_private() 439 } while (BN_is_zero(priv) || BN_cmp(priv, order) >= 0); in ossl_ec_dhkem_derive_private()
|
/openssl/crypto/bn/ |
H A D | bn_rand.c | 295 const BIGNUM *priv, in ossl_bn_gen_dsa_nonce_fixed_top() argument 327 if (BN_bn2binpad(priv, private_bytes, sizeof(private_bytes)) < 0) { in ossl_bn_gen_dsa_nonce_fixed_top() 398 const BIGNUM *priv, const unsigned char *message, in BN_generate_dsa_nonce() argument 403 ret = ossl_bn_gen_dsa_nonce_fixed_top(out, range, priv, message, in BN_generate_dsa_nonce()
|
/openssl/providers/implementations/signature/ |
H A D | eddsa_sig.c | 1054 unsigned char priv[32]; in s390x_ed25519_digestsign() member 1060 memcpy(param.ed25519.priv, edkey->privkey, sizeof(param.ed25519.priv)); in s390x_ed25519_digestsign() 1063 OPENSSL_cleanse(param.ed25519.priv, sizeof(param.ed25519.priv)); in s390x_ed25519_digestsign() 1079 unsigned char priv[64]; in s390x_ed448_digestsign() member 1085 memcpy(param.ed448.priv + 64 - 57, edkey->privkey, 57); in s390x_ed448_digestsign() 1088 OPENSSL_cleanse(param.ed448.priv, sizeof(param.ed448.priv)); in s390x_ed448_digestsign()
|
/openssl/include/openssl/ |
H A D | hpke.h | 122 unsigned char *pub, size_t *publen, EVP_PKEY **priv, 140 int OSSL_HPKE_CTX_set1_authpriv(OSSL_HPKE_CTX *ctx, EVP_PKEY *priv);
|