From 2ca3e81f3c065a780d0d66cc8a77faabbb4d62f1 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Sat, 26 Sep 2020 19:10:19 +0300 Subject: use size_t for buffer size and its indexes - this allows using CBC/CTR with buffers larger than 4GB on 64bit systems; Closes: #172 Signed-off-by: Ihor Dutchak --- aes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'aes.h') diff --git a/aes.h b/aes.h index 0d3b2e0..ade29e8 100644 --- a/aes.h +++ b/aes.h @@ -69,8 +69,8 @@ void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf); // Suggest https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 for padding scheme // NOTES: you need to set IV in ctx via AES_init_ctx_iv() or AES_ctx_set_iv() // no IV should ever be reused with the same key -void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); -void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); +void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length); +void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length); #endif // #if defined(CBC) && (CBC == 1) @@ -82,7 +82,7 @@ void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); // Suggesting https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 for padding scheme // NOTES: you need to set IV in ctx with AES_init_ctx_iv() or AES_ctx_set_iv() // no IV should ever be reused with the same key -void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); +void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, size_t length); #endif // #if defined(CTR) && (CTR == 1) -- cgit v1.2.3