aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/gmac/gmac.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-17 18:30:40 -0400
committerJack Lloyd <[email protected]>2017-10-18 11:13:42 -0400
commiteab327defc290e21b36591a09d93609d6deca940 (patch)
tree75d8c372dfbd90e37203a7600ef513654d895fd1 /src/lib/mac/gmac/gmac.cpp
parentf01f37d142ef230b03ca6af46f1e1a0615e4879a (diff)
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.
Diffstat (limited to 'src/lib/mac/gmac/gmac.cpp')
-rw-r--r--src/lib/mac/gmac/gmac.cpp9
1 files changed, 9 insertions, 0 deletions
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 <botan/gmac.h>
+#include <botan/ghash.h>
+#include <botan/block_cipher.h>
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() + ")";