6#ifndef CRYPTOPP_DEFAULT_H
7#define CRYPTOPP_DEFAULT_H
37 DataDecryptorErr(
const std::string &s)
42class KeyBadErr :
public DataDecryptorErr
45 : DataDecryptorErr(
"DataDecryptor: cannot decrypt message with this passphrase") {}
49class MACBadErr :
public DataDecryptorErr
52 : DataDecryptorErr(
"DataDecryptorWithMAC: MAC check failed") {}
56template <
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);
77template <
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);
104 typename CBC_Mode<BC>::Encryption m_cipher;
115template <
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);
151 typename CBC_Mode<BC>::Decryption m_cipher;
153 bool m_throwException;
172template <
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);
217template <
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)
Class file for the AES cipher (Rijndael)
AES block cipher (Rijndael)
2-key TripleDES block cipher
Password-based Decryptor.
DataDecryptor(const char *passphrase, BufferedTransformation *attachment=NULL, bool throwException=true)
Constructs a DataDecryptor.
Password-based decryptor with MAC.
DataDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment=NULL, bool throwException=true)
Constructs a DataDecryptor.
Password-based Encryptor.
DataEncryptor(const char *passphrase, BufferedTransformation *attachment=NULL)
Construct a DataEncryptor.
Password-based encryptor with MAC.
DataEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment=NULL)
Constructs a DataEncryptorWithMAC.
Exception(ErrorType errorType, const std::string &s)
Construct a new Exception.
@ DATA_INTEGRITY_CHECK_FAILED
Data integerity check, such as CRC or MAC, failed.
Filter wrapper for HashTransformation.
ProxyFilter(BufferedTransformation *filter, size_t firstSize, size_t lastSize, BufferedTransformation *attachment)
Construct a ProxyFilter.
Pointer that overloads operator ->
DES_EDE2 LegacyBlockCipher
Legacy block cipher for LegacyEncryptor, LegacyDecryptor, LegacyEncryptorWithMAC and LegacyDecryptorW...
HMAC< LegacyHashModule > LegacyMAC
Legacy HMAC for use withLegacyEncryptorWithMAC and LegacyDecryptorWithMAC.
HMAC< DefaultHashModule > DefaultMAC
Default HMAC for use withDefaultEncryptorWithMAC and DefaultDecryptorWithMAC.
AES DefaultBlockCipher
Default block cipher for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecry...
SHA1 LegacyHashModule
Legacy hash for use with LegacyEncryptorWithMAC and LegacyDecryptorWithMAC.
SHA256 DefaultHashModule
Default hash for use with DefaultEncryptorWithMAC and DefaultDecryptorWithMAC.
Classes for DES, 2-key Triple-DES, 3-key Triple-DES and DESX.
Implementation of BufferedTransformation's attachment interface.
Classes for HMAC message authentication codes.
Classes for block cipher modes of operation.
Crypto++ library namespace.
Classes for SHA-1 and SHA-2 family of message digests.
Classes for automatic resource management.
Algorithm information for password-based encryptors and decryptors.
Password-based decryptor.
Password-based decryptor with MAC.
Password-based encryptor.
Password-based encryptor with MAC.
Password-based decryptor (deprecated)
Password-based decryptor with MAC (deprecated)
Password-based encryptor (deprecated)
Password-based encryptor with MAC (deprecated)