From 62482594bd95081afd55f26940a6279d69f08b9f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 30 Jun 2016 18:21:21 +1000 Subject: [PATCH] crypto/ice: fix key length assertion --- crypto/ice.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto/ice.cpp b/crypto/ice.cpp index 65cb8db7..39bf0659 100644 --- a/crypto/ice.cpp +++ b/crypto/ice.cpp @@ -392,11 +392,11 @@ ice::scheduleBuild (std::array &kb, void ice::set (const uint64_t *_key_first, const uint64_t *_key_last) { + CHECK_EQ ((unsigned)(_key_last - _key_first), m_size); + auto key = reinterpret_cast (_key_first); if (m_rounds == 8) { - CHECK_EQ (_key_last - _key_first, 8 * 2 + 1); - std::array kb; for (unsigned i = 0; i < 4; i++) @@ -407,8 +407,6 @@ ice::set (const uint64_t *_key_first, const uint64_t *_key_last) } for (unsigned i = 0; i < m_size; i++) { - CHECK_EQ ((unsigned)(_key_last - _key_first), m_size * 8u + 4u * 2u + 1u); - std::array kb; for (unsigned j = 0; j < 4; j++)