diff options
Diffstat (limited to 'src/lib/block/misty1/misty1.cpp')
-rw-r--r-- | src/lib/block/misty1/misty1.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/block/misty1/misty1.cpp b/src/lib/block/misty1/misty1.cpp index eaef86c8c..e7ebffa6e 100644 --- a/src/lib/block/misty1/misty1.cpp +++ b/src/lib/block/misty1/misty1.cpp @@ -103,6 +103,8 @@ uint16_t FI(uint16_t input, uint16_t key7, uint16_t key9) */ void MISTY1::encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const { + verify_key_set(m_EK.empty() == false); + for(size_t i = 0; i != blocks; ++i) { uint16_t B0 = load_be<uint16_t>(in, 0); @@ -153,6 +155,8 @@ void MISTY1::encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const */ void MISTY1::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const { + verify_key_set(m_DK.empty() == false); + for(size_t i = 0; i != blocks; ++i) { uint16_t B0 = load_be<uint16_t>(in, 2); |