aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-09 09:58:21 -0400
committerJack Lloyd <[email protected]>2018-08-09 09:58:21 -0400
commit42f69c656f78bc44c9bf8bde479b9cca91454ca6 (patch)
tree84ee352e3f2543f947151834821acce5f9226f1f /src/tests
parent0ef977d5d3887e994f5aa5c6271c428428870588 (diff)
Add Tweakable_Block_Cipher class
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_block.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/tests/test_block.cpp b/src/tests/test_block.cpp
index 7a5c8492b..66ef9e24b 100644
--- a/src/tests/test_block.cpp
+++ b/src/tests/test_block.cpp
@@ -10,10 +10,6 @@
#include <botan/block_cipher.h>
-#if defined(BOTAN_HAS_THREEFISH_512)
- #include <botan/threefish_512.h>
-#endif
-
namespace Botan_Tests {
class Block_Cipher_Tests final : public Text_Based_Test
@@ -94,10 +90,11 @@ class Block_Cipher_Tests final : public Text_Based_Test
if(tweak.size() > 0)
{
- Botan::Threefish_512* t512 = dynamic_cast<Botan::Threefish_512*>(cipher.get());
- result.confirm("Only Threefish supports tweaks", t512);
- if(t512)
- t512->set_tweak(tweak.data(), tweak.size());
+ Botan::Tweakable_Block_Cipher* tbc = dynamic_cast<Botan::Tweakable_Block_Cipher*>(cipher.get());
+ if(tbc == nullptr)
+ result.test_failure("Tweak set in test data but cipher is not a Tweakable_Block_Cipher");
+ else
+ tbc->set_tweak(tweak.data(), tweak.size());
}
// Test that clone works and does not affect parent object