diff options
author | Niels Möller <nisse@lysator.liu.se> | 2019-05-15 10:11:22 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2019-05-15 10:11:22 +0200 |
commit | 2b5dcfed94d66a3207f8bbd6d043e17532a88db8 (patch) | |
tree | 6a098be22eafdbf9658c1cc6c5a55fa4bdbc3011 /siv-cmac.c | |
parent | ef82f2281f7c2459cd8fafa1e50598069c6a3732 (diff) | |
download | nettle-2b5dcfed94d66a3207f8bbd6d043e17532a88db8.tar.gz |
Require non-empty nonce for SIV mode.
Diffstat (limited to 'siv-cmac.c')
-rw-r--r-- | siv-cmac.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -60,6 +60,8 @@ _siv_s2v (const struct nettle_cipher *nc, union nettle_block16 D, S, T; static const union nettle_block16 const_zero = {.b = 0 }; + assert (nlength >= SIV_MIN_NONCE_SIZE); + cmac128_update (siv_cmac_ctx, cmac_cipher_ctx, nc->encrypt, 16, const_zero.b); cmac128_digest (siv_cmac_ctx, cmac_cipher_ctx, nc->encrypt, 16, D.b); |