S2OPC OPCUA Toolkit
|
Defines the cryptographic abstraction interface to performing hash mechanisms. A cryptographic implementation must define all the functions declared in this file. More...
Go to the source code of this file.
Functions | |
SOPC_ReturnStatus | HashBasedCrypto_DeriveSecret_PBKDF2_HMAC_SHA256 (const SOPC_ExposedBuffer *pSecret, uint32_t lenSecret, const SOPC_ExposedBuffer *pSalt, uint32_t lenSalt, uint32_t iteration_count, SOPC_ExposedBuffer **ppOutput, uint32_t lenOutput) |
Password-Based Key Derivation Function. | |
Defines the cryptographic abstraction interface to performing hash mechanisms. A cryptographic implementation must define all the functions declared in this file.
SOPC_ReturnStatus HashBasedCrypto_DeriveSecret_PBKDF2_HMAC_SHA256 | ( | const SOPC_ExposedBuffer * | pSecret, |
uint32_t | lenSecret, | ||
const SOPC_ExposedBuffer * | pSalt, | ||
uint32_t | lenSalt, | ||
uint32_t | iteration_count, | ||
SOPC_ExposedBuffer ** | ppOutput, | ||
uint32_t | lenOutput ) |
Password-Based Key Derivation Function.
pSecret | A valid pointer which contains the data to use when generating output. |
lenSecret | Length of pSecret (bytes). |
pSalt | A valid pointer which contains the salt when generating output. |
lenSalt | Length of pSalt (bytes). |
iteration_count | Desired iteration count (as large as possible). |
ppOutput | A valid pointer to the newly created buffer which will contain the generated output. You should free it. |
lenOutput | Length of ppOutput desired. |
lenSecret
should not exceed 32 bytes because a secret longer than digest size does not protect more, because, HMAC-SHA256 is considered to have 256 bits maximum input entropy.ppOutput
when there is an error.