@@ -123,6 +123,9 @@ typedef struct otCryptoKey
123123 * @struct otCryptoContext
124124 *
125125 * Stores the context object for platform APIs.
126+ *
127+ * If `OPENTHREAD_CONFIG_CRYPTO_PLATFORM_ALLOCS_CONTEXT` is enabled, the platform allocates and populates this.
128+ * Otherwise OpenThread core allocates and populates this.
126129 */
127130typedef struct otCryptoContext
128131{
@@ -325,6 +328,9 @@ void otPlatCryptoFree(void *aPtr);
325328 * @retval OT_ERROR_FAILED Failed to initialize HMAC operation.
326329 * @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
327330 *
331+ * @note If `OPENTHREAD_CONFIG_CRYPTO_PLATFORM_ALLOCS_CONTEXT` is enabled, @p aContext is populated by the platform.
332+ * Otherwise OpenThread core allocates and populates it.
333+ *
328334 * @note The platform driver shall point the context to the correct object such as psa_mac_operation_t or
329335 * mbedtls_md_context_t.
330336 */
@@ -389,6 +395,9 @@ otError otPlatCryptoHmacSha256Finish(otCryptoContext *aContext, uint8_t *aBuf, s
389395 * @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
390396 * @retval OT_ERROR_NO_BUFS Cannot allocate the context.
391397 *
398+ * @note If `OPENTHREAD_CONFIG_CRYPTO_PLATFORM_ALLOCS_CONTEXT` is enabled, @p aContext is populated by the platform.
399+ * Otherwise OpenThread core allocates and populates it.
400+ *
392401 * @note The platform driver shall point the context to the correct object such as psa_key_id
393402 * or mbedtls_aes_context_t.
394403 */
@@ -435,10 +444,13 @@ otError otPlatCryptoAesFree(otCryptoContext *aContext);
435444 *
436445 * @param[in] aContext Context for HKDF operation.
437446 *
438- * @retval OT_ERROR_NONE Successfully Initialised AES operation.
439- * @retval OT_ERROR_FAILED Failed to Initialise AES operation.
447+ * @retval OT_ERROR_NONE Successfully Initialised HKDF operation.
448+ * @retval OT_ERROR_FAILED Failed to Initialise HKDF operation.
440449 * @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
441450 *
451+ * @note If `OPENTHREAD_CONFIG_CRYPTO_PLATFORM_ALLOCS_CONTEXT` is enabled, @p aContext is populated by the platform.
452+ * Otherwise OpenThread core allocates and populates it.
453+ *
442454 * @note The platform driver shall point the context to the correct object such as psa_key_derivation_operation_t
443455 * or HmacSha256::Hash
444456 */
@@ -499,6 +511,8 @@ otError otPlatCryptoHkdfDeinit(otCryptoContext *aContext);
499511 * @retval OT_ERROR_FAILED Failed to initialise SHA-256 operation.
500512 * @retval OT_ERROR_INVALID_ARGS @p aContext was NULL
501513 *
514+ * @note If `OPENTHREAD_CONFIG_CRYPTO_PLATFORM_ALLOCS_CONTEXT` is enabled, @p aContext is populated by the platform.
515+ * Otherwise OpenThread core allocates and populates it.
502516 *
503517 * @note The platform driver shall point the context to the correct object such as psa_hash_operation_t
504518 * or mbedtls_sha256_context.
0 commit comments