49 #define AES_BLOCKLEN 16 //Block length in bytes AES is 128b block only
51 #if defined(AES256) && (AES256 == 1)
53 #define AES_keyExpSize 240
54 #elif defined(AES192) && (AES192 == 1)
56 #define AES_keyExpSize 208
58 #define AES_KEYLEN 16 // Key length in bytes
59 #define AES_keyExpSize 176
67 #if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1))
68 uint8_t
Iv[AES_BLOCKLEN];
72 void AES_init_ctx(
struct AES_ctx* ctx,
const uint8_t* key);
73 #if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1))
74 void AES_init_ctx_iv(
struct AES_ctx* ctx,
const uint8_t* key,
const uint8_t* iv);
75 void AES_ctx_set_iv(
struct AES_ctx* ctx,
const uint8_t* iv);
78 #if defined(ECB) && (ECB == 1)
82 void AES_ECB_encrypt(
const struct AES_ctx* ctx, uint8_t* buf);
83 void AES_ECB_decrypt(
const struct AES_ctx* ctx, uint8_t* buf);
85 #endif // #if defined(ECB) && (ECB == !)
88 #if defined(CBC) && (CBC == 1)
93 void AES_CBC_encrypt_buffer(
struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
94 void AES_CBC_decrypt_buffer(
struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
96 #endif // #if defined(CBC) && (CBC == 1)
99 #if defined(CTR) && (CTR == 1)
106 void AES_CTR_xcrypt_buffer(
struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
108 #endif // #if defined(CTR) && (CTR == 1)