25#ifndef CRYPTOPP_POLY1305_H
26#define CRYPTOPP_POLY1305_H
49 static std::string StaticAlgorithmName() {
return std::string(
"Poly1305(") + T::StaticAlgorithmName() +
")";}
51 CRYPTOPP_CONSTANT(DIGESTSIZE=T::BLOCKSIZE);
52 CRYPTOPP_CONSTANT(BLOCKSIZE=T::BLOCKSIZE);
54 virtual ~Poly1305_Base() {}
55 Poly1305_Base() : m_idx(0), m_used(
true) {}
61 void Update(
const byte *input,
size_t length);
72 void HashBlocks(
const byte *input,
size_t length,
word32 padbit);
73 void HashFinal(
byte *mac,
size_t length);
75 typename T::Encryption m_cipher;
155 Poly1305(
const byte *key,
size_t keyLength=DEFAULT_KEYLENGTH,
const byte *nonce=NULLPTR,
size_t nonceLength=0)
167 static std::string StaticAlgorithmName() {
return std::string(
"Poly1305TLS");}
168 CRYPTOPP_CONSTANT(DIGESTSIZE=16);
169 CRYPTOPP_CONSTANT(BLOCKSIZE=16);
171 virtual ~Poly1305TLS_Base() {}
172 Poly1305TLS_Base() {}
175 void Update(
const byte *input,
size_t length);
Classes for working with NameValuePairs.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Standard names for retrieving values by name when working with NameValuePairs.
virtual std::string AlgorithmProvider() const
Retrieve the provider of this algorithm.
Used to pass byte array input as part of a NameValuePairs object.
Inherited by keyed algorithms with fixed key length.
static const int DEFAULT_KEYLENGTH
Fixed size stack-based SecBlock with 16-byte alignment.
MessageAuthenticationCodeFinal()
Interface for message authentication codes.
Interface for retrieving values given their names.
unsigned int DigestSize() const
Provides the digest size of the hash.
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
unsigned int BlockSize() const
Provides the block size of the compression function.
Poly1305(const byte *key, size_t keyLength=DEFAULT_KEYLENGTH, const byte *nonce=NULL, size_t nonceLength=0)
Construct a Poly1305.
Poly1305()
Construct a Poly1305.
unsigned int BlockSize() const
Provides the block size of the compression function.
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms)
Sets the key for this object without performing parameter validation.
void TruncatedFinal(byte *mac, size_t size)
Computes the hash of the current message.
void Update(const byte *input, size_t length)
Updates a hash with additional input.
unsigned int DigestSize() const
Provides the digest size of the hash.
void Restart()
Restart the hash.
Poly1305-TLS message authentication code.
Interface for random number generators.
virtual void GetNextIV(RandomNumberGenerator &rng, byte *iv)
Retrieves a secure IV for the next message.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs)
Sets or reset the key of this object.
virtual void Resynchronize(const byte *iv, int ivLength=-1)
Resynchronize with an IV.
unsigned int word32
32-bit unsigned datatype
Abstract base classes that provide a uniform interface to this library.
#define CRYPTOPP_COMPILE_ASSERT(expr)
Compile time assertion.
Crypto++ library namespace.
const char * IV()
ConstByteArrayParameter, also accepts const byte * for backwards compatibility.
Classes and functions for secure memory allocations.
Classes and functions for implementing secret key algorithms.