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/aes/aes.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/lib/block/aes') diff --git a/src/lib/block/aes/aes.cpp b/src/lib/block/aes/aes.cpp index c35bdabaa..403945cc9 100644 --- a/src/lib/block/aes/aes.cpp +++ b/src/lib/block/aes/aes.cpp @@ -337,8 +337,7 @@ void aes_key_schedule(const uint8_t key[], size_t length, const size_t X = length / 4; // Can't happen, but make static analyzers happy - if(X != 4 && X != 6 && X != 8) - throw Invalid_Argument("Invalid AES key size"); + BOTAN_ARG_CHECK(X == 4 || X == 6 || X == 8, "Invalid AES key size"); for(size_t i = 0; i != X; ++i) XEK[i] = load_be(key, i); -- cgit v1.2.3