nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ nrf_cc3xx_platform_sha256_hash()

int nrf_cc3xx_platform_sha256_hash ( void * ram_buffer,
size_t ram_buffer_size,
void * data,
size_t len,
void * out )

#include <crypto/nrf_cc310_platform/include/nrf_cc3xx_platform_sha256.h>

Calculates SHA-256.

The function will utilize the CryptoCell hardware to hash data from RAM or flash. On CC310 a RAM buffer must be provided to support hashing of data that resides in flash. If it is guaranteed that the hashing input resides in RAM or the implementation supports DMA from Flash, NULL and a size of 0 can be provided.

Note
The address provided for ram_buffer must be word-aligned. The ram_buffer_size should be a multiple of the word size between 16 and 35520 bytes.
Parameters
[in,out]ram_bufferPointer to a RAM buffer used to hash from flash.
[in]ram_buffer_sizeThe RAM buffer size in bytes.
[in]dataInput data to be hashed.
[in]lenLength of input data in bytes.
[out]outPointer to 32-byte buffer where hash digest will be written.
Returns
Zero on success, otherwise a non-zero error code.