diff --git a/simon.h b/simon.h index 606c3b74..fc2c892d 100644 --- a/simon.h +++ b/simon.h @@ -45,6 +45,7 @@ template struct SIMON_Base { virtual ~SIMON_Base() {} + SIMON_Base() : m_kwords(0) {} typedef SecBlock > 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: diff --git a/speck.h b/speck.h index 68074957..d4a77035 100644 --- a/speck.h +++ b/speck.h @@ -45,6 +45,7 @@ template struct SPECK_Base { virtual ~SPECK_Base() {} + SPECK_Base() : m_kwords(0) {} typedef SecBlock > 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: