You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
2.6 KiB

1 year ago
//#############################################################################################################################################################################################################
#ifndef _INC_AES_H_
#define _INC_AES_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
//#include <string.h>
//#include <avr/pgmspace.h>
#include "SYSTEM.h"
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define AES_NB 4U
#define AES_NK_256BIT 8U
#define AES_NR_256BIT 14U
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define AES_KEY_AES256_SIZE 32U
#define AES_BLOCK_SIZE 16U
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/*
enum AES_CIPHER_KEY_LENGTH {
AES_128 = 0x00,
AES_192, //UNSUPPORTED
AES_256
};
*/
//ONLY AES256 SUPPORTED!!!
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_InvCipher(uint8_t *IN, uint8_t *w, uint8_t *IV);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_Decrypt(uint8_t *InpData, uint16_t InpDataLength);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_PrepareKeys(uint8_t *Key, uint8_t *IV);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif //_INC_AES_H_
//#############################################################################################################################################################################################################