summaryrefslogtreecommitdiff
path: root/speck.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-11-21 06:48:37 -0500
committerJeffrey Walton <noloader@gmail.com>2017-11-21 06:48:37 -0500
commit8cc76597c67762202eb33008038cdb5d12ae8a5d (patch)
tree4338232bd7571c61d28d081c1dbf2ec30d1ff12e /speck.h
parentc14e054ed80cabb5e773446ab173105e68d3c9b7 (diff)
downloadcryptopp-git-8cc76597c67762202eb33008038cdb5d12ae8a5d.tar.gz
Fix AlgorithmName() for 128-bit block SIMON and SPECK
Diffstat (limited to 'speck.h')
-rw-r--r--speck.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/speck.h b/speck.h
index 68074957..d4a77035 100644
--- a/speck.h
+++ b/speck.h
@@ -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: