|
SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
|
#include "SharkSSL.h"Go to the source code of this file.
Functions | |
| SHARKSSL_API int | SharkSslPSASP800108_derive (U8 *output, U16 outputLen, psa_key_id_t key, psa_algorithm_t algorithm, const U8 *label, U16 labelLen, const U8 *context, U16 contextLen) |
| Derive exactly outputLen bytes with SP800-108 counter HMAC or CMAC. More... | |
See Choose a SharkSSL API for build scope and the owning API layer.
| int SharkSslPSASP800108_derive | ( | U8 * | output, |
| U16 | outputLen, | ||
| psa_key_id_t | key, | ||
| psa_algorithm_t | algorithm, | ||
| const U8 * | label, | ||
| U16 | labelLen, | ||
| const U8 * | context, | ||
| U16 | contextLen | ||
| ) |
Derive exactly outputLen bytes with SP800-108 counter HMAC or CMAC.
Returns -1 when the provider headers do not declare the required SP 800-108 facilities; enabling the adapter does not supply provider support.
The caller owns a PSA key authorized for DERIVE and the selected algorithm. The label cannot contain NUL. The requested length fixes the KDF's L value. Returns zero on success; clears output and returns -1 on failure.
| output | U8 *; required output buffer; cleared on failure when its supplied length is nonzero. |
| outputLen | U16; positive requested output length in bytes. |
| key | psa_key_id_t; borrowed non-null secret handle with the provider policy required for this derivation. |
| algorithm | psa_algorithm_t; a declared and supported SP 800-108 counter-mode HMAC or CMAC algorithm. |
| label | const U8 *; label bytes without embedded zero bytes; NULL is allowed with labelLen=0. |
| labelLen | U16; label length in bytes. |
| context | const U8 *; context bytes; NULL is allowed with contextLen=0. |
| contextLen | U16; context length in bytes. |