Fix ChaCha20Poly1305 IVSize() (GH #724)
parent
fcf637082d
commit
7c3414b072
|
|
@ -19,7 +19,7 @@ void ChaCha20Poly1305_Base::RekeyCipherAndMac(const byte *userKey, size_t keylen
|
||||||
AccessSymmetricCipher().ProcessString(derived, derived.size());
|
AccessSymmetricCipher().ProcessString(derived, derived.size());
|
||||||
|
|
||||||
// Set the Poly1305 key
|
// Set the Poly1305 key
|
||||||
AccessMAC().SetKey(derived, 32, params);
|
AccessMAC().SetKey(derived, derived.size(), params);
|
||||||
|
|
||||||
// Key Cipher for bulk encryption
|
// Key Cipher for bulk encryption
|
||||||
AlgorithmParameters block1 = MakeParameters("InitialBlock", (word64)1, true);
|
AlgorithmParameters block1 = MakeParameters("InitialBlock", (word64)1, true);
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public:
|
||||||
IV_Requirement IVRequirement() const
|
IV_Requirement IVRequirement() const
|
||||||
{return UNIQUE_IV;}
|
{return UNIQUE_IV;}
|
||||||
unsigned int IVSize() const
|
unsigned int IVSize() const
|
||||||
{return 16;}
|
{return 12;}
|
||||||
unsigned int MinIVLength() const
|
unsigned int MinIVLength() const
|
||||||
{return 12;}
|
{return 12;}
|
||||||
unsigned int MaxIVLength() const
|
unsigned int MaxIVLength() const
|
||||||
|
|
@ -128,6 +128,10 @@ protected:
|
||||||
/// \since Crypto++ 8.1
|
/// \since Crypto++ 8.1
|
||||||
class ChaCha20Poly1305_Final : public ChaCha20Poly1305_Base
|
class ChaCha20Poly1305_Final : public ChaCha20Poly1305_Base
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
static std::string StaticAlgorithmName()
|
||||||
|
{return std::string("ChaCha20/Poly1305");}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const SymmetricCipher & GetSymmetricCipher()
|
const SymmetricCipher & GetSymmetricCipher()
|
||||||
{return const_cast<ChaCha20Poly1305_Final *>(this)->AccessSymmetricCipher();}
|
{return const_cast<ChaCha20Poly1305_Final *>(this)->AccessSymmetricCipher();}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue