From 93af1846936267bb91f8af3f9bb8f7fbf9948bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 21 Mar 2017 13:24:02 +0100 Subject: [PATCH] Remove unused struct member. --- include/cryb/aes.h | 1 - lib/cipher/cryb_aes.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) 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);