6 #ifndef CRYPTOPP_DEFAULT_H
7 #define CRYPTOPP_DEFAULT_H
38 :
Exception(DATA_INTEGRITY_CHECK_FAILED, s) {}
45 :
DataDecryptorErr(
"DataDecryptor: cannot decrypt message with this passphrase") {}
56 template <
unsigned int BlockSize,
unsigned int KeyLength,
unsigned int DigestSize,
unsigned int SaltSize,
unsigned int Iterations>
59 CRYPTOPP_CONSTANT(BLOCKSIZE = BlockSize);
60 CRYPTOPP_CONSTANT(KEYLENGTH = KeyLength);
61 CRYPTOPP_CONSTANT(SALTLENGTH = SaltSize);
62 CRYPTOPP_CONSTANT(DIGESTSIZE = DigestSize);
63 CRYPTOPP_CONSTANT(ITERATIONS = Iterations);
77 template <
class BC,
class H,
class Info>
81 CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
82 CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
83 CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
84 CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
85 CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
99 void FirstPut(
const byte *);
100 void LastPut(
const byte *inString,
size_t length);
115 template <
class BC,
class H,
class Info>
119 CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
120 CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
121 CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
122 CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
123 CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
138 enum State {WAITING_FOR_KEYCHECK, KEY_GOOD, KEY_BAD};
139 State CurrentState()
const {
return m_state;}
142 void FirstPut(
const byte *inString);
143 void LastPut(
const byte *inString,
size_t length);
148 void CheckKey(
const byte *salt,
const byte *keyCheck);
153 bool m_throwException;
172 template <
class BC,
class H,
class MAC,
class Info>
176 CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
177 CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
178 CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
179 CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
180 CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
194 void FirstPut(
const byte *inString) {CRYPTOPP_UNUSED(inString);}
195 void LastPut(
const byte *inString,
size_t length);
217 template <
class BC,
class H,
class MAC,
class Info>
221 CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
222 CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
223 CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
224 CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
225 CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
240 typename DataDecryptor<BC,H,Info>::State CurrentState()
const;
241 bool CheckLastMAC()
const;
244 void FirstPut(
const byte *inString) {CRYPTOPP_UNUSED(inString);}
245 void LastPut(
const byte *inString,
size_t length);
250 bool m_throwException;
253 #if defined(CRYPTOPP_DOXYGEN_PROCESSING)