Concrete base class to assist with implementing HKDF mode for hash algorithms.
More...
#include <HKDF.h>
|
virtual | ~HKDFCommon () |
| Destroys this HKDF instance.
|
|
void | setKey (const void *key, size_t keyLen, const void *salt=0, size_t saltLen=0) |
| Sets the key and salt for a HKDF session. More...
|
|
void | extract (void *out, size_t outLen, const void *info=0, size_t infoLen=0) |
| Extracts data from a HKDF session. More...
|
|
void | clear () |
| Clears sensitive information from this HKDF instance.
|
|
Concrete base class to assist with implementing HKDF mode for hash algorithms.
Reference: https://datatracker.ietf.org/doc/html/rfc5869
- See also
- HKDF
Definition at line 29 of file HKDF.h.
◆ HKDFCommon()
HKDFCommon::HKDFCommon |
( |
| ) |
|
|
protected |
◆ extract()
void HKDFCommon::extract |
( |
void * |
out, |
|
|
size_t |
outLen, |
|
|
const void * |
info = 0 , |
|
|
size_t |
infoLen = 0 |
|
) |
| |
Extracts data from a HKDF session.
- Parameters
-
out | Points to the buffer to fill with extracted data. |
outLen | Number of bytes to extract into the out buffer. |
info | Points to the application-specific information string. |
infoLen | Length of the info string in bytes. |
- Note
- RFC 5869 specifies that a maximum of 255 * HashLen bytes should be extracted from a HKDF session. This maximum is not enforced by this function.
Definition at line 96 of file HKDF.cpp.
◆ setHashAlgorithm()
void HKDFCommon::setHashAlgorithm |
( |
Hash * |
hashAlg, |
|
|
uint8_t * |
buffer |
|
) |
| |
|
inlineprotected |
Sets the hash algorithm to use for HKDF operations.
- Parameters
-
hashAlg | Points to the hash algorithm instance to use. |
buffer | Points to a buffer that must be at least twice the size of the hash output from hashAlg. |
Definition at line 42 of file HKDF.h.
◆ setKey()
void HKDFCommon::setKey |
( |
const void * |
key, |
|
|
size_t |
keyLen, |
|
|
const void * |
salt = 0 , |
|
|
size_t |
saltLen = 0 |
|
) |
| |
Sets the key and salt for a HKDF session.
- Parameters
-
key | Points to the key. |
keyLen | Length of the key in bytes. |
salt | Points to the salt. |
saltLen | Length of the salt in bytes. |
Definition at line 64 of file HKDF.cpp.
The documentation for this class was generated from the following files: