Updated documentation

This commit is contained in:
Jeffrey Walton 2015-12-13 23:53:50 -05:00
parent 5a28b8e184
commit d9502a6ea9
23 changed files with 278 additions and 155 deletions

7
3way.h

@ -13,16 +13,15 @@
NAMESPACE_BEGIN(CryptoPP)
//! \class ThreeWay_Info
//! \brief The cipher's key, iv, block size and name information.
//! \brief ThreeWay block cipher information
struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
{
static const char *StaticAlgorithmName() {return "3-Way";}
};
// <a href="http://www.weidai.com/scan-mirror/cs.html#3-Way">3-Way</a>
//! \class ThreeWay
//! \brief Provides 3-Way encryption and decryption
//! \brief ThreeWay block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#3-Way">3-Way</a>
class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation
{
//! \class Base

4
aes.h

@ -10,7 +10,9 @@
NAMESPACE_BEGIN(CryptoPP)
//! <a href="http://www.cryptolounge.org/wiki/AES">AES</a> winner, announced on 10/2/2000
//! \class AES
//! \brief AES block cipher (Rijndael)
//! \sa <a href="http://www.cryptolounge.org/wiki/AES">AES</a> winner, announced on 10/2/2000
DOCUMENTED_TYPEDEF(Rijndael, AES);
typedef RijndaelEncryption AESEncryption;

@ -12,7 +12,7 @@
NAMESPACE_BEGIN(CryptoPP)
//! \class Blowfish_Info
//! \brief The cipher's key, iv, block size and name information.
//! \brief Blowfish block cipher information
struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4, 56>, public FixedRounds<16>
{
static const char *StaticAlgorithmName() {return "Blowfish";}
@ -20,8 +20,8 @@ struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4,
// <a href="http://www.weidai.com/scan-mirror/cs.html#Blowfish">Blowfish</a>
//! \class Blowfish
//! \brief Provides Blowfish encryption and decryption
//! \class Blowfish_Info
//! \brief Blowfish block cipher
class Blowfish : public Blowfish_Info, public BlockCipherDocumentation
{
//! \class Base

@ -12,13 +12,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class Camellia_Info
//! \brief Camellia block cipher information
struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
{
static const char *StaticAlgorithmName() {return "Camellia";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Camellia">Camellia</a>
//! \class Camellia_Info
//! \brief Camellia block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#Camellia">Camellia</a>
class Camellia : public Camellia_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>

14
cast.h

@ -17,13 +17,16 @@ protected:
static const word32 S[8][256];
};
//! algorithm info
//! \class CAST128_Info
//! \brief CAST128 block cipher information
struct CAST128_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 5, 16>
{
static const char *StaticAlgorithmName() {return "CAST-128";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-128">CAST-128</a>
//! \class CAST128
//! \brief CAST128 block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-128">CAST-128</a>
class CAST128 : public CAST128_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl<CAST128_Info>
@ -53,13 +56,16 @@ public:
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
};
//! algorithm info
//! \class CAST256_Info
//! \brief CAST256 block cipher information
struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32>
{
static const char *StaticAlgorithmName() {return "CAST-256";}
};
//! <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-256">CAST-256</a>
//! \class CAST256
//! \brief CAST256 block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-256">CAST-256</a>
class CAST256 : public CAST256_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl<CAST256_Info>

@ -493,7 +493,8 @@ public:
};
//! \class SimpleKeyingInterface
//! Interface for algorithms that take byte strings as keys
//! \brief Interface for algorithms that take byte strings as keys
//! \sa FixedKeyLength(), VariableKeyLength(), SameKeyLengthAs(), SimpleKeyingInterfaceImpl()
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyingInterface
{
public:
@ -507,11 +508,14 @@ public:
virtual size_t DefaultKeyLength() const =0;
//! \brief
//! \param n the desired keylength
//! \returns the smallest valid key length in bytes that is greater than or equal to <tt>min(n, GetMaxKeyLength())</tt>
virtual size_t GetValidKeyLength(size_t n) const =0;
//! \brief Returns whether keylength is a valid key length
//! \details Internally the function calls GetValidKeyLength()
//! \param keylength the requested keylength
//! \returns true if keylength is valid, false otherwise
//! \details Internally the function calls GetValidKeyLength()
virtual bool IsValidKeyLength(size_t keylength) const
{return keylength == GetValidKeyLength(keylength);}
@ -527,8 +531,8 @@ public:
//! \param length the size of the key, in bytes
//! \param rounds the number of rounds to apply the transformation function,
//! if applicable
//! \details SetKeyWithRounds calls SetKey with an NameValuePairs
//! object that just specifies rounds. rounds is an integer parameter,
//! \details SetKeyWithRounds() calls SetKey() with a NameValuePairs
//! object that only specifies rounds. rounds is an integer parameter,
//! and <tt>-1</tt> means use the default number of rounds.
void SetKeyWithRounds(const byte *key, size_t length, int rounds);
@ -537,27 +541,32 @@ public:
//! \param length the size of the key, in bytes
//! \param iv the intiialization vector to use when keying the object
//! \param ivLength the size of the iv, in bytes
//! \details SetKeyWithIV calls SetKey with an NameValuePairs object
//! that just specifies iv. iv is a byte buffer with size ivLength.
//! \details SetKeyWithIV() calls SetKey() with a NameValuePairs
//! that only specifies IV. The IV is a byte buffer with size ivLength.
//! ivLength is an integer parameter, and <tt>-1</tt> means use IVSize().
void SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength);
//! \brief Sets or reset the key of this object
//! \param key the key to use when keying the object
//! \param length the size of the key, in bytes
//! \param iv the intiialization vector to use when keying the object
//! \details SetKeyWithIV calls SetKey with an NameValuePairs object
//! that just specifies iv. iv is a byte buffer, and it must have
//! a size IVSize.
//! \details SetKeyWithIV() calls SetKey() with a NameValuePairs() object
//! that only specifies iv. iv is a byte buffer, and it must have
//! a size IVSize().
void SetKeyWithIV(const byte *key, size_t length, const byte *iv)
{SetKeyWithIV(key, length, iv, IVSize());}
//! \brief Provides IV requirements as an enumerated value.
//! \brief Secure IVs requirements as enumerated values.
//! \details Provides secure IV requirements as a monotomically increasing enumerated values. Requirements can be
//! compared using less than (&lt;) and greater than (&gt;). For example, <tt>UNIQUE_IV &lt; RANDOM_IV</tt>
//! and <tt>UNPREDICTABLE_RANDOM_IV &gt; RANDOM_IV</tt>.
//! \sa IsResynchronizable(), CanUseRandomIVs(), CanUsePredictableIVs(), CanUseStructuredIVs()
enum IV_Requirement {
//! \brief The IV must be unique
UNIQUE_IV = 0,
//! \brief The IV must be random
//! \brief The IV must be random and possibly predictable
RANDOM_IV,
//! \brief The IV must be unpredictable
//! \brief The IV must be random and unpredictable
UNPREDICTABLE_RANDOM_IV,
//! \brief The IV is set by the object
INTERNALLY_GENERATED_IV,
@ -565,42 +574,69 @@ public:
NOT_RESYNCHRONIZABLE
};
//! returns the minimal requirement for secure IVs
//! \brief Minimal requirement for secure IVs
//! \returns the secure IV requirement of the algorithm
virtual IV_Requirement IVRequirement() const =0;
//! returns whether the object can be resynchronized (i.e. supports initialization vectors)
/*! If this function returns true, and no IV is passed to SetKey() and CanUseStructuredIVs()==true, an IV of all 0's will be assumed. */
//! \brief Determines if the object can be resynchronized
//! \returns true if the object can be resynchronized (i.e. supports initialization vectors), false otherwise
//! \note If this function returns true, and no IV is passed to SetKey() and <tt>CanUseStructuredIVs()==true</tt>,
//! an IV of all 0's will be assumed.
bool IsResynchronizable() const {return IVRequirement() < NOT_RESYNCHRONIZABLE;}
//! returns whether the object can use random IVs (in addition to ones returned by GetNextIV)
//! \brief Determines if the object can use random IVs
//! \returns true if the object can use random IVs (in addition to ones returned by GetNextIV), false otherwise
bool CanUseRandomIVs() const {return IVRequirement() <= UNPREDICTABLE_RANDOM_IV;}
//! returns whether the object can use random but possibly predictable IVs (in addition to ones returned by GetNextIV)
//! \brief Determines if the object can use random but possibly predictable IVs
//! \returns true if the object can use random but possibly predictable IVs (in addition to ones returned by
//! GetNextIV), false otherwise
bool CanUsePredictableIVs() const {return IVRequirement() <= RANDOM_IV;}
//! returns whether the object can use structured IVs, for example a counter (in addition to ones returned by GetNextIV)
//! \brief Determines if the object can use structured IVs
//! returns whether the object can use structured IVs, for example a counter (in addition to ones returned by
//! GetNextIV), false otherwise
bool CanUseStructuredIVs() const {return IVRequirement() <= UNIQUE_IV;}
//! \brief Returns length of the IV accepted by this object
//! \returns the size of an IV, in bytes
//! \throws NotImplemented() if the object does not support resynchronization
//! \details The default implementation throws NotImplemented
virtual unsigned int IVSize() const
{throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");}
//! returns default length of IVs accepted by this object
//! \brief Provides the default size of an IV
//! \returns default length of IVs accepted by this object, in bytes
unsigned int DefaultIVLength() const {return IVSize();}
//! returns minimal length of IVs accepted by this object
//! \brief Provides the minimum size of an IV
//! \returns minimal length of IVs accepted by this object, in bytes
//! \throws NotImplemented() if the object does not support resynchronization
virtual unsigned int MinIVLength() const {return IVSize();}
//! returns maximal length of IVs accepted by this object
//! \brief Provides the maximum size of an IV
//! \returns maximal length of IVs accepted by this object, in bytes
//! \throws NotImplemented() if the object does not support resynchronization
virtual unsigned int MaxIVLength() const {return IVSize();}
//! resynchronize with an IV. ivLength=-1 means use IVSize()
//! \brief Resynchronize with an IV
//! \param iv the initialization vector
//! \param ivLength the size of the initialization vector, in bytes
//! \details Resynchronize() resynchronizes with an IV provided by the caller. <tt>ivLength=-1</tt> means use IVSize().
//! \throws NotImplemented() if the object does not support resynchronization
virtual void Resynchronize(const byte *iv, int ivLength=-1) {
CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(ivLength);
throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");
}
//! \brief Gets a secure IV for the next message
//! \brief Retrieves a secure IV for the next message
//! \param rng a RandomNumberGenerator to produce keying material
//! \param iv a block of bytes to receive the IV
//! \details The IV must be at least IVSize() in length.
//! \details 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.
//! \details key must be at least IVSize() in length.
//! to start the next one. After calling it, you must call SetKey() or Resynchronize().
//! before using this object again.
//! \details Internally, the base class implementation calls RandomNumberGenerator's GenerateBlock()
//! \note This method is not implemented on decryption objects.
virtual void GetNextIV(RandomNumberGenerator &rng, byte *iv);
@ -638,7 +674,7 @@ protected:
void ThrowIfInvalidIV(const byte *iv);
//! \brief Validates the IV length
//! \param length the size of the IV, in bytes
//! \param length the size of an IV, in bytes
//! \throws InvalidArgument if the number of rounds are invalid
size_t ThrowIfInvalidIVLength(int length);
@ -956,7 +992,7 @@ public:
//! \param digest a pointer to the buffer to receive the hash
//! \param digestSize the size of the truncated digest, in bytes
//! \details TruncatedFinal() call Final() and then copies digestSize bytes to digest
//! \details TruncatedFinal() restarts the hash for the next nmessage.
//! \details TruncatedFinal() restarts the hash for the next message.
virtual void TruncatedFinal(byte *digest, size_t digestSize) =0;
//! \brief Updates the hash with additional input and computes the hash of the current message
@ -1002,7 +1038,10 @@ public:
#endif
protected:
//! \brief Exception thrown when the truncated digest size is greater than DigestSize()
//! \brief Validates a truncated digest size
//! \param size the requested digest size
//! \throws InvalidArgument if the algorithm's digest size cannot be truncated to the requested size
//! \details Throws an exception when the truncated digest size is greater than DigestSize()
void ThrowIfInvalidTruncatedSize(size_t size) const;
};
@ -2035,37 +2074,41 @@ public:
};
//! \brief Interface for public keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKey : virtual public CryptoMaterial
{
};
//! \brief Interface for private keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKey : public GeneratableCryptoMaterial
{
};
//! \brief Interface for crypto prameters
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoParameters : public GeneratableCryptoMaterial
{
};
//! \brief Interface for asymmetric algorithms
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AsymmetricAlgorithm : public Algorithm
{
public:
//! returns a reference to the crypto material used by this object
//! \brief Retrieves a reference to CryptoMaterial
//! \returns a reference to the crypto material used by this object
virtual CryptoMaterial & AccessMaterial() =0;
//! returns a const reference to the crypto material used by this object
//! \brief Retrieves a reference to CryptoMaterial
//! \returns a const reference to the crypto material used by this object
virtual const CryptoMaterial & GetMaterial() const =0;
//! for backwards compatibility, calls AccessMaterial().Load(bt)
//! \brief Loads this object from a BufferedTransformation
//! \param bt a BufferedTransformation object
//! \deprecated for backwards compatibility, calls <tt>AccessMaterial().Load(bt)</tt>
void BERDecode(BufferedTransformation &bt)
{AccessMaterial().Load(bt);}
//! for backwards compatibility, calls GetMaterial().Save(bt)
//! \brief Saves this object to a BufferedTransformation
//! \param bt a BufferedTransformation object
//! \deprecated for backwards compatibility, calls GetMaterial().Save(bt)
void DEREncode(BufferedTransformation &bt) const
{GetMaterial().Save(bt);}
@ -2075,16 +2118,18 @@ public:
};
//! \brief Interface for asymmetric algorithms using public keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKeyAlgorithm : public AsymmetricAlgorithm
{
public:
// VC60 workaround: no co-variant return type
CryptoMaterial & AccessMaterial() {return AccessPublicKey();}
const CryptoMaterial & GetMaterial() const {return GetPublicKey();}
CryptoMaterial & AccessMaterial()
{return AccessPublicKey();}
const CryptoMaterial & GetMaterial() const
{return GetPublicKey();}
virtual PublicKey & AccessPublicKey() =0;
virtual const PublicKey & GetPublicKey() const {return const_cast<PublicKeyAlgorithm *>(this)->AccessPublicKey();}
virtual const PublicKey & GetPublicKey() const
{return const_cast<PublicKeyAlgorithm *>(this)->AccessPublicKey();}
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
virtual ~PublicKeyAlgorithm() {}
@ -2092,7 +2137,6 @@ public:
};
//! \brief Interface for asymmetric algorithms using private keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKeyAlgorithm : public AsymmetricAlgorithm
{
public:
@ -2108,7 +2152,6 @@ public:
};
//! \brief Interface for key agreement algorithms
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE KeyAgreementAlgorithm : public AsymmetricAlgorithm
{
public:
@ -2124,33 +2167,41 @@ public:
};
//! \brief Interface for public-key encryptors and decryptors
/*! This class provides an interface common to encryptors and decryptors
for querying their plaintext and ciphertext lengths.
*/
//! \details This class provides an interface common to encryptors and decryptors
//! for querying their plaintext and ciphertext lengths.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_CryptoSystem
{
public:
virtual ~PK_CryptoSystem() {}
//! maximum length of plaintext for a given ciphertext length
/*! \note This function returns 0 if ciphertextLength is not valid (too long or too short). */
//! \brief Provides the maximum length of plaintext for a given ciphertext length
//! \returns the maximum size of the plaintext, in bytes
//! \details This function returns 0 if ciphertextLength is not valid (too long or too short).
virtual size_t MaxPlaintextLength(size_t ciphertextLength) const =0;
//! calculate length of ciphertext given length of plaintext
/*! \note This function returns 0 if plaintextLength is not valid (too long). */
//! \brief Calculate the length of ciphertext given length of plaintext
//! \returns the maximum size of the ciphertext, in bytes
//! \details This function returns 0 if plaintextLength is not valid (too long).
virtual size_t CiphertextLength(size_t plaintextLength) const =0;
//! this object supports the use of the parameter with the given name
/*! some possible parameter names: EncodingParameters, KeyDerivationParameters */
//! \brief Determines whether this object supports the use of a named parameter
//! \param name the name of the parameter
//! \returns true if the parameter name is supported, false otherwise
//! \details Some possible parameter names: EncodingParameters(), KeyDerivationParameters()
//! and others Parameters listed in argnames.h
virtual bool ParameterSupported(const char *name) const =0;
//! return fixed ciphertext length, if one exists, otherwise return 0
/*! \note "Fixed" here means length of ciphertext does not depend on length of plaintext.
It usually does depend on the key length. */
//! \brief Provides the fixed ciphertext length, if one exists
//! \returns the fixed ciphertext length if one exists, otherwise 0
//! \details "Fixed" here means length of ciphertext does not depend on length of plaintext.
//! In this case, it usually does depend on the key length.
virtual size_t FixedCiphertextLength() const {return 0;}
//! return maximum plaintext length given the fixed ciphertext length, if one exists, otherwise return 0
//! \brief Provides the maximum plaintext length given a fixed ciphertext length
//! \return maximum plaintext length given the fixed ciphertext length, if one exists,
//! otherwise return 0.
//! \details FixedMaxPlaintextLength(0 returns the maximum plaintext length given the fixed ciphertext
//! length, if one exists, otherwise return 0.
virtual size_t FixedMaxPlaintextLength() const {return 0;}
#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY

7
gost.h

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class GOST_Info
//! \brief GOST block cipher information
struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32>
{
static const char *StaticAlgorithmName() {return "GOST";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#GOST">GOST</a>
//! \class GOST
//! \brief GOST block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#GOST">GOST</a>
class GOST : public GOST_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<GOST_Info>

7
idea.h

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class IDEA_Info
//! \brief IDEA block cipher information
struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8>
{
static const char *StaticAlgorithmName() {return "IDEA";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#IDEA">IDEA</a>
//! \class IDEA
//! \brief IDEA block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#IDEA">IDEA</a>
class IDEA : public IDEA_Info, public BlockCipherDocumentation
{
public: // made public for internal purposes

@ -16,14 +16,16 @@ template <class T> struct DigestSizeDoubleWorkaround // VC60 workaround
CRYPTOPP_CONSTANT(RESULT = 2*T::DIGESTSIZE)
};
//! algorithm info
//! \class LR_Info
//! \brief Luby-Rackoff block cipher information
template <class T>
struct LR_Info : public VariableKeyLength<16, 0, 2*(INT_MAX/2), 2>, public FixedBlockSize<DigestSizeDoubleWorkaround<T>::RESULT>
{
static std::string StaticAlgorithmName() {return std::string("LR/")+T::StaticAlgorithmName();}
};
//! Luby-Rackoff
//! \class LR
//! \brief Luby-Rackoff block cipher
template <class T>
class LR : public LR_Info<T>, public BlockCipherDocumentation
{

7
mars.h

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class MARS_Info
//! \brief MARS block cipher information
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4>
{
static const char *StaticAlgorithmName() {return "MARS";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#MARS">MARS</a>
//! \class MARS
//! \brief MARS block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#MARS">MARS</a>
class MARS : public MARS_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<MARS_Info>

4
rc2.h

@ -13,7 +13,7 @@
NAMESPACE_BEGIN(CryptoPP)
//! \class RC2_Info
//! \brief The RC2 cipher's key, iv, block size and name information.
//! \brief RC2 block cipher information
struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128>
{
CRYPTOPP_CONSTANT(DEFAULT_EFFECTIVE_KEYLENGTH = 1024)
@ -22,7 +22,7 @@ struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128>
};
//! \class RC2
//! \brief The RC2 stream cipher
//! \brief RC2 block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#RC2">RC2</a> on the Crypto Lounge.
class RC2 : public RC2_Info, public BlockCipherDocumentation
{

7
rc5.h

@ -11,14 +11,17 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class RC5_Info
//! \brief RC5 block cipher information
struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
{
static const char *StaticAlgorithmName() {return "RC5";}
typedef word32 RC5_WORD;
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#RC5">RC5</a>
//! \class RC5
//! \brief RC5 block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#RC5">RC5</a>
class RC5 : public RC5_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC5_Info>

7
rc6.h

@ -11,14 +11,17 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class RC6_Info
//! \brief RC6 block cipher information
struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 255>, public VariableRounds<20>
{
static const char *StaticAlgorithmName() {return "RC6";}
typedef word32 RC6_WORD;
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#RC6">RC6</a>
//! \class RC6
//! \brief RC6 block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#RC6">RC6</a>
class RC6 : public RC6_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC6_Info>

17
safer.h

@ -11,7 +11,8 @@
NAMESPACE_BEGIN(CryptoPP)
/// base class, do not use directly
//! \class SAFER
//! \brief SAFER base class
class SAFER
{
public:
@ -49,13 +50,16 @@ protected:
bool Strengthened() const {return STR;}
};
//! _
//! \class SAFER_K_Info
//! \brief SAFER-K block cipher information
struct SAFER_K_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13>
{
static const char *StaticAlgorithmName() {return "SAFER-K";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SAFER-K">SAFER-K</a>
//! \class SAFER_K
//! \brief SAFER-K block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SAFER-K">SAFER-K</a>
class SAFER_K : public SAFER_K_Info, public SAFER, public BlockCipherDocumentation
{
public:
@ -63,13 +67,16 @@ public:
typedef BlockCipherFinal<DECRYPTION, SAFER_Impl<Dec, SAFER_K_Info, false> > Decryption;
};
//! _
//! \class SAFER_SK_Info
//! \brief SAFER-SK block cipher information
struct SAFER_SK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13>
{
static const char *StaticAlgorithmName() {return "SAFER-SK";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SAFER-SK">SAFER-SK</a>
//! \class SAFER_SK
//! \brief SAFER-SK block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SAFER-SK">SAFER-SK</a>
class SAFER_SK : public SAFER_SK_Info, public SAFER, public BlockCipherDocumentation
{
public:

@ -28,31 +28,31 @@ inline CipherDir ReverseCipherDir(CipherDir dir)
}
//! \class FixedBlockSize
//! \brief Inherited by block ciphers with fixed block size
//! \tparam N the blocksize of the cipher
//! \brief Inherited by algorithms with fixed block size
//! \tparam N the blocksize of the algorithm
template <unsigned int N>
class FixedBlockSize
{
public:
//! \brief The block size of the cipher provided as a constant.
//! \brief The block size of the algorithm provided as a constant.
CRYPTOPP_CONSTANT(BLOCKSIZE = N)
};
// ************** rounds ***************
//! \class FixedRounds
//! \brief Inherited by ciphers with fixed number of rounds
//! \tparam R the number of rounds used by the cipher
//! \brief Inherited by algorithms with fixed number of rounds
//! \tparam R the number of rounds used by the algorithm
template <unsigned int R>
class FixedRounds
{
public:
//! \brief The number of rounds for the cipher provided as a constant.
//! \brief The number of rounds for the algorithm provided as a constant.
CRYPTOPP_CONSTANT(ROUNDS = R)
};
//! \class VariableRounds
//! \brief Inherited by ciphers with variable number of rounds
//! \brief Inherited by algorithms with variable number of rounds
//! \tparam D Default number of rounds
//! \tparam N Minimum number of rounds
//! \tparam D Maximum number of rounds
@ -60,13 +60,13 @@ template <unsigned int D, unsigned int N=1, unsigned int M=INT_MAX> // use INT_
class VariableRounds
{
public:
//! \brief The default number of rounds for the cipher provided as a constant.
//! \brief The default number of rounds for the algorithm provided as a constant.
CRYPTOPP_CONSTANT(DEFAULT_ROUNDS = D)
//! \brief The minimum number of rounds for the cipher provided as a constant.
//! \brief The minimum number of rounds for the algorithm provided as a constant.
CRYPTOPP_CONSTANT(MIN_ROUNDS = N)
//! \brief The maximum number of rounds for the cipher provided as a constant.
//! \brief The maximum number of rounds for the algorithm provided as a constant.
CRYPTOPP_CONSTANT(MAX_ROUNDS = M)
//! \brief The default number of rounds for the cipher based on key length
//! \brief The default number of rounds for the algorithm based on key length
//! provided by a static function.
//! \param keylength the size of the key, in bytes
//! \details keylength is unused in the default implementation.
@ -74,7 +74,7 @@ public:
{CRYPTOPP_UNUSED(keylength); return DEFAULT_ROUNDS;}
protected:
//! \brief Validates the number of rounds for a cipher.
//! \brief Validates the number of rounds for an algorithm.
//! \param rounds the canddiate number of rounds
//! \param alg an Algorithm object used if the number of rounds are invalid
//! \throws InvalidRounds if the number of rounds are invalid
@ -89,10 +89,10 @@ protected:
#endif
}
//! \brief Validates the number of rounds for a cipher
//! \brief Validates the number of rounds for an algorithm
//! \param param the canddiate number of rounds
//! \param alg an Algorithm object used if the number of rounds are invalid
//! \returns the number of rounds for the cipher
//! \returns the number of rounds for the algorithm
//! \throws InvalidRounds if the number of rounds are invalid
inline unsigned int GetRoundsAndThrowIfInvalid(const NameValuePairs &param, const Algorithm *alg)
{
@ -109,30 +109,31 @@ protected:
//! \tparam N Default key length, in bytes
//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
//! \tparam IV_L Default IV length, in bytes
//! \sa SimpleKeyingInterface
template <unsigned int N, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
class FixedKeyLength
{
public:
//! \brief The default key length used by the cipher provided as a constant
//! \brief The default key length used by the algorithm provided as a constant
//! \details KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(KEYLENGTH=N)
//! \brief The minimum key length used by the cipher provided as a constant
//! \brief The minimum key length used by the algorithm provided as a constant
//! \details MIN_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N)
//! \brief The maximum key length used by the cipher provided as a constant
//! \brief The maximum key length used by the algorithm provided as a constant
//! \details MAX_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(MAX_KEYLENGTH=N)
//! \brief The default key length used by the cipher provided as a constant
//! \brief The default key length used by the algorithm provided as a constant
//! \details DEFAULT_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=N)
//! \brief The default IV requirements for the cipher provided as a constant
//! \brief The default IV requirements for the algorithm provided as a constant
//! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
//! in cryptlib.h for allowed values.
CRYPTOPP_CONSTANT(IV_REQUIREMENT = IV_REQ)
//! \brief The default IV length used by the cipher provided as a constant
//! \brief The default IV length used by the algorithm provided as a constant
//! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.
CRYPTOPP_CONSTANT(IV_LENGTH = IV_L)
//! \brief The default key length for the cipher provided by a static function.
//! \brief The default key length for the algorithm provided by a static function.
//! \param keylength the size of the key, in bytes
//! \details The default implementation returns KEYLENGTH. keylength is unused
//! in the default implementation.
@ -148,6 +149,7 @@ public:
//! \tparam M Default key length multiple, in bytes. The default multiple is 1.
//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
//! \tparam IV_L Default IV length, in bytes. The default length is 0.
//! \sa SimpleKeyingInterface
template <unsigned int D, unsigned int N, unsigned int M, unsigned int Q = 1, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
class VariableKeyLength
{
@ -160,26 +162,26 @@ class VariableKeyLength
CRYPTOPP_COMPILE_ASSERT(M >= D);
public:
//! \brief The minimum key length used by the cipher provided as a constant
//! \brief The minimum key length used by the algorithm provided as a constant
//! \details MIN_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(MIN_KEYLENGTH=N)
//! \brief The maximum key length used by the cipher provided as a constant
//! \brief The maximum key length used by the algorithm provided as a constant
//! \details MAX_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(MAX_KEYLENGTH=M)
//! \brief The default key length used by the cipher provided as a constant
//! \brief The default key length used by the algorithm provided as a constant
//! \details DEFAULT_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=D)
//! \brief The key length multiple used by the cipher provided as a constant
//! \brief The key length multiple used by the algorithm provided as a constant
//! \details MAX_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(KEYLENGTH_MULTIPLE=Q)
//! \brief The default IV requirements for the cipher provided as a constant
//! \brief The default IV requirements for the algorithm provided as a constant
//! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
//! in cryptlib.h for allowed values.
CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ)
//! \brief The default initialization vector length for the cipher provided as a constant
//! \brief The default initialization vector length for the algorithm provided as a constant
//! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.
CRYPTOPP_CONSTANT(IV_LENGTH=IV_L)
//! \brief Provides a valid key length for the cipher provided by a static function.
//! \brief Provides a valid key length for the algorithm provided by a static function.
//! \param keylength the size of the key, in bytes
//! \details If keylength is less than MIN_KEYLENGTH, then the function returns
//! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function
@ -209,27 +211,28 @@ public:
//! \tparam T another FixedKeyLength or VariableKeyLength class
//! \tparam IV_REQ The IV requirements. See IV_Requirement in cryptlib.h for allowed values
//! \tparam IV_L Default IV length, in bytes
//! \sa SimpleKeyingInterface
template <class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
class SameKeyLengthAs
{
public:
//! \brief The minimum key length used by the cipher provided as a constant
//! \brief The minimum key length used by the algorithm provided as a constant
//! \details MIN_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(MIN_KEYLENGTH=T::MIN_KEYLENGTH)
//! \brief The maximum key length used by the cipher provided as a constant
//! \brief The maximum key length used by the algorithm provided as a constant
//! \details MIN_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(MAX_KEYLENGTH=T::MAX_KEYLENGTH)
//! \brief The default key length used by the cipher provided as a constant
//! \brief The default key length used by the algorithm provided as a constant
//! \details MIN_KEYLENGTH is provided in bytes, not bits
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH)
//! \brief The default IV requirements for the cipher provided as a constant
//! \brief The default IV requirements for the algorithm provided as a constant
//! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
//! in cryptlib.h for allowed values.
CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ)
//! \brief The default initialization vector length for the cipher provided as a constant
//! \brief The default initialization vector length for the algorithm provided as a constant
//! \details IV_LENGTH is provided in bytes, not bits. The default implementation uses 0.
CRYPTOPP_CONSTANT(IV_LENGTH=IV_L)
//! \brief Provides a valid key length for the cipher provided by a static function.
//! \brief Provides a valid key length for the algorithm provided by a static function.
//! \param keylength the size of the key, in bytes
//! \details If keylength is less than MIN_KEYLENGTH, then the function returns
//! MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH, then the function
@ -241,30 +244,35 @@ public:
{return T::StaticGetValidKeyLength(keylength);}
};
// ************** implementation helper for SimpleKeyed ***************
// ************** implementation helper for SimpleKeyingInterface ***************
//! \class SimpleKeyingInterfaceImpl
//! \brief Provides class member functions to access SimpleKeyingInterface constants
//! \tparam BASE a SimpleKeyingInterface derived class
//! \tparam INFO a SimpleKeyingInterface derived class
//! \sa SimpleKeyingInterface
template <class BASE, class INFO = BASE>
class CRYPTOPP_NO_VTABLE SimpleKeyingInterfaceImpl : public BASE
{
public:
//! \brief The minimum key length used by the cipher
//! \brief The minimum key length used by the algorithm
//! \returns minimum key length used by the algorithm, in bytes
size_t MinKeyLength() const
{return INFO::MIN_KEYLENGTH;}
//! \brief The maximum key length used by the cipher
//! \brief The maximum key length used by the algorithm
//! \returns maximum key length used by the algorithm, in bytes
size_t MaxKeyLength() const
{return (size_t)INFO::MAX_KEYLENGTH;}
//! \brief The default key length used by the cipher
//! \brief The default key length used by the algorithm
//! \returns default key length used by the algorithm, in bytes
size_t DefaultKeyLength() const
{return INFO::DEFAULT_KEYLENGTH;}
//! \brief Provides a valid key length for the cipher
//! \brief Provides a valid key length for the algorithm
//! \param keylength the size of the key, in bytes
//! \returns the valid key lenght, in bytes
//! \details keylength is provided in bytes, not bits. If keylength is less than MIN_KEYLENGTH,
//! then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH,
//! then the function returns MAX_KEYLENGTH. if If keylength is a multiple of KEYLENGTH_MULTIPLE,
@ -272,13 +280,13 @@ public:
//! KEYLENGTH_MULTIPLE.
size_t GetValidKeyLength(size_t keylength) const {return INFO::StaticGetValidKeyLength(keylength);}
//! \brief The default IV requirements for the cipher
//! \brief The default IV requirements for the algorithm
//! \details The default value is NOT_RESYNCHRONIZABLE. See IV_Requirement
//! in cryptlib.h for allowed values.
SimpleKeyingInterface::IV_Requirement IVRequirement() const
{return (SimpleKeyingInterface::IV_Requirement)INFO::IV_REQUIREMENT;}
//! \brief The default initialization vector length for the cipher
//! \brief The default initialization vector length for the algorithm
//! \details IVSize is provided in bytes, not bits. The default implementation uses IV_LENGTH, which is 0.
unsigned int IVSize() const
{return INFO::IV_LENGTH;}
@ -292,8 +300,8 @@ template <class INFO, class BASE = BlockCipher>
class CRYPTOPP_NO_VTABLE BlockCipherImpl : public AlgorithmImpl<SimpleKeyingInterfaceImpl<TwoBases<BASE, INFO> > >
{
public:
//! Provides the block size of the cipher
//! \returns the block size of the cipher, in bytes
//! Provides the block size of the algorithm
//! \returns the block size of the algorithm, in bytes
unsigned int BlockSize() const {return this->BLOCKSIZE;}
};
@ -360,13 +368,13 @@ public:
//! \details The message authentication code is not keyed.
MessageAuthenticationCodeFinal() {}
//! \brief Construct a BlockCipherFinal
//! \param key a byte array used to key the cipher
//! \param key a byte array used to key the algorithm
//! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
//! SimpleKeyingInterface::SetKey.
MessageAuthenticationCodeFinal(const byte *key)
{this->SetKey(key, this->DEFAULT_KEYLENGTH);}
//! \brief Construct a BlockCipherFinal
//! \param key a byte array used to key the cipher
//! \param key a byte array used to key the algorithm
//! \param length the length of the byte array
//! \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
//! SimpleKeyingInterface::SetKey.

7
seed.h

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class SEED_Info
//! \brief SEED block cipher information
struct SEED_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, public FixedRounds<16>
{
static const char *StaticAlgorithmName() {return "SEED";}
};
/// <a href="http://www.cryptolounge.org/wiki/SEED">SEED</a>
//! \class SEED
//! \brief SEED block cipher
//! \sa <a href="http://www.cryptolounge.org/wiki/SEED">SEED</a>
class SEED : public SEED_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SEED_Info>

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class Serpent_Info
//! \brief Serpent block cipher information
struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, public FixedRounds<32>
{
static const char *StaticAlgorithmName() {return "Serpent";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Serpent">Serpent</a>
//! \class Serpent
//! \brief Serpent block cipher
/// \sa <a href="http://www.weidai.com/scan-mirror/cs.html#Serpent">Serpent</a>
class Serpent : public Serpent_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Serpent_Info>

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class SHACAL2_Info
//! \brief SHACAL2 block cipher information
struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
{
static const char *StaticAlgorithmName() {return "SHACAL-2";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SHACAL-2">SHACAL-2</a>
//! \class SHACAL2
//! \brief SHACAL2 block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SHACAL-2">SHACAL-2</a>
class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>

@ -12,12 +12,15 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class SHARK_Info
//! \brief SHARK block cipher information
struct SHARK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 16>, public VariableRounds<6, 2>
{
static const char *StaticAlgorithmName() {return "SHARK-E";}
};
//! \class SHARK
//! \brief SHARK block cipher
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SHARK-E">SHARK-E</a>
class SHARK : public SHARK_Info, public BlockCipherDocumentation
{

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class SKIPJACK_Info
//! \brief SKIPJACK block cipher information
struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
{
CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "SKIPJACK";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
//! \class SKIPJACK
//! \brief SKIPJACK block cipher information
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation
{
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class Square_Info
//! \brief Square block cipher information
struct Square_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, FixedRounds<8>
{
static const char *StaticAlgorithmName() {return "Square";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Square">Square</a>
//! \class Square
//! \brief Square block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#Square">Square</a>
class Square : public Square_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Square_Info>

23
tea.h

@ -12,13 +12,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class TEA_Info
//! \brief TEA block cipher information
struct TEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32>
{
static const char *StaticAlgorithmName() {return "TEA";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#TEA">TEA</a>
//! \class TEA
//! \brief TEA block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#TEA">TEA</a>
class TEA : public TEA_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<TEA_Info>
@ -51,13 +54,16 @@ public:
typedef TEA::Encryption TEAEncryption;
typedef TEA::Decryption TEADecryption;
//! _
//! \class XTEA_Info
//! \brief XTEA block cipher information
struct XTEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32>
{
static const char *StaticAlgorithmName() {return "XTEA";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#TEA">XTEA</a>
//! \class XTEA
//! \brief XTEA block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#TEA">XTEA</a>
class XTEA : public XTEA_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<XTEA_Info>
@ -87,14 +93,17 @@ public:
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
};
//! _
//! \class BTEA_Info
//! \brief BTEA block cipher information
struct BTEA_Info : public FixedKeyLength<16>
{
static const char *StaticAlgorithmName() {return "BTEA";}
};
//! <a href="http://www.weidai.com/scan-mirror/cs.html#TEA">corrected Block TEA</a> (as described in "xxtea").
/*! This class hasn't been tested yet. */
//! \class BTEA
//! \brief BTEA block cipher
//! \details Corrected Block TEA as described in "xxtea". This class hasn't been tested yet.
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#TEA">Corrected Block TEA</a>.
class BTEA : public BTEA_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BlockCipher, BTEA_Info>, BTEA_Info>, public BTEA_Info

@ -11,13 +11,16 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
//! \class Twofish_Info
//! \brief Twofish block cipher information
struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, FixedRounds<16>
{
static const char *StaticAlgorithmName() {return "Twofish";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Twofish">Twofish</a>
//! \class Twofish
//! \brief Twofish block cipher
//~ \sa <a href="http://www.weidai.com/scan-mirror/cs.html#Twofish">Twofish</a>
class Twofish : public Twofish_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Twofish_Info>