/freebsd/crypto/openssl/crypto/ec/ |
H A D | ecx_backend.c | 32 ossl_x25519_public_from_private(key->pubkey, key->privkey); in ossl_ecx_public_from_private() 36 key->privkey, key->propq)) { in ossl_ecx_public_from_private() 42 ossl_x448_public_from_private(key->pubkey, key->privkey); in ossl_ecx_public_from_private() 46 key->privkey, key->propq)) { in ossl_ecx_public_from_private() 75 (void **)&ecx->privkey, ecx->keylen, in ossl_ecx_key_fromdata() 84 OPENSSL_secure_clear_free(ecx->privkey, privkeylen); in ossl_ecx_key_fromdata() 85 ecx->privkey = NULL; in ossl_ecx_key_fromdata() 143 && key->privkey != NULL) { in ossl_ecx_key_dup() 146 memcpy(ret->privkey, key->privkey, ret->keylen); in ossl_ecx_key_dup() 164 unsigned char *privkey, *pubkey; in ossl_ecx_key_op() local [all …]
|
H A D | ecx_meth.c | 107 if (ecxkey == NULL || ecxkey->privkey == NULL) { in ecx_priv_encode() 112 oct.data = ecxkey->privkey; in ecx_priv_encode() 175 if (ecxkey == NULL || ecxkey->privkey == NULL) { in ecx_key_print() 184 if (ASN1_buf_print(bp, ecxkey->privkey, KEYLEN(pkey), in ecx_key_print() 309 || key->privkey == NULL in ecx_get_priv_key() 314 memcpy(priv, key->privkey, *len); in ecx_get_priv_key() 367 if (key->privkey != NULL) { in ecx_pkey_export_to() 370 key->privkey, key->keylen)) in ecx_pkey_export_to() 726 const unsigned char **privkey, in validate_ecx_derive() argument 737 if (ecxkey == NULL || ecxkey->privkey == NULL) { in validate_ecx_derive() [all …]
|
H A D | ecx_key.c | 71 OPENSSL_secure_clear_free(key->privkey, key->keylen); in ossl_ecx_key_free() 95 key->privkey = OPENSSL_secure_zalloc(key->keylen); in ossl_ecx_key_allocate_privkey() 97 return key->privkey; in ossl_ecx_key_allocate_privkey()
|
/freebsd/crypto/openssl/providers/implementations/keymgmt/ |
H A D | ecx_kmgmt.c | 138 ok = ok && key->privkey != NULL; in ecx_has() 173 const unsigned char *pa = key1->privkey; in ecx_match() 174 const unsigned char *pb = key2->privkey; in ecx_match() 221 && key->privkey != NULL in key_to_params() 224 key->privkey, key->keylen)) in key_to_params() 411 OPENSSL_clear_free(ecxkey->privkey, ecxkey->keylen); in ecx_set_params() 412 ecxkey->privkey = NULL; in ecx_set_params() 582 unsigned char *privkey; in ecx_gen() local 596 if ((privkey = ossl_ecx_key_allocate_privkey(key)) == NULL) { in ecx_gen() 600 if (RAND_priv_bytes_ex(gctx->libctx, privkey, key->keylen, 0) <= 0) in ecx_gen() [all …]
|
/freebsd/sbin/decryptcore/ |
H A D | decryptcore.c | 125 RSA *privkey; in decrypt() local 136 privkey = NULL; in decrypt() 191 privkey = RSA_new(); in decrypt() 192 if (privkey == NULL) { in decrypt() 206 privkey = PEM_read_RSAPrivateKey(fp, &privkey, NULL, NULL); in decrypt() 208 if (privkey == NULL) { in decrypt() 213 privkeysize = RSA_size(privkey); in decrypt() 233 kdk->kdk_encryptedkey, key, privkey, in decrypt() 237 kdk->kdk_encryptedkey, key, privkey, in decrypt() 243 RSA_free(privkey); in decrypt() [all …]
|
/freebsd/crypto/libecc/src/wycheproof_tests/ |
H A D | libecc_wycheproof_tests.h | 367972 .privkey = ecdh_brainpoolp224r1_0_privkey, 368000 .privkey = ecdh_brainpoolp224r1_1_privkey, 368028 .privkey = ecdh_brainpoolp224r1_2_privkey, 368056 .privkey = ecdh_brainpoolp224r1_3_privkey, 368084 .privkey = ecdh_brainpoolp224r1_4_privkey, 368112 .privkey = ecdh_brainpoolp224r1_5_privkey, 368140 .privkey = ecdh_brainpoolp224r1_6_privkey, 368168 .privkey = ecdh_brainpoolp224r1_7_privkey, 368196 .privkey = ecdh_brainpoolp224r1_8_privkey, 368224 .privkey = ecdh_brainpoolp224r1_9_privkey, [all …]
|
H A D | libecc_wycheproof.h | 66 const unsigned char *privkey; member 95 const unsigned char *privkey; member 122 const unsigned char *privkey; member
|
/freebsd/crypto/openssh/regress/misc/fuzz-harness/ |
H A D | kex_fuzz.cc | 124 struct sshkey *privkey) in store_key() argument 127 privkey->type != pubkey->type || in store_key() 135 st->nkeys, privkey->type + 1, sizeof(*st->privkeys)); in store_key() 136 st->nkeys = privkey->type + 1; in store_key() 140 st->privkeys[privkey->type] = privkey; in store_key() 178 struct sshkey *privkey = NULL, *pubkey = NULL; in do_kex_with_key() local 194 privkey = get_privkey(st, keytype); in do_kex_with_key() 195 keyname = xstrdup(sshkey_ssh_name(privkey)); in do_kex_with_key() 229 if ((r = ssh_add_hostkey(server, privkey)) != 0 || in do_kex_with_key() 257 struct sshkey *privkey = NULL, *pubkey = NULL; in prepare_key() local [all …]
|
H A D | agent_fuzz_helper.c | 44 struct sshkey *privkey; in privkey_or_die() local 50 if ((r = sshkey_parse_private_fileblob(b, "", &privkey, NULL)) != 0) { in privkey_or_die() 55 return privkey; in privkey_or_die() 59 add_key(const char *privkey, const char *certpath) in add_key() argument 68 id->key = privkey_or_die(privkey); in add_key() 77 id->key = privkey_or_die(privkey); in add_key()
|
/freebsd/crypto/libecc/scripts/ |
H A D | expand_libecc.py | 288 def __init__(self, pubkey, privkey): argument 290 self.privkey = privkey 293 def fromprivkey(privkey, is_eckcdsa=False): argument 294 curve = privkey.curve 300 return PubKey(curve, privkey.x * G) 302 return PubKey(curve, modinv(privkey.x, q) * G) 316 privkey = PrivKey(curve, x) 317 pubkey = fromprivkey(privkey, is_eckcdsa) 318 return KeyPair(pubkey, privkey) 492 privkey = keypair.privkey [all …]
|
/freebsd/crypto/openssl/test/recipes/ |
H A D | 20-test_dgst.t | 24 my $privkey = shift; 30 my $sigfile = basename($privkey, '.pem') . '.sig'; 33 ok(run(app(['openssl', 'dgst', '-sign', $privkey, 38 ok(run(app(['openssl', 'dgst', '-prverify', $privkey, 56 my $privkey = shift; 62 my $sigfile = basename($privkey, '.pem') . '.sig'; 65 ok(run(app(['openssl', 'sha512', '-sign', $privkey, 75 ok(run(app(['openssl', 'dgst', '-sha512', '-prverify', $privkey,
|
H A D | 20-test_pkeyutl.t | 87 my $privkey = shift; 93 my $sigfile = basename($privkey, '.pem') . '.sig'; 99 '-inkey', $privkey, 107 '-inkey', $privkey, 116 '-inkey', $privkey,
|
/freebsd/contrib/wpa/src/crypto/ |
H A D | crypto_internal-modexp.c | 16 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument 21 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init() 23 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init() 25 privkey[0] = 0; in crypto_dh_init() 29 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init() 44 const u8 *privkey, size_t privkey_len, in crypto_dh_derive_secret() argument 81 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
|
H A D | crypto_nettle.c | 307 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument 312 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init() 314 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init() 316 privkey[0] = 0; in crypto_dh_init() 320 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init() 335 const u8 *privkey, size_t privkey_len, in crypto_dh_derive_secret() argument 367 res = crypto_mod_exp(pubkey, pubkey_len, privkey, privkey_len, in crypto_dh_derive_secret()
|
/freebsd/crypto/openssl/test/ |
H A D | tls-provider.c | 44 unsigned char privkey[XOR_KEY_SIZE]; member 286 secret[i] = pxorctx->key->privkey[i] ^ pxorctx->peerkey->pubkey[i]; in xor_freectx() 343 * 3. we derive using our ephemeral privkey in combination with the peer in xor_encapsulate() 505 memcpy(tokey->privkey, fromkey->privkey, XOR_KEY_SIZE); in xor_dup() 649 if (RAND_bytes_ex(gctx->libctx, key->privkey, XOR_KEY_SIZE, 0) <= 0) { in xor_gen() 654 key->pubkey[i] = key->privkey[i] ^ private_constant[i]; in xor_gen() 668 unsigned char privkey[XOR_KEY_SIZE]; in xor_import() 670 void *pprivkey = privkey, *ppubkey = pubkey; in xor_import() 677 memset(privkey, in xor_import() 662 unsigned char privkey[XOR_KEY_SIZE]; xor_import() local [all...] |
H A D | dtlstest.c | 20 static char *privkey = NULL; variable 83 &sctx, &cctx, cert, privkey))) in test_dtls_unprocessed() 205 &sctx, &cctx, cert, privkey))) in test_dtls_drop_records() 318 &sctx, &cctx, cert, privkey))) in test_cookie() 358 &sctx, &cctx, cert, privkey))) in test_dtls_duplicate_records() 425 &sctx, NULL, cert, privkey))) in test_just_finished() 484 &sctx, &cctx, cert, privkey))) in test_swap_records() 593 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
|
H A D | fatalerrtest.c | 17 static char *privkey = NULL; variable 33 &sctx, &cctx, cert, privkey))) in test_fatalerr() 95 || !TEST_ptr(privkey = test_get_argument(1))) in setup_tests()
|
H A D | cmsapitest.c | 20 static EVP_PKEY *privkey = NULL; variable 43 if (!TEST_true(CMS_decrypt(content, privkey, cert, NULL, outmsgbio, in test_encrypt_decrypt() 391 if (!TEST_true(PEM_read_bio_PrivateKey(privkeybio, &privkey, NULL, NULL))) { in setup_tests() 411 EVP_PKEY_free(privkey); in cleanup_tests()
|
/freebsd/crypto/openssl/crypto/dsa/ |
H A D | dsa_backend.c | 132 ASN1_INTEGER *privkey = NULL; in ossl_dsa_key_from_pkcs8() local 143 if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) in ossl_dsa_key_from_pkcs8() 145 if (privkey->type == V_ASN1_NEG_INTEGER || ptype != V_ASN1_SEQUENCE) in ossl_dsa_key_from_pkcs8() 155 || !ASN1_INTEGER_to_BN(privkey, dsa_privkey)) { in ossl_dsa_key_from_pkcs8() 192 ASN1_STRING_clear_free(privkey); in ossl_dsa_key_from_pkcs8()
|
/freebsd/crypto/openssl/providers/implementations/exchange/ |
H A D | ecx_exch.c | 125 || ecxctx->key->privkey == NULL in ecx_derive() 151 ecxctx->key->privkey) == 0) { in ecx_derive() 157 if (ossl_x25519(secret, ecxctx->key->privkey, in ecx_derive() 167 ecxctx->key->privkey) == 0) { in ecx_derive() 173 if (ossl_x448(secret, ecxctx->key->privkey, in ecx_derive()
|
/freebsd/crypto/openssl/crypto/ec/curve448/ |
H A D | ed448.h | 44 const uint8_t privkey [EDDSA_448_PRIVATE_BYTES], 67 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], 93 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],
|
H A D | eddsa.c | 114 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in ossl_c448_ed448_derive_public_key() 124 privkey, in ossl_c448_ed448_derive_public_key() 161 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in ossl_c448_ed448_sign() 185 if (!oneshot_hash(ctx, expanded, sizeof(expanded), privkey, in ossl_c448_ed448_sign() 270 const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], in ossl_c448_ed448_sign_prehash() 275 return ossl_c448_ed448_sign(ctx, signature, privkey, pubkey, hash, 64, 1, in ossl_c448_ed448_sign_prehash()
|
/freebsd/crypto/openssl/fuzz/ |
H A D | server.c | 521 RSA *privkey; in FuzzerTestOneInput() local 552 privkey = d2i_RSAPrivateKey(NULL, &bufp, sizeof(kRSAPrivateKeyDER)); in FuzzerTestOneInput() 553 OPENSSL_assert(privkey != NULL); in FuzzerTestOneInput() 555 EVP_PKEY_assign_RSA(pkey, privkey); in FuzzerTestOneInput()
|
/freebsd/crypto/openssl/crypto/dh/ |
H A D | dh_backend.c | 197 ASN1_INTEGER *privkey = NULL; in ossl_dh_key_from_pkcs8() local 207 if ((privkey = d2i_ASN1_INTEGER(NULL, &p, pklen)) == NULL) in ossl_dh_key_from_pkcs8() 228 || !ASN1_INTEGER_to_BN(privkey, privkey_bn)) { in ossl_dh_key_from_pkcs8() 247 ASN1_STRING_clear_free(privkey); in ossl_dh_key_from_pkcs8()
|
/freebsd/crypto/openssl/providers/implementations/signature/ |
H A D | eddsa_sig.c | 168 if (edkey->privkey == NULL) { in ed25519_digest_sign() 182 if (ossl_ed25519_sign(sigret, tbs, tbslen, edkey->pubkey, edkey->privkey, in ed25519_digest_sign() 209 if (edkey->privkey == NULL) { in ed448_digest_sign() 224 edkey->privkey, NULL, 0, edkey->propq) == 0) { in ed448_digest_sign() 384 memcpy(param.ed25519.priv, edkey->privkey, sizeof(param.ed25519.priv)); in s390x_ed25519_digestsign() 409 memcpy(param.ed448.priv + 64 - 57, edkey->privkey, 57); in s390x_ed448_digestsign()
|