|
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 | SharkSslPSACMAC_compute (psa_key_id_t key, const U8 *message, U32 messageLen, U8 *mac, U16 macSize, U16 *macLen) |
| Compute AES-CMAC with a caller-owned PSA key authorized for SIGN_MESSAGE. More... | |
| SHARKSSL_API int | SharkSslPSACMAC_verify (psa_key_id_t key, const U8 *message, U32 messageLen, const U8 *mac, U16 macLen) |
| Verify AES-CMAC with a caller-owned PSA key authorized for VERIFY_MESSAGE. More... | |
See Choose a SharkSSL API for build scope and the owning API layer.
| int SharkSslPSACMAC_compute | ( | psa_key_id_t | key, |
| const U8 * | message, | ||
| U32 | messageLen, | ||
| U8 * | mac, | ||
| U16 | macSize, | ||
| U16 * | macLen | ||
| ) |
Compute AES-CMAC with a caller-owned PSA key authorized for SIGN_MESSAGE.
After output arguments pass validation, a subsequent failure clears macSize output bytes.
Returns zero on success; clears mac and returns -1 on failure.
The key remains owned by the caller.
| key | psa_key_id_t; borrowed non-null AES key handle permitting CMAC signing. |
| message | const U8 *; message bytes; may be NULL only when messageLen=0. |
| messageLen | U32; message length in bytes. |
| mac | U8 *; required caller-owned output buffer. |
| macSize | U16; output capacity in bytes, sufficient for the full CMAC (16 bytes for AES). |
| macLen | U16 *; required result length in bytes, initialized to zero. |
| int SharkSslPSACMAC_verify | ( | psa_key_id_t | key, |
| const U8 * | message, | ||
| U32 | messageLen, | ||
| const U8 * | mac, | ||
| U16 | macLen | ||
| ) |
Verify AES-CMAC with a caller-owned PSA key authorized for VERIFY_MESSAGE.
| key | psa_key_id_t; borrowed non-null AES key handle permitting CMAC verification. |
| message | const U8 *; message bytes; may be NULL only when messageLen=0. |
| messageLen | U32; message length in bytes. |
| mac | const U8 *; required expected CMAC. |
| macLen | U16; nonzero MAC length in bytes, matching the provider CMAC contract. |