aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/aria
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-05-13 12:49:40 -0400
committerJack Lloyd <[email protected]>2018-05-13 12:49:40 -0400
commit1fcf8c6ba3f8912c9c6cba0555597ab0083eaaa2 (patch)
tree07199fd3b677dd02828f73fa1d2dcda272ee7a1f /src/lib/block/aria
parentbef5303b3ec1a17bc79ccce0eecdca4874639b56 (diff)
Add message to BOTAN_ARG_CHECK and use it more widely
Diffstat (limited to 'src/lib/block/aria')
-rw-r--r--src/lib/block/aria/aria.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/block/aria/aria.cpp b/src/lib/block/aria/aria.cpp
index 4b99d2306..83383cce1 100644
--- a/src/lib/block/aria/aria.cpp
+++ b/src/lib/block/aria/aria.cpp
@@ -220,9 +220,6 @@ inline void ARIA_FE(uint32_t& T0, uint32_t& T1, uint32_t& T2, uint32_t& T3)
void transform(const uint8_t in[], uint8_t out[], size_t blocks,
const secure_vector<uint32_t>& KS)
{
- if(KS.empty())
- throw Invalid_State("ARIA key was not set");
-
// Hit every cache line of S1 and S2
const size_t cache_line_size = CPUID::cache_line_size();
@@ -436,31 +433,37 @@ void key_schedule(secure_vector<uint32_t>& ERK,
void ARIA_128::encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
+ verify_key_set(m_ERK.size() > 0);
ARIA_F::transform(in, out, blocks, m_ERK);
}
void ARIA_192::encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
+ verify_key_set(m_ERK.size() > 0);
ARIA_F::transform(in, out, blocks, m_ERK);
}
void ARIA_256::encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
+ verify_key_set(m_ERK.size() > 0);
ARIA_F::transform(in, out, blocks, m_ERK);
}
void ARIA_128::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
+ verify_key_set(m_DRK.size() > 0);
ARIA_F::transform(in, out, blocks, m_DRK);
}
void ARIA_192::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
+ verify_key_set(m_DRK.size() > 0);
ARIA_F::transform(in, out, blocks, m_DRK);
}
void ARIA_256::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
{
+ verify_key_set(m_DRK.size() > 0);
ARIA_F::transform(in, out, blocks, m_DRK);
}