diff --git a/include/cryb/aes.h b/include/cryb/aes.h index f2480e4..0804c22 100644 --- a/include/cryb/aes.h +++ b/include/cryb/aes.h @@ -40,7 +40,6 @@ CRYB_BEGIN #define AES_BLOCK_LEN 16 -#define aes_digest cryb_aes_digest #define aes_ctx cryb_aes_ctx #define aes_init cryb_aes_init #define aes_update cryb_aes_update @@ -51,10 +50,9 @@ extern cipher_algorithm aes192_cipher; extern cipher_algorithm aes256_cipher; typedef struct { - int mode; - int nr; - uint32_t *rk; - uint32_t buf[68]; + int mode; + int nr; + uint32_t rk[68]; } aes_ctx; void aes_init(aes_ctx *, cipher_mode, const uint8_t *, size_t); diff --git a/lib/cipher/cryb_aes.c b/lib/cipher/cryb_aes.c index 99c114e..c8511b3 100644 --- a/lib/cipher/cryb_aes.c +++ b/lib/cipher/cryb_aes.c @@ -321,7 +321,7 @@ CRYB_DISABLE_COVERAGE return; CRYB_RESTORE_COVERAGE } - ctx->rk = RK = ctx->buf; + RK = ctx->rk; for (i = 0; i < (keysize >> 2); i++) RK[i] = le32dec(key + (i << 2)); switch (ctx->nr) { @@ -406,7 +406,7 @@ CRYB_DISABLE_COVERAGE return; CRYB_RESTORE_COVERAGE } - ctx->rk = RK = ctx->buf; + RK = ctx->rk; aes_setkey_enc(&cty, key, keysize); SK = cty.rk + cty.nr * 4; *RK++ = *SK++;