openssl/util
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
..
perl Add BSD-armv4 target based on linux-armv4 2022-08-22 08:09:25 +02:00
add-depends.pl Update copyright year 2022-05-03 13:34:51 +01:00
build.info Make util/wrap.pl work better on VMS 2021-06-18 09:08:16 +02:00
c-compress-test.pl FIPS module checksums: add scripts and Makefile rule 2021-05-04 11:32:16 +02:00
cavs-to-evptest.pl
check-format-test-negatives.c check-format.pl: improve whitespace reporting on <op>= 2022-09-02 21:32:46 +02:00
check-format-test-positives.c check-format.pl: improve whitespace reporting on <op>= 2022-09-02 21:32:46 +02:00
check-format.pl check-format.pl: improve whitespace reporting on <op>= 2022-09-02 21:32:46 +02:00
check-malloc-errs
ck_errf.pl
copy.pl
dofile.pl configdata.pm.in, util/dofile.pl: Make a HERE document stricter. 2020-10-27 10:17:19 +01:00
echo.pl always use the same perl in $PATH 2021-09-02 12:55:39 +10:00
engines.num
err-to-raise Simplify util/err-to-raise 2020-11-18 11:40:52 +01:00
find-doc-nits Add deprecation macro for 3.1 and deprecate OPENSSL_LH_stats 2022-06-22 09:36:14 +02:00
find-unused-errs
fips-checksums.sh always use the same perl in $PATH 2021-09-02 12:55:39 +10:00
fix-deprecation always use the same perl in $PATH 2021-09-02 12:55:39 +10:00
fix-includes Update copyright year 2020-04-23 13:55:52 +01:00
fix-includes.sed
indent.pro Rename DTLS1_BITMAP to DTLS_BITMAP 2022-08-18 16:38:14 +01:00
lang-compress.pl util: update FIPS checksumming script to be more aggressive with whitespace 2021-06-03 11:56:21 +10:00
libcrypto.num Add HPKE DHKEM provider support for EC, X25519 and X448. 2022-09-23 09:24:47 +01:00
libssl.num Add OSSL_QUIC methods to headers and manual pages 2022-06-03 12:07:17 +10:00
local_shlib.com.in Configuration: Fix incorrect $unified_info{attributes} references 2021-06-16 14:47:39 +01:00
markdownlint.rb Add initial demo-driven design demos 2022-06-24 16:00:00 +02:00
merge-err-lines
missingcrypto111.txt DOC: Add a few previously documented functions 2021-11-23 19:34:19 +01:00
missingcrypto-internal.txt STORE: Move the built-in 'file:' loader to become an engine module 2020-09-03 17:48:32 +02:00
missingcrypto.txt Add documentation and test for EVP_PBE_alg_add 2022-09-16 08:01:47 +02:00
missingmacro111.txt Document some SSL DH related functions/macros 2020-11-18 14:14:53 +00:00
missingmacro.txt Add deprecation macro for 3.1 and deprecate OPENSSL_LH_stats 2022-06-22 09:36:14 +02:00
missingssl111.txt
missingssl-internal.txt Initialize files that declare internal symbols 2020-04-11 15:51:43 +02:00
missingssl.txt Document {SSL|SSL_CTX}_set_{purpose|trust}() 2022-04-07 11:45:23 +02:00
mk-fipsmodule-cnf.pl Rework how providers/fipsmodule.cnf is produced 2021-05-26 15:11:01 +02:00
mkbuildinf.pl
mkdef.pl mkdef.pl: Add cmd-line flag to differentiate shared libs and DSO. 2022-05-13 10:39:16 +02:00
mkdir-p.pl Update copyright year 2021-04-08 13:04:41 +01:00
mkerr.pl Make the record layer directly aware of EtM 2022-08-18 16:38:12 +01:00
mknum.pl Ensure ordinals are created during release process 2021-06-29 09:51:30 +10:00
mkpod2html.pl Fix util/mkpod2html.pl to call pod2html with absolute paths 2021-09-21 11:05:53 +02:00
mkrc.pl util/mkrc.pl: Make sure FILEVERSION and PRODUCTVERSION have four numbers 2020-11-17 13:18:16 +01:00
mktar.sh Simplify the tarball generating scripts 2020-09-24 08:03:00 +02:00
opensslwrap.sh
other-internal.syms Suppress errors about undocumented asn1_d2i_read_bio 2021-02-22 12:11:38 +00:00
other.syms BIO_s_dgram_pair 2022-09-23 11:59:13 +10:00
providers.num
shlib_wrap.sh.in Add explicit support in util/shlib_wrap.sh.in for NonStop DLL loading. 2021-03-30 19:08:32 +02:00
su-filter.pl
unlocal_shlib.com.in Configuration: Fix incorrect $unified_info{attributes} references 2021-06-16 14:47:39 +01:00
withlibctx.pl Perl util to do with_libctx renaming 2020-10-01 09:23:05 +01:00
wrap.pl.in util/wrap.pl.in: Use parentheses so kill gets all its arguments 2022-09-15 08:42:23 +02:00
write-man-symlinks write-man-symlinks: Write relative symlinks not absolute 2021-05-25 17:14:09 +02:00