CC3000
1.12
|
Functions | |
void | expandKey (UINT8 *expandedKey, UINT8 *key) |
expend a 16 bytes key for AES128 implementation More... | |
UINT8 | galois_mul2 (UINT8 value) |
multiply by 2 in the galois field More... | |
void | aes_encr (UINT8 *state, UINT8 *expandedKey) |
internal implementation of AES128 encryption. straight forward aes encryption implementation first the group of operations More... | |
void | aes_decr (UINT8 *state, UINT8 *expandedKey) |
internal implementation of AES128 decryption. straight forward aes decryption implementation the order of substeps is the exact reverse of decryption inverse functions: More... | |
void | aes_encrypt (UINT8 *state, UINT8 *key) |
AES128 encryption: Given AES128 key and 16 bytes plain text, cipher text of 16 bytes is computed. The AES implementation is in mode ECB (Electronic Code Book). More... | |
void | aes_decrypt (UINT8 *state, UINT8 *key) |
AES128 decryption: Given AES128 key and 16 bytes cipher text, plain text of 16 bytes is computed The AES implementation is in mode ECB (Electronic Code Book). More... | |
INT32 | aes_read_key (UINT8 *key) |
Reads AES128 key from EEPROM Reads the AES128 key from fileID #12 in EEPROM returns an error if the key does not exist. More... | |
INT32 | aes_write_key (UINT8 *key) |
writes AES128 key from EEPROM Writes the AES128 key to fileID #12 in EEPROM More... | |
Variables | |
const UINT8 | sbox [256] |
const UINT8 | rsbox [256] |
const UINT8 | Rcon [11] |
UINT8 | expandedKey [176] |
void aes_decr | ( | UINT8 * | state, |
UINT8 * | expandedKey | ||
) |
internal implementation of AES128 decryption. straight forward aes decryption implementation the order of substeps is the exact reverse of decryption inverse functions:
aes_decr
[in] | expandedKey | expanded AES128 key |
in\out] | state 16 bytes of cipher text and plain text |
- addRoundKey is its own inverse - rsbox is inverse of sbox - rightshift instead of leftshift - invMixColumns = barreto + mixColumns no further subfunctions to save cycles for function calls no structuring with "for (....)" to save cycles
void aes_decrypt | ( | UINT8 * | state, |
UINT8 * | key | ||
) |
AES128 decryption: Given AES128 key and 16 bytes cipher text, plain text of 16 bytes is computed The AES implementation is in mode ECB (Electronic Code Book).
aes_decrypt
[in] | key | AES128 key of size 16 bytes |
in\out] | state 16 bytes of cipher text and plain text |
void aes_encr | ( | UINT8 * | state, |
UINT8 * | expandedKey | ||
) |
internal implementation of AES128 encryption. straight forward aes encryption implementation first the group of operations
aes_encr
[in] | expandedKey | expanded AES128 key |
in/out] | state 16 bytes of plain text and cipher text |
- addRoundKey - subbytes - shiftrows - mixcolums is executed 9 times, after this addroundkey to finish the 9th round, after that the 10th round without mixcolums no further subfunctions to save cycles for function calls no structuring with "for (....)" to save cycles.
void aes_encrypt | ( | UINT8 * | state, |
UINT8 * | key | ||
) |
AES128 encryption: Given AES128 key and 16 bytes plain text, cipher text of 16 bytes is computed. The AES implementation is in mode ECB (Electronic Code Book).
aes_encrypt
[in] | key | AES128 key of size 16 bytes |
in\out] | state 16 bytes of plain text and cipher text |
INT32 aes_read_key | ( | UINT8 * | key | ) |
Reads AES128 key from EEPROM Reads the AES128 key from fileID #12 in EEPROM returns an error if the key does not exist.
aes_read_key
[out] | key | AES128 key of size 16 bytes |
INT32 aes_write_key | ( | UINT8 * | key | ) |
writes AES128 key from EEPROM Writes the AES128 key to fileID #12 in EEPROM
aes_write_key
[out] | key | AES128 key of size 16 bytes |
void expandKey | ( | UINT8 * | expandedKey, |
UINT8 * | key | ||
) |
expend a 16 bytes key for AES128 implementation
expandKey
key | AES128 key - 16 bytes |
expandedKey | expanded AES128 key |
UINT8 galois_mul2 | ( | UINT8 | value | ) |
multiply by 2 in the galois field
galois_mul2
value | argument to multiply |
const UINT8 Rcon[11] |
const UINT8 rsbox[256] |
const UINT8 sbox[256] |