From 1fcf8c6ba3f8912c9c6cba0555597ab0083eaaa2 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 13 May 2018 12:49:40 -0400 Subject: Add message to BOTAN_ARG_CHECK and use it more widely --- src/lib/block/threefish_512/threefish_512.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/block/threefish_512') diff --git a/src/lib/block/threefish_512/threefish_512.cpp b/src/lib/block/threefish_512/threefish_512.cpp index 0e6ba8889..7c368b409 100644 --- a/src/lib/block/threefish_512/threefish_512.cpp +++ b/src/lib/block/threefish_512/threefish_512.cpp @@ -239,8 +239,8 @@ void Threefish_512::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) void Threefish_512::set_tweak(const uint8_t tweak[], size_t len) { - if(len != 16) - throw Exception("Threefish-512 requires 128 bit tweak"); + BOTAN_ARG_CHECK(len == 16, "Threefish-512 requires 128 bit tweak"); + m_T.resize(3); m_T[0] = load_le(tweak, 0); m_T[1] = load_le(tweak, 1); -- cgit v1.2.3