API
2.2
TSmarT Software Library

Functions  
void  aes_encrypt (unsigned char *state, unsigned char *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 (unsigned char *state, unsigned char *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...  
signed long  aes_read_key (unsigned char *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...  
signed long  aes_write_key (unsigned char *key) 
writes AES128 key from EEPROM Writes the AES128 key to fileID #12 in EEPROM More...  
void  expandKey (unsigned char *expandedKey, unsigned char *key) 
expend a 16 bytes key for AES128 implementation More...  
unsigned char  galois_mul2 (unsigned char value) 
multiply by 2 in the galois field More...  
void  aes_encr (unsigned char *state, unsigned char *expandedKey) 
internal implementation of AES128 encryption. straight forward aes encryption implementation first the group of operations More...  
void  aes_decr (unsigned char *state, unsigned char *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_decr  (  unsigned char *  state, 
unsigned char *  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
expandedKey  expanded AES128 key 
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  (  unsigned char *  state, 
unsigned char *  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
key  AES128 key of size 16 bytes 
state  16 bytes of cipher text and plain text 
void aes_encr  (  unsigned char *  state, 
unsigned char *  expandedKey  
) 
internal implementation of AES128 encryption. straight forward aes encryption implementation first the group of operations
aes_encr
expandedKey  expanded AES128 key 
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  (  unsigned char *  state, 
unsigned char *  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
key  AES128 key of size 16 bytes 
state  16 bytes of plain text and cipher text 
signed long aes_read_key  (  unsigned char *  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 
signed long aes_write_key  (  unsigned char *  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  (  unsigned char *  expandedKey, 
unsigned char *  key  
) 
expend a 16 bytes key for AES128 implementation
expandKey
key  AES128 key  16 bytes 
expandedKey  expanded AES128 key 
unsigned char galois_mul2  (  unsigned char  value  ) 
multiply by 2 in the galois field
galois_mul2
value  argument to multiply 