#include <xormac.h>
Inheritance diagram for XMACC< T >:
If you need to generate MACs with XMACC (instead of just verifying them), you must save the counter before destroying an XMACC object and reinitialize it the next time you create an XMACC with the same key. Start counter at 0 when using a key for the first time.
Definition at line 65 of file xormac.h.
Public Types | |
enum | { DIGESTSIZE = 4+T::DIGESTSIZE } |
typedef T::HashWordType | HashWordType |
enum | |
enum | |
enum | |
typedef T::ByteOrderClass | ByteOrderClass |
Public Member Functions | |
XMACC () | |
XMACC (const byte *key, word32 counter=0xffffffff) | |
Clonable * | Clone () const |
this is not implemented by most classes yet | |
void | SetKey (const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs) |
set or reset the key of this object | |
std::string | AlgorithmName () const |
returns name of this algorithm, not universally implemented yet | |
size_t | MinKeyLength () const |
returns smallest valid key length in bytes */ | |
size_t | MaxKeyLength () const |
returns largest valid key length in bytes */ | |
size_t | DefaultKeyLength () const |
returns default (recommended) key length in bytes */ | |
size_t | GetValidKeyLength (size_t n) const |
returns the smallest valid key length in bytes that is >= min(n, GetMaxKeyLength()) | |
XMACC_Base< T >::IV_Requirement | IVRequirement () const |
returns the minimal requirement for secure IVs | |
void | CheckedSetKey (void *, Empty empty, const byte *key, size_t length, const NameValuePairs ¶ms) |
void | Resynchronize (const byte *IV) |
resynchronize with an IV | |
unsigned int | IVSize () const |
returns size of IVs used by this object | |
void | GetNextIV (byte *IV) |
get a secure IV for the next message | |
word32 | CurrentCounter () const |
void | TruncatedFinal (byte *mac, size_t size) |
truncated version of Final() | |
bool | TruncatedVerify (const byte *mac, size_t length) |
truncated version of Verify() | |
unsigned int | DigestSize () const |
size of the hash returned by Final() | |
ByteOrder | GetByteOrder () const |
unsigned int | BlockSize () const |
block size of underlying compression function, or 0 if not block based | |
unsigned int | OptimalBlockSize () const |
input to Update() should have length a multiple of this for optimal speed | |
unsigned int | OptimalDataAlignment () const |
returns how input should be aligned for optimal performance | |
void | Update (const byte *input, size_t length) |
process more input | |
byte * | CreateUpdateSpace (size_t &size) |
request space to write input into | |
void | Restart () |
discard the current state, and restart with a new message | |
Static Public Member Functions | |
static std::string __cdecl | StaticAlgorithmName () |
static size_t __cdecl | StaticGetValidKeyLength (size_t) |
static void | CorrectEndianess (HashWordType *out, const HashWordType *in, size_t byteCount) |
Static Public Attributes | |
static CompileAssert<((BLOCKSIZE &(BLOCKSIZE-1))==0)> | cryptopp_assert___LINE__ |
Protected Member Functions | |
void | AssertValidKeyLength (size_t length) |
void | SetBlockSize (unsigned int blockSize) |
void | SetStateSize (unsigned int stateSize) |
T::HashWordType | GetBitCountHi () const |
T::HashWordType | GetBitCountLo () const |
void | PadLastBlock (unsigned int lastBlockSize, byte padFirst=0x80) |
virtual size_t | HashMultipleBlocks (const T::HashWordType *input, size_t length) |
void | HashBlock (const HashWordType *input) |
Protected Attributes | |
SecBlock< T::HashWordType > | m_data |
SecBlock< T::HashWordType > | m_digest |
void MessageAuthenticationCodeImpl< XMACC_Base< T > , XMACC_Base< T > >::SetKey | ( | const byte * | key, | |
size_t | length, | |||
const NameValuePairs & | params = g_nullNameValuePairs | |||
) | [inline, virtual, inherited] |
void XMACC_Base< T >::GetNextIV | ( | byte * | IV | ) | [inline, virtual, inherited] |
get a secure IV for the next message
This method should be called after you finish encrypting one message and are ready to start the next one. After calling it, you must call SetKey() or Resynchronize() before using this object again. This method is not implemented on decryption objects.
Reimplemented from SimpleKeyingInterface.