Skip to content

Commit

Permalink
decrypt test
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed May 7, 2024
1 parent 4db9f82 commit a4c7e85
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/aes256_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,14 @@ static int s_aes_test_encrypt_empty_input(struct aws_allocator *allocator, void

ASSERT_INT_EQUALS(0, encrypt_buf.len);

struct aws_byte_buf decrypted_buf = {0};
aws_byte_buf_init(&decrypted_buf, allocator, AWS_AES_256_CIPHER_BLOCK_SIZE);
struct aws_byte_cursor ciphertext_cur = aws_byte_cursor_from_buf(&encrypt_buf);
ASSERT_SUCCESS(aws_symmetric_cipher_decrypt(cipher, ciphertext_cur, &decrypted_buf));
ASSERT_SUCCESS(aws_symmetric_cipher_finalize_decryption(cipher, &decrypted_buf));

aws_byte_buf_clean_up(&encrypt_buf);
aws_byte_buf_clean_up(&decrypted_buf);
aws_symmetric_cipher_destroy(cipher);

return AWS_OP_SUCCESS;
Expand Down

0 comments on commit a4c7e85

Please sign in to comment.