hpkeLabeledExtract
Compute the output of the LabeledExtract function as defined in RFC9180.
Syntax
[VBA]
Public Function hpkeLabeledExtract ( _
lpSalt() As Byte, _
szLabel As String, _
lpIkm() As Byte, _
szCurveName As String, _
Optional nOptions As Long = 0 _
) As Byte()
Parameters
- lpSalt
- Byte string salt.
- szLabel
- Label string.
- lpIkm
- Input keying material (ikm).
- szCurveName
- Name of ECDH curve used in scheme. Specify one of:
"P-256" | "P-384" | "P-521" | "X25519" | "X448"
- nOptions
- Use to specify the AEAD encryption algorithm used in the scheme (if applicable). Specify either:
Zero (0) to indicate that the KDF is being used inside a KEM algorithm
or, if used in the remainder of HPKE, one of:
PKI_AEAD_AES_128_GCM
PKI_AEAD_AES_256_GCM
PKI_AEAD_CHACHA20_POLY1305
Return Value
Byte(): A pseudorandom key of fixed length Nh bytes.
Remarks
This function 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.