aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test_block.cpp')
-rw-r--r--src/tests/test_block.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/test_block.cpp b/src/tests/test_block.cpp
index 75a460bc7..0863cb891 100644
--- a/src/tests/test_block.cpp
+++ b/src/tests/test_block.cpp
@@ -45,6 +45,12 @@ class Block_Cipher_Tests : public Text_Based_Test
result.test_gte(provider, cipher->block_size(), 8);
result.test_gte(provider, cipher->parallel_bytes(), cipher->block_size() * cipher->parallelism());
+ // Test to make sure clear() resets what we need it to
+ cipher->set_key(Test::rng().random_vec(cipher->key_spec().minimum_keylength()));
+ Botan::secure_vector<byte> garbage = Test::rng().random_vec(cipher->block_size());
+ cipher->encrypt(garbage);
+ cipher->clear();
+
cipher->set_key(key);
std::vector<uint8_t> buf = input;