Skip to content

Commit

Permalink
feat: aes ctr memset iv to 0s *16
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyTubongbanua committed Aug 11, 2023
1 parent 68ed067 commit e888a59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/atchops/src/aes_ctr.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ int atchops_aes_ctr_encrypt(const char *key_base64, const AESKeySize key_size, c

size_t *iv_ctr = malloc(sizeof(unsigned int));
unsigned char *iv = malloc(sizeof(unsigned char) * IV_AMOUNT_BYTES);
memset(iv, 0, IV_AMOUNT_BYTES);
unsigned char *stream_block = malloc(sizeof(unsigned char) * IV_AMOUNT_BYTES);
memset(stream_block, 0, IV_AMOUNT_BYTES);
unsigned char *aes_encrypted = malloc(sizeof(unsigned char) * MAX_BYTES_ALLOCATED_FOR_ENCRYPTION_OPERATION);
memset(aes_encrypted, 0, MAX_BYTES_ALLOCATED_FOR_ENCRYPTION_OPERATION);

// maybe base 64 encode it before feeding to cipher

Expand Down

0 comments on commit e888a59

Please sign in to comment.