OSSL_HPKE_keygen

Generate an HPKE recipient key pair for suite, optionally from IKM.

Synopsis

Declared in <openssl/hpke.h>

int
OSSL_HPKE_keygen(
    OSSL_HPKE_SUITE suite,
    unsigned char* pub,
    size_t* publen,
    EVP_PKEY** priv,
    unsigned char const* ikm,
    size_t ikmlen,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
suiteSuite whose KEM determines the key type.
pubDestination for the encoded public key; on input *publen is capacity.
publenIn/out public-key length.
privAddress of an EVP_PKEY* set to the new private key on success.
ikmOptional input key material for deterministic generation, or NULL for random.
ikmlenLength of ikm (0 when ikm is NULL); should be >= recommended IKM length.
libctxLibrary context for algorithm fetches, or NULL for the default.
propqOptional property query string, or NULL.