diff options
author | Jack Lloyd <[email protected]> | 2018-05-13 12:49:40 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-05-13 12:49:40 -0400 |
commit | 1fcf8c6ba3f8912c9c6cba0555597ab0083eaaa2 (patch) | |
tree | 07199fd3b677dd02828f73fa1d2dcda272ee7a1f /src/lib/stream/ctr | |
parent | bef5303b3ec1a17bc79ccce0eecdca4874639b56 (diff) |
Add message to BOTAN_ARG_CHECK and use it more widely
Diffstat (limited to 'src/lib/stream/ctr')
-rw-r--r-- | src/lib/stream/ctr/ctr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp index c63bdebdc..261646344 100644 --- a/src/lib/stream/ctr/ctr.cpp +++ b/src/lib/stream/ctr/ctr.cpp @@ -6,6 +6,7 @@ */ #include <botan/ctr.h> +#include <botan/exceptn.h> #include <botan/loadstor.h> namespace Botan { @@ -30,8 +31,8 @@ CTR_BE::CTR_BE(BlockCipher* cipher, size_t ctr_size) : m_pad(m_counter.size()), m_pad_pos(0) { - if(m_ctr_size < 4 || m_ctr_size > m_block_size) - throw Invalid_Argument("Invalid CTR-BE counter size"); + BOTAN_ARG_CHECK(m_ctr_size >= 4 && m_ctr_size <= m_block_size, + "Invalid CTR-BE counter size"); } void CTR_BE::clear() |