diff options
author | Jack Lloyd <[email protected]> | 2016-07-27 15:53:44 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-07-27 15:53:44 -0400 |
commit | 803f7614558d8fb7ec608c1ebebdb4938cd0b8fb (patch) | |
tree | 4628e8d6486850b67ce2f385e6de3151e7b8dfc0 /src/tests | |
parent | da574388e26df7b625b198efdb8e0757a4e4ecda (diff) | |
parent | 6815421f6bb0ba73cc8c1f59b5cd4c997b7c103d (diff) |
Merge GH #557 Test BlockCipher::clear
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_block.cpp | 6 |
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; |