summaryrefslogtreecommitdiff
path: root/crypto/aes/aes.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-02-02 06:25:38 +0100
committerUros Majstorovic <majstor@majstor.org>2022-02-02 06:25:38 +0100
commit378d4ce7552df580e3ddd89c2faa9f8c5086d646 (patch)
tree36fe323de93de5d6b8fb27827fc57984c5b15f6d /crypto/aes/aes.h
parent9d775a05562d6166a5142d9820ffa7c26de55d6c (diff)
renamed crypto -> ext
Diffstat (limited to 'crypto/aes/aes.h')
-rw-r--r--crypto/aes/aes.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/crypto/aes/aes.h b/crypto/aes/aes.h
deleted file mode 100644
index f6dd079..0000000
--- a/crypto/aes/aes.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _AES_H_
-#define _AES_H_
-
-#include <stdint.h>
-#include <stddef.h>
-
-#define AES128 1
-//#define AES192 1
-//#define AES256 1
-
-#define AES_BLOCKLEN 16 // Block length in bytes - AES is 128b block only
-
-#if defined(AES256) && (AES256 == 1)
- #define AES_KEYLEN 32
- #define AES_KEYEXPSIZE 240
-#elif defined(AES192) && (AES192 == 1)
- #define AES_KEYLEN 24
- #define AES_KEYEXPSIZE 208
-#else
- #define AES_KEYLEN 16 // Key length in bytes
- #define AES_KEYEXPSIZE 176
-#endif
-
-typedef struct
-{
- uint8_t RoundKey[AES_KEYEXPSIZE];
-} AESCtx;
-
-void aes_init(AESCtx *ctx, uint8_t *key);
-// buffer size is exactly AES_BLOCKLEN bytes;
-void aes_ecb_encrypt(AESCtx *ctx, uint8_t *buf);
-void aes_ecb_decrypt(AESCtx *ctx, uint8_t *buf);
-// buffer size MUST be mutile of AES_BLOCKLEN;
-void aes_cbc_encrypt(AESCtx *ctx, uint8_t *iv, uint8_t *buf, size_t length);
-void aes_cbc_decrypt(AESCtx *ctx, uint8_t *iv, uint8_t *buf, size_t length);
-
-#endif \ No newline at end of file