Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
shalib.h File Reference
SHA256 Library API. More...
Go to the source code of this file.
Data Structures | |
struct | prf_sec_param_t |
PRF 256 stucture This structure is used to configure PRF calc operation: secret, label, seed and buffer before call shalib_prf_calc(). More... | |
Functions | |
void | SHALIB_init_HMAC (const uint8_t *secret, uint8_t sec_len) |
Init HMAC256 operation by given security material. | |
void | SHALIB_push_data_HMAC (const void *data, uint16_t len) |
Push data for HMAC. | |
void | SHALIB_finish_HMAC (void *buffer, uint8_t nwords) |
Finish HMAC256 operation and save result in given buffer. | |
prf_sec_param_t * | shalib_prf_param_get (void) |
PRF API. | |
void | shalib_prf_calc (void *output, uint_fast16_t nwords) |
Finish PRF256 operation and save result in given buffer. |
Detailed Description
SHA256 Library API.
HMAC256 process sequence:
1. SHALIB_init_HMAC(), Init HMAC IN process by given security signature material 2. SHALIB_push_data_HMAC(), Give data sectors(s) one by one 3. SHALIB_finish_HMAC(), Finish HMAC and save SHA256 hash to given buffer
PRF256 process sequence:
1. shalib_prf_param_get(), Init PRF and get configure structure 2. Set the following parameters to configure structure:
- HMAC security signature pointer and length
- Label text
- Seed data and length 3. shalib_prf_calc(), Calc PRF256 HASH
Definition in file shalib.h.
Function Documentation
void SHALIB_finish_HMAC | ( | void * | buffer, |
uint8_t | nwords | ||
) |
Finish HMAC256 operation and save result in given buffer.
- Parameters:
-
buffer A pointer to result buffer. nwords Length of 32-bit register to save to buffer (8= 256 bit and 4= 128-bit).
void SHALIB_init_HMAC | ( | const uint8_t * | secret, |
uint8_t | sec_len | ||
) |
Init HMAC256 operation by given security material.
- Parameters:
-
secret A pointer to security material. sec_len Length of security material.
void shalib_prf_calc | ( | void * | output, |
uint_fast16_t | nwords | ||
) |
Finish PRF256 operation and save result in given buffer.
prf_sec_param_t* shalib_prf_param_get | ( | void | ) |
PRF API.
Init PRF library and SHA registers. This function returns configure structure where the user needs to set the following items: -Security material and length -Label text and length -Seed data and length
- Returns:
- A pointer to PRF configure structure.
void SHALIB_push_data_HMAC | ( | const void * | data, |
uint16_t | len | ||
) |
Push data for HMAC.
- Parameters:
-
data A pointer to data. len Length of data.
Generated on Tue Jul 12 2022 17:35:04 by
