openssl/include/crypto
slontis 78c44b0594 Add HPKE DHKEM provider support for EC, X25519 and X448.
The code is derived from @sftcd's work in PR #17172.
This PR puts the DHKEM algorithms into the provider layer as
KEM algorithms for EC and ECX.

This PR only implements the DHKEM component of HPKE as specified in
RFC 9180.

crypto/hpke/hpke_util.c has been added for fuctions that will
be shared between DHKEM and HPKE.

API's for EVP_PKEY_auth_encapsulate_init() and EVP_PKEY_auth_decapsulate_init()
have been added to support authenticated encapsulation. auth_init() functions
were chosen rather that a EVP_PKEY_KEM_set_auth() interface to support
future algorithms that could possibly need different init functions.

Internal code has been refactored, so that it can be shared between the DHKEM
and other systems. Since DHKEM operates on low level keys it needs to be
able to do low level ECDH and ECXDH calls without converting the keys
back into EVP_PKEY/EVP_PKEY_CTX form. See ossl_ecx_compute_key(),
ossl_ec_public_from_private()

DHKEM requires API's to derive a key using a seed (IKM). This did not sit
well inside the DHKEM itself as dispatch functions. This functionality
fits better inside the EC and ECX keymanagers keygen, since
they are just variations of keygen where the private key is generated
in a different manner. This should mainly be used for testing purposes.
See ossl_ec_generate_key_dhkem().
It supports this by allowing a settable param to be passed to keygen
(See OSSL_PKEY_PARAM_DHKEM_IKM).
The keygen calls code within ec and ecx dhkem implementation to handle this.
See ossl_ecx_dhkem_derive_private() and ossl_ec_dhkem_derive_private().
These 2 functions are also used by the EC/ECX DHKEM implementations to generate
the sender ephemeral keys.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19068)
2022-09-23 09:24:47 +01:00
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
aes_platform.h Fix AES-GCM on Power 8 CPUs 2022-09-13 14:41:39 +02:00
aria.h Add ossl_aria symbols 2021-03-18 17:52:37 +10:00
asn1_dsa.h Add ossl_encode symbols 2021-03-18 17:52:37 +10:00
asn1.h libcrypto and test: rename asn1_string_to_time_t to ossl_asn1_string_to_time_t 2022-07-19 08:44:19 +02:00
asn1err.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
async.h Update copyright year 2021-02-18 15:05:17 +00:00
asyncerr.h Update copyright year 2021-06-17 13:24:59 +01:00
bioerr.h BIO_dgram support for BIO_sendmmsg/BIO_recvmmsg 2022-09-01 18:03:10 +10:00
bn_conf.h.in Update copyright year 2021-02-18 15:05:17 +00:00
bn_dh.h Update copyright year 2021-03-11 13:27:36 +00:00
bn_srp.h Update copyright year 2021-04-08 13:04:41 +01:00
bn.h Fix external symbols for bn 2021-02-26 10:32:22 +10:00
bnerr.h RSA keygen update: Raise an error if no prime candidate q is found. 2022-06-13 10:56:31 +02:00
buffererr.h Update copyright year 2021-06-17 13:24:59 +01:00
chacha.h Update copyright year 2021-02-18 15:05:17 +00:00
cmll_platform.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
cmperr.h Update copyright year 2021-06-17 13:24:59 +01:00
cmserr.h CMS sign digest 2022-04-02 10:42:16 -04:00
comperr.h Update copyright year 2021-06-17 13:24:59 +01:00
conferr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
context.h Refactor OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA 2022-04-01 10:49:19 +11:00
crmferr.h Update copyright year 2021-06-17 13:24:59 +01:00
cryptlib.h Fix a memleak in the FIPS provider 2021-05-24 09:39:15 +10:00
cryptoerr.h err: add additional errors 2022-01-12 20:10:21 +11:00
cterr.h Update copyright year 2021-06-17 13:24:59 +01:00
ctype.h tolower: refine the tolower code to avoid a memory access 2022-05-23 09:51:28 +10:00
decoder.h Remove the _fetch_by_number functions 2022-05-06 10:38:55 +10:00
decodererr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
des_platform.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
dh.h Update copyright year 2022-05-03 13:34:51 +01:00
dherr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
dsa.h Update copyright year 2022-05-03 13:34:51 +01:00
dsaerr.h Update copyright year 2021-06-17 13:24:59 +01:00
dso_conf.h.in Update copyright year 2021-02-18 15:05:17 +00:00
ec.h Add HPKE DHKEM provider support for EC, X25519 and X448. 2022-09-23 09:24:47 +01:00
ecerr.h Add error code for unsupported explicit parameters 2022-04-14 08:51:18 +02:00
ecx.h Add HPKE DHKEM provider support for EC, X25519 and X448. 2022-09-23 09:24:47 +01:00
encoder.h Remove the _fetch_by_number functions 2022-05-06 10:38:55 +10:00
encodererr.h Update copyright year 2021-06-17 13:24:59 +01:00
engine.h
engineerr.h Update copyright year 2021-06-17 13:24:59 +01:00
err.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
ess.h TS ESS: Move four internal aux function to where they belong in crypto/ts 2021-04-28 14:10:47 +02:00
esserr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
evp.h Limit the size of various MAXCHUNK definitions 2022-08-19 17:26:12 +10:00
evperr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
hpke.h Add HPKE DHKEM provider support for EC, X25519 and X448. 2022-09-23 09:24:47 +01:00
httperr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
lhash.h Add ossl_lhash symbols 2021-03-18 17:52:38 +10:00
md32_common.h Add ROTATE inline asm support for SM3 2022-06-22 12:46:50 +02:00
modes.h Implement AES-GCM-SIV (RFC8452) 2022-07-29 08:32:16 -04:00
objects.h Update copyright year 2021-04-08 13:04:41 +01:00
objectserr.h Update copyright year 2021-06-17 13:24:59 +01:00
ocsperr.h Update copyright year 2021-06-17 13:24:59 +01:00
pem.h Fix copyrights 2022-02-03 13:56:38 +01:00
pemerr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
pkcs7.h Add library context and property query support into the PKCS12 API 2021-04-30 09:15:50 +10:00
pkcs7err.h Update copyright year 2021-06-17 13:24:59 +01:00
pkcs12err.h Update copyright year 2021-06-17 13:24:59 +01:00
poly1305.h Update copyright year 2021-02-18 15:05:17 +00:00
ppc_arch.h Update copyright year 2022-05-03 13:34:51 +01:00
punycode.h punycode: fix indentation 2021-06-19 15:54:06 +10:00
rand_pool.h Add ossl_rand symbols 2021-03-18 17:52:37 +10:00
rand.h Pre-declare all core dispatch table functions, and fix the internal ones 2022-07-13 07:56:51 +02:00
randerr.h Update copyright year 2021-06-17 13:24:59 +01:00
riscv_arch.def Add riscv scalar crypto extension capability 2022-06-10 11:45:41 +02:00
riscv_arch.h Add basic RISC-V cpuid and OPENSSL_riscvcap 2022-05-19 16:32:49 +10:00
rsa.h Update copyright year 2022-05-03 13:34:51 +01:00
rsaerr.h errors: update error message (to be squashed) 2021-05-27 13:01:50 +10:00
security_bits.h Fix misc external ossl_ symbols. 2021-03-18 17:52:37 +10:00
sha.h Crypto: Add deprecation compatibility declarations for SHA* message digest functions 2021-05-08 14:41:36 +02:00
siphash.h Fix a TODO(3.0) in the siphash code 2021-03-17 10:16:21 +10:00
siv.h Update copyright year 2021-04-08 13:04:41 +01:00
sm2.h Correctly calculate the length of SM2 plaintext given the ciphertext 2021-08-24 14:22:07 +01:00
sm2err.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
sm4_platform.h SM4 optimization for ARM by ASIMD 2022-04-12 10:37:42 +02:00
sm4.h Add ossl_ symbols for sm3 and sm4 2021-03-18 17:52:37 +10:00
sparc_arch.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
sparse_array.h Add ossl_sa symbols 2021-03-18 17:52:37 +10:00
store.h Add method store cache flush and method removal to non-EVP operations 2022-05-05 15:06:12 +02:00
storeerr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
tserr.h Update copyright year 2021-06-17 13:24:59 +01:00
types.h Added guarding #ifndef/#define to avoid duplicate include of crypto/types.h 2021-03-31 13:28:46 +10:00
uierr.h Update copyright year 2021-06-17 13:24:59 +01:00
x509.h X509: clean up doc and implementation of X509{,_REQ}_check_private_key() 2022-08-24 11:27:12 +02:00
x509err.h x509_att.c: improve error checking and reporting and coding style 2022-08-24 11:25:04 +02:00
x509v3err.h Update copyright year 2021-06-17 13:24:59 +01:00