Back to home page

Enduro/X

 
 

    


0001 #ifndef _EXAES_H_
0002 #define _EXAES_H_
0003 
0004 #include <stdint.h>
0005 
0006 
0007 // #define the macros below to 1/0 to enable/disable the mode of operation.
0008 //
0009 // CBC enables EXAES encryption in CBC-mode of operation.
0010 // ECB enables the basic ECB 16-byte block algorithm. Both can be enabled simultaneously.
0011 
0012 // The #ifndef-guard allows it to be configured before #include'ing or at compile time.
0013 #ifndef CBC
0014   #define CBC 1
0015 #endif
0016 
0017 #ifndef ECB
0018   #define ECB 1
0019 #endif
0020 
0021 #define EXAES128 1
0022 //#define EXAES192 1
0023 //#define EXAES256 1
0024 
0025 #if defined(ECB) && (ECB == 1)
0026 
0027 void EXAES_ECB_encrypt(const uint8_t* input, const uint8_t* key, uint8_t *output, const uint32_t length);
0028 void EXAES_ECB_decrypt(const uint8_t* input, const uint8_t* key, uint8_t *output, const uint32_t length);
0029 
0030 #endif // #if defined(ECB) && (ECB == !)
0031 
0032 
0033 #if defined(CBC) && (CBC == 1)
0034 
0035 void EXAES_CBC_encrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, const uint8_t* key, const uint8_t* iv);
0036 void EXAES_CBC_decrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, const uint8_t* key, const uint8_t* iv);
0037 
0038 #endif // #if defined(CBC) && (CBC == 1)
0039 
0040 
0041 #endif //_EXAES_H_