![]() |
MKM34Z256VLx7 Bare Metal Software Drivers
R4.1.6
Reference Manual
|
This section describes software library function's API.
Functions | |
void | mmcau_aes_set_key (const unsigned char *key, const int key_size, unsigned char *key_sch) |
AES: Performs an AES cipher key expansion. More... | |
void | mmcau_aes_encrypt (const unsigned char *in, const unsigned char *key_sch, const int nr, unsigned char *out) |
AES: Encrypts a single 16-byte block. More... | |
void | mmcau_aes_decrypt (const unsigned char *in, const unsigned char *key_sch, const int nr, unsigned char *out) |
AES: Decrypts a single 16-byte block. More... | |
int | mmcau_des_chk_parity (const unsigned char *key) |
DES: Checks key parity. More... | |
void | mmcau_des_encrypt (const unsigned char *in, const unsigned char *key, unsigned char *out) |
DES: Encrypts a single 8-byte block. More... | |
void | mmcau_des_decrypt (const unsigned char *in, const unsigned char *key, unsigned char *out) |
DES: Decrypts a single 8-byte block. More... | |
void | mmcau_md5_initialize_output (const unsigned char *md5_state) |
MD5: Initializes the MD5 state variables. More... | |
void | mmcau_md5_hash_n (const unsigned char *msg_data, const int num_blks, unsigned char *md5_state) |
MD5: Updates MD5 state variables for one or more input message blocks. More... | |
void | mmcau_md5_update (const unsigned char *msg_data, const int num_blks, unsigned char *md5_state) |
MD5: Updates MD5 state variables for one or more input message blocks. More... | |
void | mmcau_md5_hash (const unsigned char *msg_data, unsigned char *md5_state) |
MD5: Performs MD5 hash algorithm for a single input message block. More... | |
void | mmcau_sha1_initialize_output (const unsigned int *sha1_state) |
SHA1: Initializes the SHA1 state variables. More... | |
void | mmcau_sha1_hash_n (const unsigned char *msg_data, const int num_blks, unsigned int *sha1_state) |
SHA1: Perform the hash and generate SHA1 state variables. More... | |
void | mmcau_sha1_update (const unsigned char *msg_data, const int num_blks, unsigned int *sha1_state) |
SHA1: Updates SHA1 state variables for one or more input message blocks. More... | |
void | mmcau_sha1_hash (const unsigned char *msg_data, unsigned int *sha1_state) |
SHA1: Performs SHA1 hash algorithm on a single input message block. More... | |
int | mmcau_sha256_initialize_output (const unsigned int *output) |
SHA256: Init the hash output and checks the HW revision arguments. More... | |
void | mmcau_sha256_hash_n (const unsigned char *input, const int num_blks, unsigned int *output) |
SHA256: Updates digest output for one or more message blocks. More... | |
void | mmcau_sha256_update (const unsigned char *input, const int num_blks, unsigned int *output) |
SHA256: Updates state variables for one or more input message blocks. More... | |
void | mmcau_sha256_hash (const unsigned char *input, unsigned int *output) |
SHA256: Performs hash algorithm for a single input message block. More... | |
void mmcau_aes_set_key | ( | const unsigned char * | key, |
const int | key_size, | ||
unsigned char * | key_sch | ||
) |
Sets AES secret key, used for encryption and decryption (symmetric)
*key | pointer to input key (128, 192, 256 bits in length) |
key_size | key_size in bits (128, 192, 256) |
*key_sch | pointer to key schedule output (44, 52, 60 longwords) |
void mmcau_aes_encrypt | ( | const unsigned char * | in, |
const unsigned char * | key_sch, | ||
const int | nr, | ||
unsigned char * | out | ||
) |
Encrypts a single 16-byte block
*in | pointer to 16-byte block of input plaintext |
*key_sch | pointer to key schedule (44, 52, 60 longwords) |
nr | number of AES rounds (10, 12, 14 = f(key_schedule)) |
*out | pointer to 16-byte block of output ciphertext |
void mmcau_aes_decrypt | ( | const unsigned char * | in, |
const unsigned char * | key_sch, | ||
const int | nr, | ||
unsigned char * | out | ||
) |
Decrypts a single 16-byte block
*in | pointer to 16-byte block of input chiphertext |
*key_sch | pointer to key schedule (44, 52, 60 longwords) |
nr | number of AES rounds (10, 12, 14 = f(key_schedule)) |
*out | pointer to 16-byte block of output plaintext |
int mmcau_des_chk_parity | ( | const unsigned char * | key | ) |
Checks DES key parity
*key | pointer to 64-bit DES key with parity bits |
void mmcau_des_encrypt | ( | const unsigned char * | in, |
const unsigned char * | key, | ||
unsigned char * | out | ||
) |
Encrypts a single 8-byte block using DES cipher
*in | pointer to 8-byte block of input plaintext |
*key | pointer to 64-bit DES key with parity bits |
*out | pointer to 8-byte block of output ciphertext |
void mmcau_des_decrypt | ( | const unsigned char * | in, |
const unsigned char * | key, | ||
unsigned char * | out | ||
) |
Decrypts a single 8-byte block using DES cipher
*in | pointer to 8-byte block of input ciphertext |
*key | pointer to 64-bit DES key with parity bits |
*out | pointer to 8-byte block of output plaintext |
void mmcau_md5_initialize_output | ( | const unsigned char * | md5_state | ) |
Initializes the MD5 state variables
*md5_state | pointer to 120-bit block of md5 state variables: a,b,c,d |
void mmcau_md5_hash_n | ( | const unsigned char * | msg_data, |
const int | num_blks, | ||
unsigned char * | md5_state | ||
) |
Updates MD5 state variables for one or more input message blocks
*msg_data | pointer to start of input message data |
num_blks | number of 512-bit blocks to process |
*md5_state | pointer to 128-bit block of MD5 state variables: a,b,c,d |
void mmcau_md5_update | ( | const unsigned char * | msg_data, |
const int | num_blks, | ||
unsigned char * | md5_state | ||
) |
Updates MD5 state variables for one or more input message blocks
*msg_data | pointer to start of input message data |
num_blks | number of 512-bit blocks to process |
*md5_state | pointer to 128-bit block of MD5 state variables: a,b,c,d |
void mmcau_md5_hash | ( | const unsigned char * | msg_data, |
unsigned char * | md5_state | ||
) |
Performs MD5 hash algorithm for a single input message block
*msg_data | pointer to start of input message data |
*md5_state | pointer to 128-bit block of MD5 state variables: a,b,c,d |
void mmcau_sha1_initialize_output | ( | const unsigned int * | sha1_state | ) |
Initializes the SHA1 hash algorithm state variables
*sha1_state | pointer to 160-bit block of SHA1 state variables:a,b,c,d,e |
void mmcau_sha1_hash_n | ( | const unsigned char * | msg_data, |
const int | num_blks, | ||
unsigned int * | sha1_state | ||
) |
for one or more input message blocks
Perform the hash and generate SHA1 state variables
*msg_data | pointer to start of input message data |
num_blks | number of 512-bit blocks to process |
*sha1_state | pointer to 160-bit block of SHA1 state variables:a,b,c,d,e |
void mmcau_sha1_update | ( | const unsigned char * | msg_data, |
const int | num_blks, | ||
unsigned int * | sha1_state | ||
) |
Updates SHA1 state variables for one or more input message blocks
*msg_data | pointer to start of input message data |
num_blks | number of 512-bit blocks to process |
*sha1_state | pointer to 160-bit block of SHA1 state variables:a,b,c,d,e |
void mmcau_sha1_hash | ( | const unsigned char * | msg_data, |
unsigned int * | sha1_state | ||
) |
Performs SHA1 hash algorithm on a single input message block arguments
*msg_data | pointer to start of input message data |
*sha1_state | pointer to 160-bit block of SHA1 state variables:a,b,c,d,e |
int mmcau_sha256_initialize_output | ( | const unsigned int * | output | ) |
Init the hash output and checks the HW revision arguments
*output | pointer to 256-bit message digest output |
void mmcau_sha256_hash_n | ( | const unsigned char * | input, |
const int | num_blks, | ||
unsigned int * | output | ||
) |
Updates SHA256 digest output for one or more message block arguments
*input | pointer to start of input message |
num_blks | number of 512-bit blocks to process |
*output | pointer to 256-bit message digest output |
void mmcau_sha256_update | ( | const unsigned char * | input, |
const int | num_blks, | ||
unsigned int * | output | ||
) |
Updates SHA256 state variables for one or more input message blocks
*input | pointer to start of input message data |
num_blks | number of 512-bit blocks to process |
*output | pointer to 256-bit message digest output |
void mmcau_sha256_hash | ( | const unsigned char * | input, |
unsigned int * | output | ||
) |
Performs SHA256 hash algorithm for a single input message block
*input | pointer to start of input message data |
*output | pointer to 256-bit message digest output |