summaryrefslogtreecommitdiff
path: root/des.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-07-10 04:34:23 +0000
committerweidai <weidai11@users.noreply.github.com>2003-07-10 04:34:23 +0000
commit473e5df89b35dc376d50f3e53acb1df7ba93c853 (patch)
treece43a3a2973d29a78e6b401f7a4a367e914f5490 /des.h
parent699e6219b54bb310b0e6b6e719df4dce70c20060 (diff)
downloadcryptopp-git-473e5df89b35dc376d50f3e53acb1df7ba93c853.tar.gz
merge in 5.0.4 changes (exclude DES and SHA-2 from DLL),
attempt (failed) to build DLL with GCC
Diffstat (limited to 'des.h')
-rw-r--r--des.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/des.h b/des.h
index a6c56727..e39b1619 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<word32, 32> 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";}
};
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DES">DES</a>
@@ -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<DES_Info>
+ class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_Info>, 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<word32, 32> 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: