diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-11-21 06:48:37 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-11-21 06:48:37 -0500 |
commit | 8cc76597c67762202eb33008038cdb5d12ae8a5d (patch) | |
tree | 4338232bd7571c61d28d081c1dbf2ec30d1ff12e /speck.h | |
parent | c14e054ed80cabb5e773446ab173105e68d3c9b7 (diff) | |
download | cryptopp-git-8cc76597c67762202eb33008038cdb5d12ae8a5d.tar.gz |
Fix AlgorithmName() for 128-bit block SIMON and SPECK
Diffstat (limited to 'speck.h')
-rw-r--r-- | speck.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -45,6 +45,7 @@ template <class W> struct SPECK_Base
{
virtual ~SPECK_Base() {}
+ SPECK_Base() : m_kwords(0) {}
typedef SecBlock<W, AllocatorWithCleanup<W, true> > AlignedSecBlock;
mutable AlignedSecBlock m_wspace; // workspace
@@ -68,7 +69,8 @@ public: {
public:
std::string AlgorithmName() const {
- return StaticAlgorithmName() + "(" + IntToString(m_kwords*sizeof(word32)*8) + ")";
+ return StaticAlgorithmName() + (m_kwords == 0 ? "" :
+ "(" + IntToString(m_kwords*sizeof(word32)*8) + ")");
}
protected:
@@ -115,7 +117,8 @@ public: {
public:
std::string AlgorithmName() const {
- return StaticAlgorithmName() + "(" + IntToString(m_kwords*sizeof(word64)*8) + ")";
+ return StaticAlgorithmName() + (m_kwords == 0 ? "" :
+ "(" + IntToString(m_kwords*sizeof(word64)*8) + ")");
}
protected:
|