From 5fa8124f5156963e798f5cffa812cb9910e4e8de Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 10 Jul 2003 04:34:23 +0000 Subject: merge in 5.0.4 changes (exclude DES and SHA-2 from DLL), attempt (failed) to build DLL with GCC git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@90 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- des.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'des.h') diff --git a/des.h b/des.h index a6c5672..e39b161 100644 --- a/des.h +++ b/des.h @@ -9,9 +9,22 @@ NAMESPACE_BEGIN(CryptoPP) +class CRYPTOPP_DLL RawDES +{ +public: + void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length = 8); + void RawProcessBlock(word32 &l, word32 &r) const; + +protected: + static const word32 Spbox[8][64]; + + FixedSizeSecBlock k; +}; + struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8> { - CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "DES";} + // disable DES in DLL version by not exporting this function + static const char * StaticAlgorithmName() {return "DES";} }; /// DES @@ -21,19 +34,10 @@ struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8> check or correct the parity bits if you wish. */ class DES : public DES_Info, public BlockCipherDocumentation { - class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl + class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl, public RawDES { public: - void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length = 8); void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; - - // exposed for faster Triple-DES - void RawProcessBlock(word32 &l, word32 &r) const; - - protected: - static const word32 Spbox[8][64]; - - FixedSizeSecBlock k; }; public: @@ -61,7 +65,7 @@ class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; protected: - DES::Encryption m_des1, m_des2; + RawDES m_des1, m_des2; }; public: @@ -84,7 +88,7 @@ class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const; protected: - DES::Encryption m_des1, m_des2, m_des3; + RawDES m_des1, m_des2, m_des3; }; public: -- cgit v1.2.1