From 084974280327360fb5b22f1281160ebe63af6f2a Mon Sep 17 00:00:00 2001 From: Nick Knudson Date: Wed, 31 Jan 2018 16:31:15 -0500 Subject: CTR-only mode still needs functions to update counter (iv) --- aes.c | 2 +- aes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aes.c b/aes.c index 8fd0a85..3e0b3e3 100644 --- a/aes.c +++ b/aes.c @@ -226,7 +226,7 @@ void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key) { KeyExpansion(ctx->RoundKey, key); } -#if defined(CBC) && (CBC == 1) +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, const uint8_t* iv) { KeyExpansion(ctx->RoundKey, key); diff --git a/aes.h b/aes.h index a57a2f0..dd16622 100644 --- a/aes.h +++ b/aes.h @@ -49,7 +49,7 @@ struct AES_ctx }; void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key); -#if defined(CBC) && (CBC == 1) +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) 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); #endif -- cgit v1.2.3