From eab327defc290e21b36591a09d93609d6deca940 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 17 Oct 2017 18:30:40 -0400 Subject: GCM and CTR optimizations In CTR, special case for counter widths of special interest. In GHASH, uses a 4x reduction technique suggested by Intel. Split out GHASH to its own source file and header. With these changes GCM is over twice as fast on Skylake and about 50% faster on Westmere. --- src/lib/mac/gmac/gmac.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/mac/gmac/gmac.cpp') diff --git a/src/lib/mac/gmac/gmac.cpp b/src/lib/mac/gmac/gmac.cpp index be27aba4a..a4e84f57b 100644 --- a/src/lib/mac/gmac/gmac.cpp +++ b/src/lib/mac/gmac/gmac.cpp @@ -7,6 +7,8 @@ */ #include +#include +#include namespace Botan { @@ -28,6 +30,13 @@ void GMAC::clear() m_initialized = false; } +GMAC::~GMAC() { /* for unique_ptr */ } + +Key_Length_Specification GMAC::key_spec() const + { + return m_cipher->key_spec(); + } + std::string GMAC::name() const { return "GMAC(" + m_cipher->name() + ")"; -- cgit v1.2.3