Additional documentation

pull/84/head
Jeffrey Walton 2015-12-13 23:02:23 -05:00
parent 89c324ad92
commit 5a28b8e184
1 changed files with 25 additions and 12 deletions

37
des.h
View File

@ -11,6 +11,8 @@
NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(CryptoPP)
//! \class RawDES
//! \brief DES block cipher base class
class CRYPTOPP_DLL RawDES class CRYPTOPP_DLL RawDES
{ {
public: public:
@ -23,18 +25,20 @@ protected:
FixedSizeSecBlock<word32, 32> k; FixedSizeSecBlock<word32, 32> k;
}; };
//! _ //! \class DES_Info
//! \brief DES block cipher information
struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8> struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8>
{ {
// disable DES in DLL version by not exporting this function // disable DES in DLL version by not exporting this function
static const char * StaticAlgorithmName() {return "DES";} static const char * StaticAlgorithmName() {return "DES";}
}; };
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DES">DES</a> //! \class DES
/*! The DES implementation in Crypto++ ignores the parity bits //! \brief DES block cipher
(the least significant bits of each byte) in the key. However //! \details The DES implementation in Crypto++ ignores the parity bits
you can use CheckKeyParityBits() and CorrectKeyParityBits() to //! (the least significant bits of each byte) in the key. However you can use CheckKeyParityBits()
check or correct the parity bits if you wish. */ //! and CorrectKeyParityBits() to check or correct the parity bits if you wish.
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DES">DES</a>
class DES : public DES_Info, public BlockCipherDocumentation class DES : public DES_Info, public BlockCipherDocumentation
{ {
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_Info>, public RawDES class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_Info>, public RawDES
@ -54,13 +58,16 @@ public:
typedef BlockCipherFinal<DECRYPTION, Base> Decryption; typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
}; };
//! _ //! \class DES_EDE2_Info
//! \brief 2-key TripleDES block cipher information
struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16> struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16>
{ {
CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE2";} CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE2";}
}; };
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE2</a> //! \class DES_EDE2
//! \brief 2-key TripleDES block cipher
/// \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE2</a>
class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation
{ {
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE2_Info> class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE2_Info>
@ -78,13 +85,16 @@ public:
typedef BlockCipherFinal<DECRYPTION, Base> Decryption; typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
}; };
//! _ //! \class DES_EDE3_Info
//! \brief 3-key TripleDES block cipher information
struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
{ {
CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE3";} CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE3";}
}; };
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE3</a> //! \class DES_EDE3
//! \brief 3-key TripleDES block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE3</a>
class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation
{ {
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE3_Info> class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE3_Info>
@ -102,13 +112,16 @@ public:
typedef BlockCipherFinal<DECRYPTION, Base> Decryption; typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
}; };
//! _ //! \class DES_XEX3_Info
//! \brief DESX block cipher information
struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
{ {
static const char *StaticAlgorithmName() {return "DES-XEX3";} static const char *StaticAlgorithmName() {return "DES-XEX3";}
}; };
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESX">DES-XEX3</a>, AKA DESX //! \class DES_XEX3
//! \brief DESX block cipher
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#DESX">DES-XEX3</a>, AKA DESX
class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation
{ {
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_XEX3_Info> class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_XEX3_Info>