diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-08-05 06:05:57 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-08-05 06:05:57 -0400 |
commit | 0357e508e4fd8e8f61e82a48b16adb5c381a740d (patch) | |
tree | fdac41172c7fcc2abc18fc5cb6487dde3a8298ec /poly1305.h | |
parent | bf35d58ad79b65462f38935996719076edf822da (diff) | |
download | cryptopp-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.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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
|