@@ -498,9 +498,9 @@ static void XorWithIv(uint8_t* buf, const uint8_t* Iv)
498
498
}
499
499
}
500
500
501
- void AES_CBC_encrypt_buffer (struct AES_ctx * ctx , uint8_t * buf , uint32_t length )
501
+ void AES_CBC_encrypt_buffer (struct AES_ctx * ctx , uint8_t * buf , size_t length )
502
502
{
503
- uintptr_t i ;
503
+ size_t i ;
504
504
uint8_t * Iv = ctx -> Iv ;
505
505
for (i = 0 ; i < length ; i += AES_BLOCKLEN )
506
506
{
@@ -513,9 +513,9 @@ void AES_CBC_encrypt_buffer(struct AES_ctx *ctx, uint8_t* buf, uint32_t length)
513
513
memcpy (ctx -> Iv , Iv , AES_BLOCKLEN );
514
514
}
515
515
516
- void AES_CBC_decrypt_buffer (struct AES_ctx * ctx , uint8_t * buf , uint32_t length )
516
+ void AES_CBC_decrypt_buffer (struct AES_ctx * ctx , uint8_t * buf , size_t length )
517
517
{
518
- uintptr_t i ;
518
+ size_t i ;
519
519
uint8_t storeNextIv [AES_BLOCKLEN ];
520
520
for (i = 0 ; i < length ; i += AES_BLOCKLEN )
521
521
{
@@ -535,11 +535,11 @@ void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length)
535
535
#if defined(CTR ) && (CTR == 1 )
536
536
537
537
/* Symmetrical operation: same function for encrypting as for decrypting. Note any IV/nonce should never be reused with the same key */
538
- void AES_CTR_xcrypt_buffer (struct AES_ctx * ctx , uint8_t * buf , uint32_t length )
538
+ void AES_CTR_xcrypt_buffer (struct AES_ctx * ctx , uint8_t * buf , size_t length )
539
539
{
540
540
uint8_t buffer [AES_BLOCKLEN ];
541
541
542
- unsigned i ;
542
+ size_t i ;
543
543
int bi ;
544
544
for (i = 0 , bi = AES_BLOCKLEN ; i < length ; ++ i , ++ bi )
545
545
{
0 commit comments