summaryrefslogtreecommitdiff
path: root/poly1305.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-08-05 06:05:57 -0400
committerJeffrey Walton <noloader@gmail.com>2017-08-05 06:05:57 -0400
commit0357e508e4fd8e8f61e82a48b16adb5c381a740d (patch)
treefdac41172c7fcc2abc18fc5cb6487dde3a8298ec /poly1305.h
parentbf35d58ad79b65462f38935996719076edf822da (diff)
downloadcryptopp-git-0357e508e4fd8e8f61e82a48b16adb5c381a740d.tar.gz
Make nonce a class member rather than temporary
Effectively this creates a workspace for encrypting the nonce. The zeroizer will run when the class is destroyed, rather than each invocation of UncheckedSetKey. Performance went from 3.6 cpb as a temporary to 2.9 cpb as a class member
Diffstat (limited to 'poly1305.h')
-rw-r--r--poly1305.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/poly1305.h b/poly1305.h
index 2e70dcf3..8e2617d0 100644
--- a/poly1305.h
+++ b/poly1305.h
@@ -93,7 +93,7 @@ protected:
FixedSizeAlignedSecBlock<word32, 4> m_n;
// Accumulated message bytes and index
- FixedSizeAlignedSecBlock<byte, BLOCKSIZE> m_acc;
+ FixedSizeAlignedSecBlock<byte, BLOCKSIZE> m_acc, m_nk;
size_t m_idx;
// Track nonce reuse; assert in debug but continue