mirror of
https://github.com/kokke/tiny-AES-c
synced 2024-11-22 05:21:52 +03:00
CTR-only mode still needs functions to update counter (iv)
This commit is contained in:
parent
ddd84d3787
commit
0849742803
2
aes.c
2
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);
|
||||
|
2
aes.h
2
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
|
||||
|
Loading…
Reference in New Issue
Block a user