diff --git a/include/cryb/aes.h b/include/cryb/aes.h index d2a368a..999a984 100644 --- a/include/cryb/aes.h +++ b/include/cryb/aes.h @@ -52,7 +52,6 @@ extern cipher_algorithm aes192_cipher; extern cipher_algorithm aes256_cipher; typedef struct { - int mode; int nr; uint32_t rk[68]; } aes_ctx; diff --git a/lib/cipher/cryb_aes.c b/lib/cipher/cryb_aes.c index df4cde3..abc1e96 100644 --- a/lib/cipher/cryb_aes.c +++ b/lib/cipher/cryb_aes.c @@ -581,8 +581,7 @@ aes_init(aes_ctx *ctx, cipher_mode mode, const uint8_t *key, size_t keylen) assert(mode == CIPHER_MODE_ENCRYPT || mode == CIPHER_MODE_DECRYPT); assert(keylen == 16 || keylen == 24 || keylen == 32); memset(ctx, 0, sizeof *ctx); - ctx->mode = mode; - if (ctx->mode == CIPHER_MODE_DECRYPT) + if (mode == CIPHER_MODE_DECRYPT) aes_setkey_dec(ctx, key, keylen); else aes_setkey_enc(ctx, key, keylen);