Wirepas SDK
|
Go to the source code of this file.
Functions | |
void | aes_setupStream (aes_data_stream_t *stream_ptr, const uint8_t *key128_ptr, const uint8_t *iv_ctr_ptr) |
Setup generic AES128 CTR mode stream. More... | |
void | aes_initOmac1 (aes_omac1_state_t *state_ptr, const uint8_t *mic_key_ptr) |
Initializes an OMAC1 state. More... | |
void | aes_omac1 (aes_omac1_state_t *state, uint8_t *mic_out_ptr, uint_fast8_t mic_out_bytes, const uint8_t *intext_ptr, size_t intext_bytes) |
Calculate and write out OMAC1 (CMAC) MIC for input text. More... | |
void | aes_crypto128Ctr (aes_data_stream_t *stream_ptr, const uint8_t *intext_ptr, uint8_t *outtext_ptr, size_t bytecount) |
Run the AES128 cryptography in CTR mode. More... | |
Data Structures | |
union | aes_128_t |
For storing 128bit keys, IVs, MACs etc. Allows both byte and faster 32-bit word-aligned access. More... | |
struct | aes_data_stream_t |
AES-128 key, input data and output data. More... | |
struct | aes_omac1_state_t |
AES-128 OMAC1 state. More... | |
union | aes_data_stream_t.__unnamed__ |
Macros | |
#define | AES_128_KEY_BLOCK_SIZE 16 |
AES 128 block size in bytes. More... | |
void aes_crypto128Ctr | ( | aes_data_stream_t * | stream_ptr, |
const uint8_t * | intext_ptr, | ||
uint8_t * | outtext_ptr, | ||
size_t | bytecount | ||
) |
Run the AES128 cryptography in CTR mode.
stream_ptr | Pointer to aes_data_stream_t to be used |
intext_ptr | Pointer to input text |
outtext_ptr | Pointer to output text. Supports intext overwrite |
bytecount | Number of bytes to handle |
void aes_initOmac1 | ( | aes_omac1_state_t * | state_ptr, |
const uint8_t * | mic_key_ptr | ||
) |
Initializes an OMAC1 state.
state_ptr | Pointer to aes_omac1_state_t to be set up |
mic_key_ptr | Pointer to the secret 16-byte MIC key, which is no longer needed after this function returns |
void aes_omac1 | ( | aes_omac1_state_t * | state, |
uint8_t * | mic_out_ptr, | ||
uint_fast8_t | mic_out_bytes, | ||
const uint8_t * | intext_ptr, | ||
size_t | intext_bytes | ||
) |
Calculate and write out OMAC1 (CMAC) MIC for input text.
state | Pointer to OMAC1 AES-128 state |
mic_out_ptr | Pointer for writing MIC |
mic_out_bytes | Amount of MIC bytes wanted (1...16) |
intext_ptr | Pointer to input text |
intext_bytes | Length of input text |
void aes_setupStream | ( | aes_data_stream_t * | stream_ptr, |
const uint8_t * | key128_ptr, | ||
const uint8_t * | iv_ctr_ptr | ||
) |
Setup generic AES128 CTR mode stream.
stream_ptr | Pointer to aes_data_stream_t to be set up |
key128_ptr | Pointer to key, copied to the stream struct |
iv_ctr_ptr | Pointer to iv_ctr, copied to the stream struct |
union aes_128_t |
struct aes_data_stream_t |
AES-128 key, input data and output data.
Every independent stream cipher flow should have one of these. This structure layout was created specifically for the Nordic nRF51822 AES ECB peripheral. However, this software implementations also use the same structure, for symmetry.
Data Fields | ||
---|---|---|
union aes_data_stream_t | __unnamed__ | |
uint32_t | aes_out[4] | |
uint32_t | key[4] |
struct aes_omac1_state_t |
union aes_data_stream_t.__unnamed__ |