CryptoSys PKI
23.0.0
|
Hybrid Public Key Encryption functions (HPKE). More...
Public Types | |
enum class | AeadAlg |
AEAD functions supported for HPKE. More... | |
enum class | CurveName |
Supported ECDH curves for HPKE. More... | |
enum class | OutputOpts |
Options to format or re-encode output. More... | |
Static Public Member Functions | |
static std::string | DerivePrivateKey (const bvec_t &ikm, CurveName curve, OutputOpts opts=OutputOpts::Default) |
Derive an EC private key in a deterministic manner from input keying material using the DeriveKeyPair algorithm in RFC9180. More... | |
static bvec_t | LabeledExpand (int numBytes, const bvec_t &prk, std::string label, const bvec_t &info, CurveName curve, AeadAlg aeadAlg=AeadAlg::None) |
Compute the output of the LabeledExpand function as defined in RFC9180. More... | |
static bvec_t | LabeledExtract (const bvec_t &salt, std::string label, const bvec_t &ikm, CurveName curve, AeadAlg aeadAlg=AeadAlg::None) |
Compute the output of the LabeledExtract function as defined in RFC9180. More... | |
Hybrid Public Key Encryption functions (HPKE).
|
strong |
|
strong |
|
strong |
|
static |
Derive an EC private key in a deterministic manner from input keying material using the DeriveKeyPair algorithm in RFC9180.
ikm | Input key material (ikm). This must have length in bytes at least as long as the key to be produced. |
curve | Curve name. |
opts | Output options (default=internal key format). |
|
static |
Compute the output of the LabeledExpand function as defined in RFC9180.
numBytes | Required number of bytes (L) of output keying material. |
prk | Pseudorandom key (prk). |
label | Label string. |
info | Byte string info. |
curve | ECDH curve used in scheme. |
aeadAlg | AEAD encryption algorithm used in the scheme or AeadAlg::None (default) to indicate KDF is being used inside a KEM algorithm.. |
LabeledExpand
function is defined in section 4 of [RFC9180]. It uses the "expand" stage of the HKDF function [RFC5869]. The ECDH curve group used in the scheme must be specified, which automatically fixes the KDF and associated HMAC algorithm to be used.
|
static |
Compute the output of the LabeledExtract function as defined in RFC9180.
salt | Byte string salt. |
label | Label string. |
ikm | Input key material (ikm). |
curve | ECDH curve used in scheme. |
aeadAlg | AEAD encryption algorithm used in the scheme or AeadAlg::None (default) to indicate KDF is being used inside a KEM algorithm. |
LabeledExtract
function is defined in section 4 of [RFC9180]. It uses the "extract" stage of the HKDF function [RFC5869] and outputs a fixed value of bytes equal to the length (Nh) of the underlying HMAC function used by the KDF algorithm. The ECDH curve group used in the scheme must be specified, which automatically fixes the KDF and associated HMAC algorithm to be used.