Add constexpr-ness to ChaCha StaticAlgorithmName member function
parent
c1556295e6
commit
e2f2ace688
4
chacha.h
4
chacha.h
|
|
@ -19,7 +19,9 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||||
template <unsigned int R>
|
template <unsigned int R>
|
||||||
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>, public FixedRounds<R>
|
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>, public FixedRounds<R>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {static const std::string name = "ChaCha" + IntToString(R); return name.c_str();}
|
CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {
|
||||||
|
return (R==8?"ChaCha8":(R==12?"ChaCha12":(R==20?"ChaCha20":"ChaCha")));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \class ChaCha_Policy
|
//! \class ChaCha_Policy
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue