diff options
author | Jack Lloyd <[email protected]> | 2017-09-24 17:19:09 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-24 17:56:10 -0400 |
commit | 0272dce7955951de74189568c43123b386445531 (patch) | |
tree | c89bdf47f1f1d7dda29ac3d53a72dfa8ce418231 /src/lib/mac/cmac/cmac.h | |
parent | f53db790a5a2a7ffb770199bcf42fcdcf948e737 (diff) |
Better tests for SIV
Correct errors in the AEAD tests that assumed process/update always
return something - that isn't true for SIV
Minor optimizations in CMAC and CTR to cache the block size instead
of making a zillion virtual calls for it.
Generalize SIV slightly to where it could support a non-128 bit
cipher, but don't pull the trigger on it since I can't find any
implementations to crosscheck with.
Diffstat (limited to 'src/lib/mac/cmac/cmac.h')
-rw-r--r-- | src/lib/mac/cmac/cmac.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/mac/cmac/cmac.h b/src/lib/mac/cmac/cmac.h index 7c81272e8..9867c7d0e 100644 --- a/src/lib/mac/cmac/cmac.h +++ b/src/lib/mac/cmac/cmac.h @@ -20,7 +20,7 @@ class BOTAN_PUBLIC_API(2,0) CMAC final : public MessageAuthenticationCode { public: std::string name() const override; - size_t output_length() const override { return m_cipher->block_size(); } + size_t output_length() const override { return m_block_size; } MessageAuthenticationCode* clone() const override; void clear() override; @@ -50,6 +50,7 @@ class BOTAN_PUBLIC_API(2,0) CMAC final : public MessageAuthenticationCode std::unique_ptr<BlockCipher> m_cipher; secure_vector<uint8_t> m_buffer, m_state, m_B, m_P; + const size_t m_block_size; size_t m_position; }; |