Add ChaCha AlgorithmName override
parent
76ab8ffa4b
commit
8da2b91cba
|
|
@ -135,12 +135,12 @@ void Benchmark2(double t, double hertz)
|
||||||
{
|
{
|
||||||
BenchMarkByName<SymmetricCipher>("Panama-LE");
|
BenchMarkByName<SymmetricCipher>("Panama-LE");
|
||||||
BenchMarkByName<SymmetricCipher>("Panama-BE");
|
BenchMarkByName<SymmetricCipher>("Panama-BE");
|
||||||
BenchMarkByName<SymmetricCipher>("Salsa20");
|
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20");
|
||||||
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12));
|
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12));
|
||||||
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
|
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
|
||||||
BenchMarkByName<SymmetricCipher>("ChaCha");
|
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha20");
|
||||||
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha/12", MakeParameters(Name::Rounds(), 12));
|
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha12", MakeParameters(Name::Rounds(), 12));
|
||||||
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha/8", MakeParameters(Name::Rounds(), 8));
|
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha8", MakeParameters(Name::Rounds(), 8));
|
||||||
BenchMarkByName<SymmetricCipher>("Sosemanuk");
|
BenchMarkByName<SymmetricCipher>("Sosemanuk");
|
||||||
BenchMarkByName<SymmetricCipher>("Rabbit");
|
BenchMarkByName<SymmetricCipher>("Rabbit");
|
||||||
BenchMarkByName<SymmetricCipher>("RabbitWithIV");
|
BenchMarkByName<SymmetricCipher>("RabbitWithIV");
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,11 @@ void ChaCha_TestInstantiations()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
std::string ChaCha_Policy::AlgorithmName() const
|
||||||
|
{
|
||||||
|
return std::string("ChaCha")+IntToString(m_rounds);
|
||||||
|
}
|
||||||
|
|
||||||
std::string ChaCha_Policy::AlgorithmProvider() const
|
std::string ChaCha_Policy::AlgorithmProvider() const
|
||||||
{
|
{
|
||||||
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
|
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
|
||||||
|
|
|
||||||
8
chacha.h
8
chacha.h
|
|
@ -22,6 +22,13 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||||
/// \since Crypto++ 5.6.4
|
/// \since Crypto++ 5.6.4
|
||||||
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>
|
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>
|
||||||
{
|
{
|
||||||
|
/// \brief The algorithm name
|
||||||
|
/// \returns the algorithm name
|
||||||
|
/// \details StaticAlgorithmName returns the algorithm's name as a static
|
||||||
|
/// member function.
|
||||||
|
/// \details Bernstein named the cipher variants ChaCha8, ChaCha12 and
|
||||||
|
/// ChaCha20. More generally, Bernstein called the family ChaCha{r}.
|
||||||
|
/// AlgorithmName() provides the exact name once rounds are set.
|
||||||
static const char* StaticAlgorithmName() {
|
static const char* StaticAlgorithmName() {
|
||||||
return "ChaCha";
|
return "ChaCha";
|
||||||
}
|
}
|
||||||
|
|
@ -40,6 +47,7 @@ protected:
|
||||||
unsigned int GetAlignment() const;
|
unsigned int GetAlignment() const;
|
||||||
unsigned int GetOptimalBlockSize() const;
|
unsigned int GetOptimalBlockSize() const;
|
||||||
|
|
||||||
|
std::string AlgorithmName() const;
|
||||||
std::string AlgorithmProvider() const;
|
std::string AlgorithmProvider() const;
|
||||||
|
|
||||||
FixedSizeAlignedSecBlock<word32, 16> m_state;
|
FixedSizeAlignedSecBlock<word32, 16> m_state;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue