1 #ifndef CRYPTOPP_AUTHENC_H
2 #define CRYPTOPP_AUTHENC_H
7 NAMESPACE_BEGIN(CryptoPP)
17 void UncheckedSetKey(
const byte *,
unsigned int,
const CryptoPP::NameValuePairs &) {assert(
false);}
19 void SetKey(
const byte *userKey,
size_t keylength,
const NameValuePairs ¶ms);
20 void Restart() {
if (m_state > State_KeySet) m_state = State_KeySet;}
21 void Resynchronize(
const byte *iv,
int length=-1);
22 void Update(
const byte *input,
size_t length);
23 void ProcessData(byte *outString,
const byte *inString,
size_t length);
24 void TruncatedFinal(byte *mac,
size_t macSize);
27 void AuthenticateData(
const byte *data,
size_t len);
31 virtual bool AuthenticationIsOnPlaintext()
const =0;
32 virtual unsigned int AuthenticationBlockSize()
const =0;
33 virtual void SetKeyWithoutResync(
const byte *userKey,
size_t keylength,
const NameValuePairs ¶ms) =0;
34 virtual void Resync(
const byte *iv,
size_t len) =0;
35 virtual size_t AuthenticateBlocks(
const byte *data,
size_t len) =0;
36 virtual void AuthenticateLastHeaderBlock() =0;
37 virtual void AuthenticateLastConfidentialBlock() {}
38 virtual void AuthenticateLastFooterBlock(byte *mac,
size_t macSize) =0;
40 enum State {State_Start, State_KeySet, State_IVSet, State_AuthUntransformed, State_AuthTransformed, State_AuthFooter};
42 unsigned int m_bufferedDataLength;
43 lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength;
interface for for one direction (encryption or decryption) of a stream cipher or block cipher mode wi...
bool IsRandomAccess() const
returns whether this cipher supports random access
void Restart()
discard the current state, and restart with a new message
interface for one direction (encryption or decryption) of a stream cipher or cipher mode ...
bool IsSelfInverting() const
returns whether this transformation is self-inverting (e.g. xor with a keystream) ...
interface for retrieving values given their names