
#ifndef __ELEC0017_CRYPTO_H__
#define __ELEC0017_CRYPTO_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>

#define AES_DIR_ENCRYPT     0x00000004
#define AES_DIR_DECRYPT     0x00000000

#define AES_KEY_128BIT  0x00000008
#define AES_KEY_192BIT  0x00000010
#define AES_KEY_256BIT  0x00000018

void AESCrypt(uint32_t dir, uint8_t  *iv,
              uint8_t *data, uint8_t *result,
              uint32_t dataLength);
uint8_t * AESEncrypt(uint8_t *message, uint32_t messageLength, uint32_t *returnLength);
uint8_t * AESDecrypt(uint8_t *message, uint32_t messageLength, uint32_t *returnLength);
void AESIntHandler(void);                // Interrupt handler
void AESSetup(uint32_t key_size, uint8_t *key);    // Setup AES module
uint32_t getBlockSize(void);

#ifdef __cplusplus
}
#endif

#endif
