aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/aead/siv
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-02 14:12:16 -0400
committerJack Lloyd <[email protected]>2016-10-02 14:12:16 -0400
commitcccca06d3916a4eeb9c19f69ae44074abde7e460 (patch)
tree4dc3833854d714a733a57177a2d8c9a89ef6d65b /src/lib/modes/aead/siv
parentf8c02e0dd54a57fbf4bf5a15c36e329cfd4e87cf (diff)
SIV is restricted to 128 bit ciphers
Diffstat (limited to 'src/lib/modes/aead/siv')
-rw-r--r--src/lib/modes/aead/siv/siv.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/modes/aead/siv/siv.cpp b/src/lib/modes/aead/siv/siv.cpp
index 9e638b659..5f8c13f7f 100644
--- a/src/lib/modes/aead/siv/siv.cpp
+++ b/src/lib/modes/aead/siv/siv.cpp
@@ -18,6 +18,8 @@ SIV_Mode::SIV_Mode(BlockCipher* cipher) :
m_ctr(new CTR_BE(cipher->clone())),
m_cmac(new CMAC(cipher))
{
+ if(cipher->block_size() != 16)
+ throw Invalid_Argument("SIV requires a 128 bit block cipher");
}
void SIV_Mode::clear()