/openssl/demos/keyexch/ |
H A D | ecdh.c | 33 size_t secretlen; member 109 size_t secretlen = 0; in generate_secret() local 149 if (EVP_PKEY_derive(derivectx, NULL, &secretlen) <= 0) in generate_secret() 151 secret = (unsigned char *)OPENSSL_malloc(secretlen); in generate_secret() 160 if (EVP_PKEY_derive(derivectx, secret, &secretlen) <= 0) in generate_secret() 163 peerA->secretlen = secretlen; in generate_secret() 166 BIO_dump_indent_fp(stdout, peerA->secret, peerA->secretlen, 2); in generate_secret() 206 if (peer1.secretlen != peer2.secretlen in main() 207 || CRYPTO_memcmp(peer1.secret, peer2.secret, peer1.secretlen) != 0) { in main()
|
/openssl/providers/implementations/kem/ |
H A D | ec_kem.c | 525 size_t secretlen = (EC_GROUP_get_degree(group) + 7) / 8; in generate_ecdhkm() local 527 if (secretlen != secretsz || secretlen > maxout) { in generate_ecdhkm() 644 unsigned char *secret, size_t *secretlen) in dhkem_encap() argument 654 if (enclen == NULL && secretlen == NULL) in dhkem_encap() 658 if (secretlen != NULL) in dhkem_encap() 659 *secretlen = info->Nsecret; in dhkem_encap() 663 if (*secretlen < info->Nsecret) { in dhkem_encap() 697 *secretlen = info->Nsecret; in dhkem_encap() 732 *secretlen = info->Nsecret; in dhkem_decap() 736 if (*secretlen < info->Nsecret) { in dhkem_decap() [all …]
|
H A D | rsa_kem.c | 279 unsigned char *secret, size_t *secretlen) in rsasve_generate() argument 292 if (outlen == NULL && secretlen == NULL) in rsasve_generate() 296 if (secretlen != NULL) in rsasve_generate() 297 *secretlen = nlen; in rsasve_generate() 324 if (secretlen != NULL) in rsasve_generate() 325 *secretlen = nlen; in rsasve_generate() 399 unsigned char *secret, size_t *secretlen) in rsakem_generate() argument 408 return rsasve_generate(prsactx, out, outlen, secret, secretlen); in rsakem_generate()
|
H A D | ecx_kem.c | 547 unsigned char *secret, size_t *secretlen) in dhkem_encap() argument 555 if (enclen == NULL && secretlen == NULL) in dhkem_encap() 559 if (secretlen != NULL) in dhkem_encap() 560 *secretlen = info->Nsecret; in dhkem_encap() 564 if (*secretlen < info->Nsecret) { in dhkem_encap() 590 *secretlen = info->Nsecret; in dhkem_encap() 614 unsigned char *secret, size_t *secretlen, in dhkem_decap() argument 624 *secretlen = info->Nsecret; in dhkem_decap() 627 if (*secretlen < info->Nsecret) { in dhkem_decap() 651 *secretlen = info->Nsecret; in dhkem_decap() [all …]
|
H A D | template_kem.c | 134 unsigned char *secret, size_t *secretlen) in template_encapsulate() argument 142 if (secretlen != NULL) in template_encapsulate() 143 *secretlen = 0; /* replace with real shared secret length */ in template_encapsulate() 146 debug_print("encaps outlens set to %d and %d\n", *outlen, *secretlen); in template_encapsulate()
|
/openssl/test/ |
H A D | evp_libctx_test.c | 579 size_t ctlen = 0, unwraplen = 0, secretlen = 0; in kem_rsa_gen_recover() local 590 &secretlen), 1) in kem_rsa_gen_recover() 591 && TEST_int_eq(ctlen, secretlen) in kem_rsa_gen_recover() 594 &secretlen), 1) in kem_rsa_gen_recover() 604 && TEST_mem_eq(unwrap, unwraplen, secret, secretlen); in kem_rsa_gen_recover() 610 &secretlen), 0)) in kem_rsa_gen_recover() 666 size_t ctlen = 0, secretlen = 0; in kem_rsa_params() local 684 && TEST_int_eq(EVP_PKEY_decapsulate(pubctx, secret, &secretlen, ct, in kem_rsa_params() 701 && TEST_int_eq(EVP_PKEY_encapsulate(pubctx, NULL, NULL, NULL, &secretlen), 1) in kem_rsa_params() 717 && TEST_int_eq(secretlen, 256) in kem_rsa_params() [all …]
|
H A D | evp_pkey_dhkem_test.c | 188 size_t secretlen = sizeof(secret); in test_ikm_small() local 202 secret, &secretlen), 0); in test_ikm_small() 605 size_t secretlen = sizeof(secret); in test_ec_badpublic() local 626 secret, &secretlen), 0 )) in test_ec_badpublic() 631 if (!TEST_int_eq(EVP_PKEY_decapsulate(ctx, secret, &secretlen, in test_ec_badpublic() 654 size_t secretlen = sizeof(secret); in test_ec_badauth() local 669 secret, &secretlen), 0)) in test_ec_badauth() 673 || !TEST_int_eq(EVP_PKEY_decapsulate(ctx, secret, &secretlen, in test_ec_badauth() 691 size_t secretlen = sizeof(secret); in test_ec_invalid_decap_enc_buffer() local 698 && TEST_int_eq(EVP_PKEY_decapsulate(ctx, secret, &secretlen, in test_ec_invalid_decap_enc_buffer()
|
H A D | evp_extra_test2.c | 468 size_t outlen, secretlen, secretlen2; in test_new_keytype() local 485 || !TEST_int_eq(EVP_PKEY_encapsulate(ctx, NULL, &outlen, NULL, &secretlen), 1)) in test_new_keytype() 488 secret = OPENSSL_malloc(secretlen); in test_new_keytype() 489 secret2 = OPENSSL_malloc(secretlen); in test_new_keytype() 491 || !TEST_int_eq(EVP_PKEY_encapsulate(ctx, out, &outlen, secret, &secretlen), 1) in test_new_keytype() 494 || !TEST_mem_eq(secret, secretlen, secret2, secretlen2)) in test_new_keytype()
|
H A D | dhkem_test.inc | 656 size_t secretlen = 0, enclen = 0; 677 &secretlen), 1) 679 &secretlen), 1) 681 && TEST_mem_eq(secret, secretlen, 694 size_t secretlen = 0; 706 ret = TEST_int_eq(EVP_PKEY_decapsulate(recipctx, NULL, &secretlen, 709 && TEST_int_eq(EVP_PKEY_decapsulate(recipctx, secret, &secretlen, 712 && TEST_mem_eq(secret, secretlen,
|
/openssl/doc/man3/ |
H A D | EVP_PKEY_decapsulate.pod | 66 size_t secretlen = 0; 80 if (EVP_PKEY_decapsulate(ctx, NULL, &secretlen, in, inlen) <= 0) 83 secret = OPENSSL_malloc(secretlen); 87 /* Decapsulated secret data is secretlen bytes long */ 88 if (EVP_PKEY_decapsulate(ctx, secret, &secretlen, in, inlen) <= 0)
|
H A D | EVP_PKEY_encapsulate.pod | 72 size_t secretlen = 0, outlen = 0; 85 if (EVP_PKEY_encapsulate(ctx, NULL, &outlen, NULL, &secretlen) <= 0) 89 secret = OPENSSL_malloc(secretlen); 98 if (EVP_PKEY_encapsulate(ctx, out, &outlen, secret, &secretlen) <= 0)
|
/openssl/crypto/ec/ |
H A D | ecx_key.c | 108 unsigned char *secret, size_t *secretlen, size_t outlen) in ossl_ecx_compute_key() argument 124 *secretlen = keylen; in ossl_ecx_compute_key() 161 *secretlen = keylen; in ossl_ecx_compute_key()
|
/openssl/providers/implementations/exchange/ |
H A D | dh_exch.c | 176 unsigned char *secret, size_t *secretlen, in dh_plain_derive() argument 191 *secretlen = dhsize; in dh_plain_derive() 207 *secretlen = ret; in dh_plain_derive() 212 size_t *secretlen, size_t outlen) in dh_X9_42_kdf_derive() argument 220 *secretlen = pdhctx->kdf_outlen; in dh_X9_42_kdf_derive() 246 *secretlen = pdhctx->kdf_outlen; in dh_X9_42_kdf_derive()
|
H A D | kdf_exch.c | 98 static int kdf_derive(void *vpkdfctx, unsigned char *secret, size_t *secretlen, in kdf_derive() argument 111 *secretlen = kdfsize; in kdf_derive() 127 *secretlen = outlen; in kdf_derive()
|
H A D | ecx_exch.c | 130 static int ecx_derive(void *vecxctx, unsigned char *secret, size_t *secretlen, in ecx_derive() argument 138 secret, secretlen, outlen); in ecx_derive()
|
/openssl/crypto/evp/ |
H A D | kem.c | 217 unsigned char *secret, size_t *secretlen) in EVP_PKEY_encapsulate() argument 236 out, outlen, secret, secretlen); in EVP_PKEY_encapsulate() 253 unsigned char *secret, size_t *secretlen, in EVP_PKEY_decapsulate() argument 258 || (secret == NULL && secretlen == NULL)) in EVP_PKEY_decapsulate() 271 secret, secretlen, in, inlen); in EVP_PKEY_decapsulate()
|
/openssl/apps/ |
H A D | pkeyutl.c | 143 size_t buf_outlen = 0, secretlen = 0; in pkeyutl_main() local 535 buf_in, (size_t)buf_inlen, NULL, (size_t *)&secretlen); in pkeyutl_main() 539 if (secretlen > 0) in pkeyutl_main() 540 secret = app_malloc(secretlen, "secret output"); in pkeyutl_main() 543 buf_in, (size_t)buf_inlen, secret, (size_t *)&secretlen); in pkeyutl_main() 564 if (secretlen > 0) in pkeyutl_main() 565 BIO_write(secout, secret, secretlen); in pkeyutl_main()
|
/openssl/crypto/hpke/ |
H A D | hpke.c | 657 size_t secretlen = OSSL_HPKE_MAXSIZE; in hpke_do_middle() local 731 secretlen = kdf_info->Nh; in hpke_do_middle() 732 if (secretlen > OSSL_HPKE_MAXSIZE) { in hpke_do_middle() 736 if (ossl_hpke_labeled_extract(kctx, secret, secretlen, in hpke_do_middle() 752 secret, secretlen, OSSL_HPKE_SEC51LABEL, in hpke_do_middle() 764 secret, secretlen, OSSL_HPKE_SEC51LABEL, in hpke_do_middle() 777 secret, secretlen, OSSL_HPKE_SEC51LABEL, in hpke_do_middle() 1236 unsigned char *secret, size_t secretlen, in OSSL_HPKE_export() argument 1245 if (ctx == NULL || secret == NULL || secretlen == 0) { in OSSL_HPKE_export() 1279 erv = ossl_hpke_labeled_expand(kctx, secret, secretlen, in OSSL_HPKE_export()
|
/openssl/providers/implementations/kdfs/ |
H A D | argon2.c | 165 uint32_t secretlen; member 696 store32((uint8_t *) &value, ctx->secretlen); in initial_hash() 701 if (EVP_DigestUpdate(mdctx, ctx->secret, ctx->secretlen) != 1) in initial_hash() 704 OPENSSL_cleanse(ctx->secret, ctx->secretlen); in initial_hash() 705 ctx->secretlen = 0; in initial_hash() 999 OPENSSL_clear_free(ctx->secret, ctx->secretlen); in kdf_argon2_free() 1140 OPENSSL_clear_free(ctx->secret, ctx->secretlen); in kdf_argon2_reset() 1240 OPENSSL_clear_free(ctx->secret, ctx->secretlen); in kdf_argon2_ctx_set_secret() 1242 ctx->secretlen = 0U; in kdf_argon2_ctx_set_secret() 1251 ctx->secretlen = 0U; in kdf_argon2_ctx_set_secret() [all …]
|
/openssl/include/internal/ |
H A D | recordmethod.h | 128 size_t secretlen,
|
/openssl/include/openssl/ |
H A D | hpke.h | 136 size_t secretlen,
|
/openssl/include/crypto/ |
H A D | ecx.h | 86 unsigned char *secret, size_t *secretlen,
|
/openssl/ssl/record/ |
H A D | record.h | 176 unsigned char *secret, size_t secretlen,
|
/openssl/doc/man7/ |
H A D | provider-kem.pod | 32 unsigned char *secret, size_t *secretlen); 152 I<*secretlen>. 156 written to I<*secretlen>.
|
H A D | provider-keyexch.pod | 29 int OSSL_FUNC_keyexch_derive(void *ctx, unsigned char *secret, size_t *secretlen, 132 The length of the shared secret should be written to I<*secretlen>. 134 written to I<*secretlen>.
|