[crypto] PSA API: introduce platform API for crypto dynamic memory mgmt (#12290)

This commit introduces two new platform functions:
- otPlatCryptoCAlloc()
- otPlatCryptoFree()

It also provides a default implementation using the OpenThread Heap.

This API is necessary for the upcoming work related to PSA API

Signed-off-by: Łukasz Duda <[email protected]>
This commit is contained in:
Łukasz Duda
2026-01-13 18:46:00 -08:00
committed by GitHub
parent 103b601384
commit 8bdc6cf339
7 changed files with 48 additions and 14 deletions
+4
View File
@@ -106,6 +106,10 @@ extern "C" {
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
OT_TOOL_WEAK void otPlatFree(void *aPtr) { free(aPtr); }
OT_TOOL_WEAK void *otPlatCryptoCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
OT_TOOL_WEAK void otPlatCryptoFree(void *aPtr) { free(aPtr); }
#endif
OT_TOOL_WEAK void otTaskletsSignalPending(otInstance *) {}