aboutsummaryrefslogtreecommitdiffstats
path: root/include/des.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-21 15:53:32 +0000
committerlloyd <[email protected]>2008-04-21 15:53:32 +0000
commit90224856d6cc454eba6d5eacf4439b2d732acd65 (patch)
tree284a7afe5ede70c79878dad222891fa155f60512 /include/des.h
parent272a8523e3c19e1c297b335a316a335db6c7128d (diff)
Add BOTAN_DLL macro in all needed spots for working DLL export. Based
on a patch from Joel Low for MSVC, modified and tested with GCC using -fvisibility=hidden and the visibility attribute. Getting this working completely requires making the shared object and static lib builds completely distinct (which is also a win since it allows avoiding -fPIC usage, etc in the static lib). Currently too many things are being exported, though it is an improvement as internal-only code like the bigint_* functions are hidden.
Diffstat (limited to 'include/des.h')
-rw-r--r--include/des.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/des.h b/include/des.h
index f07d4c049..3e53a6166 100644
--- a/include/des.h
+++ b/include/des.h
@@ -13,7 +13,7 @@ namespace Botan {
/*************************************************
* DES *
*************************************************/
-class DES : public BlockCipher
+class BOTAN_DLL DES : public BlockCipher
{
public:
void clear() throw() { round_key.clear(); }
@@ -32,9 +32,19 @@ class DES : public BlockCipher
static void IP(u32bit&, u32bit&);
static void FP(u32bit&, u32bit&);
- static const u32bit SPBOX1[256], SPBOX2[256], SPBOX3[256], SPBOX4[256],
- SPBOX5[256], SPBOX6[256], SPBOX7[256], SPBOX8[256];
- static const u64bit IPTAB1[256], IPTAB2[256], FPTAB1[256], FPTAB2[256];
+ static const u32bit SPBOX1[256];
+ static const u32bit SPBOX2[256];
+ static const u32bit SPBOX3[256];
+ static const u32bit SPBOX4[256];
+ static const u32bit SPBOX5[256];
+ static const u32bit SPBOX6[256];
+ static const u32bit SPBOX7[256];
+ static const u32bit SPBOX8[256];
+
+ static const u64bit IPTAB1[256];
+ static const u64bit IPTAB2[256];
+ static const u64bit FPTAB1[256];
+ static const u64bit FPTAB2[256];
SecureBuffer<u32bit, 32> round_key;
};
@@ -42,7 +52,7 @@ class DES : public BlockCipher
/*************************************************
* Triple DES *
*************************************************/
-class TripleDES : public BlockCipher
+class BOTAN_DLL TripleDES : public BlockCipher
{
public:
void clear() throw() { des1.clear(); des2.clear(); des3.clear(); }
@@ -59,7 +69,7 @@ class TripleDES : public BlockCipher
/*************************************************
* DESX *
*************************************************/
-class DESX : public BlockCipher
+class BOTAN_DLL DESX : public BlockCipher
{
public:
void clear() throw() { des.clear(); K1.clear(); K2.clear(); }