当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 4

MySQL Tools/Crypto++库
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
TestData
TestPrograms
TestScripts
TestVectors
.appveyor.yml
.cirrus.yml
.gitattributes
.gitignore
.travis.yml
3way.cpp
3way.h
Doxyfile
Filelist.txt
GNUmakefile
GNUmakefile-cross
History.txt
Install.txt
License.txt
Readme.txt
Security.md
adhoc.cpp.proto
adler32.cpp
adler32.h
adv_simd.h
aes.h
aes_armv4.S
aes_armv4.h
algebra.cpp
algebra.h
algparam.cpp
algparam.h
allocate.cpp
allocate.h
arc4.cpp
arc4.h
argnames.h
aria.cpp
aria.h
aria_simd.cpp
ariatab.cpp
arm_simd.h
asn.cpp
asn.h
authenc.cpp
authenc.h
base32.cpp
base32.h
base64.cpp
base64.h
basecode.cpp
basecode.h
bds10.zip
bench.h
bench1.cpp
bench2.cpp
bench3.cpp
bfinit.cpp
blake2.cpp
blake2.h
blake2b_simd.cpp
blake2s_simd.cpp
blowfish.cpp
blowfish.h
blumshub.cpp
blumshub.h
camellia.cpp
camellia.h
cast.cpp
cast.h
casts.cpp
cbcmac.cpp
cbcmac.h
ccm.cpp
ccm.h
chacha.cpp
chacha.h
chacha_avx.cpp
chacha_simd.cpp
chachapoly.cpp
chachapoly.h
cham.cpp
cham.h
cham_simd.cpp
channels.cpp
channels.h
cmac.cpp
cmac.h
config.h
config_align.h
config_asm.h
config_cpu.h
config_cxx.h
config_dll.h
config_int.h
config_misc.h
config_ns.h
config_os.h
config_ver.h
cpu.cpp
cpu.h
crc.cpp
crc.h
crc_simd.cpp
cryptdll.vcxproj
cryptdll.vcxproj.filters
cryptest.nmake
cryptest.sln
cryptest.vcxproj
cryptest.vcxproj.filters
cryptest.vcxproj.user
cryptlib.cpp
cryptlib.h
cryptlib.vcxproj
cryptlib.vcxproj.filters
cryptopp.mapfile
cryptopp.rc
cryptopp.supp
darn.cpp
darn.h
datatest.cpp
default.cpp
default.h
des.cpp
des.h
dessp.cpp
dh.cpp
dh.h
dh2.cpp
dh2.h
dll.cpp
dll.h
dlltest.cpp
dlltest.vcxproj
dlltest.vcxproj.filters
dmac.h
donna.h
donna_32.cpp
donna_32.h
donna_64.cpp
donna_64.h
donna_sse.cpp
donna_sse.h
drbg.h
dsa.cpp
dsa.h
eax.cpp
eax.h
ec2n.cpp
ec2n.h
eccrypto.cpp
eccrypto.h
ecp.cpp
ecp.h
ecpoint.h
elgamal.cpp
elgamal.h
emsa2.cpp
emsa2.h
eprecomp.cpp
eprecomp.h
esign.cpp
esign.h
factory.h
fhmqv.h
files.cpp
files.h
filters.cpp
filters.h
fips140.cpp
fips140.h
fipsalgt.cpp
fipstest.cpp
fltrimpl.h
gcm.cpp
gcm.h
gcm_simd.cpp
gf256.cpp
gf256.h
gf2_32.cpp
gf2_32.h
gf2n.cpp
gf2n.h
gf2n_simd.cpp
gfpcrypt.cpp
gfpcrypt.h
gost.cpp
gost.h
gzip.cpp
gzip.h
hashfwd.h
hc128.cpp
hc128.h
hc256.cpp
hc256.h
hex.cpp
hex.h
hight.cpp
hight.h
hkdf.h
hmac.cpp
hmac.h
hmqv.h
hrtimer.cpp
hrtimer.h
ida.cpp
ida.h
idea.cpp
idea.h
integer.cpp
integer.h
iterhash.cpp
iterhash.h
kalyna.cpp
kalyna.h
kalynatab.cpp
keccak.cpp
keccak.h
keccak_core.cpp
keccak_simd.cpp
lea.cpp
lea.h
lea_simd.cpp
lubyrack.h
luc.cpp
luc.h
mars.cpp
mars.h
marss.cpp
md2.cpp
md2.h
md4.cpp
md4.h
md5.cpp
md5.h
mdc.h
mersenne.h
misc.cpp
misc.h
modarith.h
modes.cpp
modes.h
modexppc.h
mqueue.cpp
mqueue.h
mqv.cpp
mqv.h
naclite.h
nbtheory.cpp
nbtheory.h
neon_simd.cpp
nr.h
oaep.cpp
oaep.h
oids.h
osrng.cpp
osrng.h
ossig.h
padlkrng.cpp
padlkrng.h
panama.cpp
panama.h
pch.cpp
pch.h
pkcspad.cpp
pkcspad.h
poly1305.cpp
poly1305.h
polynomi.cpp
polynomi.h
ppc_power7.cpp
ppc_power8.cpp
ppc_power9.cpp
ppc_simd.cpp
ppc_simd.h
pssr.cpp
pssr.h
pubkey.cpp
pubkey.h
pwdbased.h
queue.cpp
queue.h
rabbit.cpp
rabbit.h
rabin.cpp
rabin.h
randpool.cpp
randpool.h
rc2.cpp
rc2.h
rc5.cpp
rc5.h
rc6.cpp
rc6.h
rdrand.asm
rdrand.cpp
rdrand.h
rdseed.asm
rdtables.cpp
regtest1.cpp
regtest2.cpp
regtest3.cpp
regtest4.cpp
resource.h
rijndael.cpp
rijndael.h
rijndael_simd.cpp
ripemd.cpp
ripemd.h
rng.cpp
rng.h
rsa.cpp
rsa.h
rw.cpp
rw.h
safer.cpp
safer.h
salsa.cpp
salsa.h
scrypt.cpp
scrypt.h
seal.cpp
seal.h
secblock.h
secblockfwd.h
seckey.h
seed.cpp
seed.h
serpent.cpp
serpent.h
serpentp.h
sha.cpp
sha.h
sha1_armv4.S
sha1_armv4.h
sha256_armv4.S
sha256_armv4.h
sha3.cpp
sha3.h
sha512_armv4.S
sha512_armv4.h
sha_simd.cpp
shacal2.cpp
shacal2.h
shacal2_simd.cpp
shake.cpp
shake.h
shark.cpp
shark.h
sharkbox.cpp
simeck.cpp
simeck.h
simon.cpp
simon.h
simon128_simd.cpp
simple.cpp
simple.h
siphash.h
skipjack.cpp
skipjack.h
sm3.cpp
sm3.h
sm4.cpp
sm4.h
sm4_simd.cpp
smartptr.h
sosemanuk.cpp
sosemanuk.h
speck.cpp
speck.h
speck128_simd.cpp
square.cpp
square.h
squaretb.cpp
sse_simd.cpp
stdcpp.h
strciphr.cpp
strciphr.h
tea.cpp
tea.h
test.cpp
tftables.cpp
threefish.cpp
threefish.h
tiger.cpp
tiger.h
tigertab.cpp
trap.h
trunhash.h
ttmac.cpp
ttmac.h
tweetnacl.cpp
tweetnacl.h
twofish.cpp
twofish.h
validat0.cpp
validat1.cpp
validat10.cpp
validat2.cpp
validat3.cpp
validat4.cpp
validat5.cpp
validat6.cpp
validat7.cpp
validat8.cpp
validat9.cpp
validate.h
vc60.zip
vmac.cpp
vmac.h
vs2005.zip
wake.cpp
wake.h
whrlpool.cpp
whrlpool.h
words.h
x64dll.asm
x64masm.asm
xed25519.cpp
xed25519.h
xtr.cpp
xtr.h
xtrcrypt.cpp
xtrcrypt.h
xts.cpp
xts.h
zdeflate.cpp
zdeflate.h
zinflate.cpp
zinflate.h
zlib.cpp
zlib.h
克隆/下载
default.h 15.83 KB
一键复制 编辑 原始数据 按行查看 历史
Jeffrey Walton 提交于 4年前 . Whitespace check-in
// default.h - originally written and placed in the public domain by Wei Dai
/// \file default.h
/// \brief Classes for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
#ifndef CRYPTOPP_DEFAULT_H
#define CRYPTOPP_DEFAULT_H
#include "sha.h"
#include "hmac.h"
#include "aes.h"
#include "des.h"
#include "modes.h"
#include "filters.h"
#include "smartptr.h"
NAMESPACE_BEGIN(CryptoPP)
/// \brief Legacy block cipher for LegacyEncryptor, LegacyDecryptor, LegacyEncryptorWithMAC and LegacyDecryptorWithMAC
typedef DES_EDE2 LegacyBlockCipher;
/// \brief Legacy hash for use with LegacyEncryptorWithMAC and LegacyDecryptorWithMAC
typedef SHA1 LegacyHashModule;
/// \brief Legacy HMAC for use withLegacyEncryptorWithMAC and LegacyDecryptorWithMAC
typedef HMAC<LegacyHashModule> LegacyMAC;
/// \brief Default block cipher for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
typedef AES DefaultBlockCipher;
/// \brief Default hash for use with DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
typedef SHA256 DefaultHashModule;
/// \brief Default HMAC for use withDefaultEncryptorWithMAC and DefaultDecryptorWithMAC
typedef HMAC<DefaultHashModule> DefaultMAC;
/// \brief Exception thrown when LegacyDecryptorWithMAC or DefaultDecryptorWithMAC decryption error is encountered
class DataDecryptorErr : public Exception
{
public:
DataDecryptorErr(const std::string &s)
: Exception(DATA_INTEGRITY_CHECK_FAILED, s) {}
};
/// \brief Exception thrown when a bad key is encountered in DefaultDecryptorWithMAC and LegacyDecryptorWithMAC
class KeyBadErr : public DataDecryptorErr
{
public: KeyBadErr()
: DataDecryptorErr("DataDecryptor: cannot decrypt message with this passphrase") {}
};
/// \brief Exception thrown when an incorrect MAC is encountered in DefaultDecryptorWithMAC and LegacyDecryptorWithMAC
class MACBadErr : public DataDecryptorErr
{
public: MACBadErr()
: DataDecryptorErr("DataDecryptorWithMAC: MAC check failed") {}
};
/// \brief Algorithm information for password-based encryptors and decryptors
template <unsigned int BlockSize, unsigned int KeyLength, unsigned int DigestSize, unsigned int SaltSize, unsigned int Iterations>
struct DataParametersInfo
{
CRYPTOPP_CONSTANT(BLOCKSIZE = BlockSize);
CRYPTOPP_CONSTANT(KEYLENGTH = KeyLength);
CRYPTOPP_CONSTANT(SALTLENGTH = SaltSize);
CRYPTOPP_CONSTANT(DIGESTSIZE = DigestSize);
CRYPTOPP_CONSTANT(ITERATIONS = Iterations);
};
typedef DataParametersInfo<LegacyBlockCipher::BLOCKSIZE, LegacyBlockCipher::DEFAULT_KEYLENGTH, LegacyHashModule::DIGESTSIZE, 8, 200> LegacyParametersInfo;
typedef DataParametersInfo<DefaultBlockCipher::BLOCKSIZE, DefaultBlockCipher::DEFAULT_KEYLENGTH, DefaultHashModule::DIGESTSIZE, 8, 2500> DefaultParametersInfo;
/// \brief Password-based Encryptor
/// \tparam BC BlockCipher based class used for encryption
/// \tparam H HashTransformation based class used for mashing
/// \tparam Info Constants used by the algorithms
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256.
/// \sa DefaultEncryptor, DefaultDecryptor, LegacyEncryptor, LegacyDecryptor
/// \since Crypto++ 2.0
template <class BC, class H, class Info>
class DataEncryptor : public ProxyFilter, public Info
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Construct a DataEncryptor
/// \param passphrase a C-String password
/// \param attachment a BufferedTransformation to attach to this object
DataEncryptor(const char *passphrase, BufferedTransformation *attachment = NULLPTR);
/// \brief Construct a DataEncryptor
/// \param passphrase a byte string password
/// \param passphraseLength the length of the byte string password
/// \param attachment a BufferedTransformation to attach to this object
DataEncryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR);
protected:
void FirstPut(const byte *);
void LastPut(const byte *inString, size_t length);
private:
SecByteBlock m_passphrase;
typename CBC_Mode<BC>::Encryption m_cipher;
};
/// \brief Password-based Decryptor
/// \tparam BC BlockCipher based class used for encryption
/// \tparam H HashTransformation based class used for mashing
/// \tparam Info Constants used by the algorithms
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256.
/// \sa DefaultEncryptor, DefaultDecryptor, LegacyEncryptor, LegacyDecryptor
/// \since Crypto++ 2.0
template <class BC, class H, class Info>
class DataDecryptor : public ProxyFilter, public Info
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Constructs a DataDecryptor
/// \param passphrase a C-String password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptor(const char *passphrase, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
/// \brief Constructs a DataDecryptor
/// \param passphrase a byte string password
/// \param passphraseLength the length of the byte string password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
enum State {WAITING_FOR_KEYCHECK, KEY_GOOD, KEY_BAD};
State CurrentState() const {return m_state;}
protected:
void FirstPut(const byte *inString);
void LastPut(const byte *inString, size_t length);
State m_state;
private:
void CheckKey(const byte *salt, const byte *keyCheck);
SecByteBlock m_passphrase;
typename CBC_Mode<BC>::Decryption m_cipher;
member_ptr<FilterWithBufferedInput> m_decryptor;
bool m_throwException;
};
/// \brief Password-based encryptor with MAC
/// \tparam BC BlockCipher based class used for encryption
/// \tparam H HashTransformation based class used for mashing
/// \tparam MAC HashTransformation based class used for authentication
/// \tparam Info Constants used by the algorithms
/// \details DataEncryptorWithMAC uses a non-standard mashup function called Mash() to derive key
/// bits from the password.
/// \details The purpose of the function Mash() is to take an arbitrary length input string and
/// *deterministically* produce an arbitrary length output string such that (1) it looks random,
/// (2) no information about the input is deducible from it, and (3) it contains as much entropy
/// as it can hold, or the amount of entropy in the input string, whichever is smaller.
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256.
/// \sa DefaultEncryptorWithMAC, DefaultDecryptorWithMAC, LegacyDecryptorWithMAC, LegacyEncryptorWithMAC
/// \since Crypto++ 2.0
template <class BC, class H, class MAC, class Info>
class DataEncryptorWithMAC : public ProxyFilter
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Constructs a DataEncryptorWithMAC
/// \param passphrase a C-String password
/// \param attachment a BufferedTransformation to attach to this object
DataEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULLPTR);
/// \brief Constructs a DataEncryptorWithMAC
/// \param passphrase a byte string password
/// \param passphraseLength the length of the byte string password
/// \param attachment a BufferedTransformation to attach to this object
DataEncryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR);
protected:
void FirstPut(const byte *inString) {CRYPTOPP_UNUSED(inString);}
void LastPut(const byte *inString, size_t length);
private:
member_ptr<MAC> m_mac;
};
/// \brief Password-based decryptor with MAC
/// \tparam BC BlockCipher based class used for encryption
/// \tparam H HashTransformation based class used for mashing
/// \tparam MAC HashTransformation based class used for authentication
/// \tparam Info Constants used by the algorithms
/// \details DataDecryptorWithMAC uses a non-standard mashup function called Mash() to derive key
/// bits from the password.
/// \details The purpose of the function Mash() is to take an arbitrary length input string and
/// *deterministically* produce an arbitrary length output string such that (1) it looks random,
/// (2) no information about the input is deducible from it, and (3) it contains as much entropy
/// as it can hold, or the amount of entropy in the input string, whichever is smaller.
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256.
/// \sa DefaultEncryptorWithMAC, DefaultDecryptorWithMAC, LegacyDecryptorWithMAC, LegacyEncryptorWithMAC
/// \since Crypto++ 2.0
template <class BC, class H, class MAC, class Info>
class DataDecryptorWithMAC : public ProxyFilter
{
public:
CRYPTOPP_CONSTANT(BLOCKSIZE = Info::BLOCKSIZE);
CRYPTOPP_CONSTANT(KEYLENGTH = Info::KEYLENGTH);
CRYPTOPP_CONSTANT(SALTLENGTH = Info::SALTLENGTH);
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE);
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS);
/// \brief Constructs a DataDecryptor
/// \param passphrase a C-String password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
/// \brief Constructs a DataDecryptor
/// \param passphrase a byte string password
/// \param passphraseLength the length of the byte string password
/// \param attachment a BufferedTransformation to attach to this object
/// \param throwException a flag specifying whether an Exception should be thrown on error
DataDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
typename DataDecryptor<BC,H,Info>::State CurrentState() const;
bool CheckLastMAC() const;
protected:
void FirstPut(const byte *inString) {CRYPTOPP_UNUSED(inString);}
void LastPut(const byte *inString, size_t length);
private:
member_ptr<MAC> m_mac;
HashVerificationFilter *m_hashVerifier;
bool m_throwException;
};
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Password-based encryptor (deprecated)
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct LegacyEncryptor : public DataEncryptor<LegacyBlockCipher,LegacyHashModule,LegacyParametersInfo> {};
/// \brief Password-based decryptor (deprecated)
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct LegacyDecryptor : public DataDecryptor<LegacyBlockCipher,LegacyHashModule,LegacyParametersInfo> {};
/// \brief Password-based encryptor
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct DefaultEncryptor : public DataEncryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo> {};
/// \brief Password-based decryptor
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct DefaultDecryptor : public DataDecryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo> {};
/// \brief Password-based encryptor with MAC (deprecated)
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct LegacyEncryptorWithMAC : public DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> {};
/// \brief Password-based decryptor with MAC (deprecated)
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct LegacyDecryptorWithMAC : public DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> {};
/// \brief Password-based encryptor with MAC
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct DefaultEncryptorWithMAC : public DataEncryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo> {};
/// \brief Password-based decryptor with MAC
/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
/// <tt>Default*</tt> classes, and the old algorithms are available with the <tt>Legacy*</tt> classes.
struct DefaultDecryptorWithMAC : public DataDecryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo> {};
#else
typedef DataEncryptor<LegacyBlockCipher,LegacyHashModule,LegacyParametersInfo> LegacyEncryptor;
typedef DataDecryptor<LegacyBlockCipher,LegacyHashModule,LegacyParametersInfo> LegacyDecryptor;
typedef DataEncryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo> DefaultEncryptor;
typedef DataDecryptor<DefaultBlockCipher,DefaultHashModule,DefaultParametersInfo> DefaultDecryptor;
typedef DataEncryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> LegacyEncryptorWithMAC;
typedef DataDecryptorWithMAC<LegacyBlockCipher,LegacyHashModule,LegacyMAC,LegacyParametersInfo> LegacyDecryptorWithMAC;
typedef DataEncryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo> DefaultEncryptorWithMAC;
typedef DataDecryptorWithMAC<DefaultBlockCipher,DefaultHashModule,DefaultMAC,DefaultParametersInfo> DefaultDecryptorWithMAC;
#endif
NAMESPACE_END
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mysql-tools/cryptopp.git
git@gitee.com:mysql-tools/cryptopp.git
mysql-tools
cryptopp
Crypto++库
master

搜索帮助