Put a bit of order in the src directory, group and name things appropriately

This commit is contained in:
Thomas Göttgens
2022-08-10 11:31:29 +02:00
parent 2c37be58ac
commit 5e842dd735
38 changed files with 1051 additions and 1052 deletions

View File

@@ -0,0 +1,23 @@
#ifndef _TINY_AES_H_
#define _TINY_AES_H_
#include <stdint.h>
#include <stddef.h>
#define AES_BLOCKLEN 16 // Block length in bytes - AES is 128b block only
// #define AES_KEYLEN 32
#define AES_keyExpSize 240
struct AES_ctx
{
uint8_t RoundKey[AES_keyExpSize];
uint8_t Iv[AES_BLOCKLEN];
};
void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key);
void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, const uint8_t* iv);
void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv);
void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length);
#endif // _TINY_AES_H_