diff options
author | lloyd <[email protected]> | 2008-04-21 15:53:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-04-21 15:53:32 +0000 |
commit | 90224856d6cc454eba6d5eacf4439b2d732acd65 (patch) | |
tree | 284a7afe5ede70c79878dad222891fa155f60512 /include | |
parent | 272a8523e3c19e1c297b335a316a335db6c7128d (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')
152 files changed, 562 insertions, 486 deletions
diff --git a/include/adler32.h b/include/adler32.h index e2071ad1c..1abce690c 100644 --- a/include/adler32.h +++ b/include/adler32.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Adler32 * *************************************************/ -class Adler32 : public HashFunction +class BOTAN_DLL Adler32 : public HashFunction { public: void clear() throw() { S1 = 1; S2 = 0; } diff --git a/include/aes.h b/include/aes.h index 6e336f026..5b43735ad 100644 --- a/include/aes.h +++ b/include/aes.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * AES * *************************************************/ -class AES : public BlockCipher +class BOTAN_DLL AES : public BlockCipher { public: void clear() throw(); @@ -26,8 +26,11 @@ class AES : public BlockCipher void dec(const byte[], byte[]) const; void key(const byte[], u32bit); static u32bit S(u32bit); - static const byte SE[256], SD[256]; - static const u32bit TE[1024], TD[1024]; + + static const byte SE[256]; + static const byte SD[256]; + static const u32bit TE[1024]; + static const u32bit TD[1024]; SecureBuffer<u32bit, 52> EK, DK; SecureBuffer<byte, 32> ME, MD; u32bit ROUNDS; @@ -36,7 +39,7 @@ class AES : public BlockCipher /************************************************* * AES-128 * *************************************************/ -class AES_128 : public AES +class BOTAN_DLL AES_128 : public AES { public: std::string name() const { return "AES-128"; } @@ -47,7 +50,7 @@ class AES_128 : public AES /************************************************* * AES-192 * *************************************************/ -class AES_192 : public AES +class BOTAN_DLL AES_192 : public AES { public: std::string name() const { return "AES-192"; } @@ -58,7 +61,7 @@ class AES_192 : public AES /************************************************* * AES-256 * *************************************************/ -class AES_256 : public AES +class BOTAN_DLL AES_256 : public AES { public: std::string name() const { return "AES-256"; } diff --git a/include/alg_id.h b/include/alg_id.h index ffa311a35..8023beead 100644 --- a/include/alg_id.h +++ b/include/alg_id.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Algorithm Identifier * *************************************************/ -class AlgorithmIdentifier : public ASN1_Object +class BOTAN_DLL AlgorithmIdentifier : public ASN1_Object { public: enum Encoding_Option { USE_NULL_PARAM }; diff --git a/include/allocate.h b/include/allocate.h index 350858f42..efbb77291 100644 --- a/include/allocate.h +++ b/include/allocate.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Allocator Interface * *************************************************/ -class Allocator +class BOTAN_DLL Allocator { public: static Allocator* get(bool); diff --git a/include/arc4.h b/include/arc4.h index 39582dda8..c99691484 100644 --- a/include/arc4.h +++ b/include/arc4.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * ARC4 * *************************************************/ -class ARC4 : public StreamCipher +class BOTAN_DLL ARC4 : public StreamCipher { public: void clear() throw(); diff --git a/include/asn1_int.h b/include/asn1_int.h index 0206a5196..e6c3819c6 100644 --- a/include/asn1_int.h +++ b/include/asn1_int.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Basic ASN.1 Object Interface * *************************************************/ -class ASN1_Object +class BOTAN_DLL ASN1_Object { public: virtual void encode_into(class DER_Encoder&) const = 0; @@ -26,7 +26,7 @@ class ASN1_Object /************************************************* * BER Encoded Object * *************************************************/ -class BER_Object +class BOTAN_DLL BER_Object { public: void assert_is_a(ASN1_Tag, ASN1_Tag); diff --git a/include/asn1_obj.h b/include/asn1_obj.h index d7ff332c9..a2eb5fd45 100644 --- a/include/asn1_obj.h +++ b/include/asn1_obj.h @@ -18,7 +18,7 @@ namespace Botan { /************************************************* * Attribute * *************************************************/ -class Attribute : public ASN1_Object +class BOTAN_DLL Attribute : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -35,7 +35,7 @@ class Attribute : public ASN1_Object /************************************************* * X.509 Time * *************************************************/ -class X509_Time : public ASN1_Object +class BOTAN_DLL X509_Time : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -62,7 +62,7 @@ class X509_Time : public ASN1_Object /************************************************* * Simple String * *************************************************/ -class ASN1_String : public ASN1_Object +class BOTAN_DLL ASN1_String : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -83,7 +83,7 @@ class ASN1_String : public ASN1_Object /************************************************* * Distinguished Name * *************************************************/ -class X509_DN : public ASN1_Object +class BOTAN_DLL X509_DN : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -113,7 +113,7 @@ class X509_DN : public ASN1_Object /************************************************* * Alternative Name * *************************************************/ -class AlternativeName : public ASN1_Object +class BOTAN_DLL AlternativeName : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -139,24 +139,26 @@ class AlternativeName : public ASN1_Object /************************************************* * Comparison Operations * *************************************************/ -bool operator==(const AlgorithmIdentifier&, const AlgorithmIdentifier&); -bool operator!=(const AlgorithmIdentifier&, const AlgorithmIdentifier&); +bool BOTAN_DLL operator==(const AlgorithmIdentifier&, + const AlgorithmIdentifier&); +bool BOTAN_DLL operator!=(const AlgorithmIdentifier&, + const AlgorithmIdentifier&); -bool operator==(const X509_Time&, const X509_Time&); -bool operator!=(const X509_Time&, const X509_Time&); -bool operator<=(const X509_Time&, const X509_Time&); -bool operator>=(const X509_Time&, const X509_Time&); +bool BOTAN_DLL operator==(const X509_Time&, const X509_Time&); +bool BOTAN_DLL operator!=(const X509_Time&, const X509_Time&); +bool BOTAN_DLL operator<=(const X509_Time&, const X509_Time&); +bool BOTAN_DLL operator>=(const X509_Time&, const X509_Time&); -bool operator==(const X509_DN&, const X509_DN&); -bool operator!=(const X509_DN&, const X509_DN&); -bool operator<(const X509_DN&, const X509_DN&); +bool BOTAN_DLL operator==(const X509_DN&, const X509_DN&); +bool BOTAN_DLL operator!=(const X509_DN&, const X509_DN&); +bool BOTAN_DLL operator<(const X509_DN&, const X509_DN&); /************************************************* * Helper Functions * *************************************************/ -s32bit validity_check(const X509_Time&, const X509_Time&, u64bit); +s32bit BOTAN_DLL validity_check(const X509_Time&, const X509_Time&, u64bit); -bool is_string_type(ASN1_Tag); +bool BOTAN_DLL is_string_type(ASN1_Tag); } diff --git a/include/asn1_oid.h b/include/asn1_oid.h index 92dbbecc0..73d0079a8 100644 --- a/include/asn1_oid.h +++ b/include/asn1_oid.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * ASN.1 Object Identifier * *************************************************/ -class OID : public ASN1_Object +class BOTAN_DLL OID : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -37,13 +37,13 @@ class OID : public ASN1_Object /************************************************* * Append another component onto the OID * *************************************************/ -OID operator+(const OID&, u32bit); +OID BOTAN_DLL operator+(const OID&, u32bit); /************************************************* * Compare two OIDs * *************************************************/ -bool operator!=(const OID&, const OID&); -bool operator<(const OID&, const OID&); +bool BOTAN_DLL operator!=(const OID&, const OID&); +bool BOTAN_DLL operator<(const OID&, const OID&); } diff --git a/include/base.h b/include/base.h index c766df0e0..dfad3491b 100644 --- a/include/base.h +++ b/include/base.h @@ -19,7 +19,7 @@ static const u32bit DEFAULT_BUFFERSIZE = BOTAN_DEFAULT_BUFFER_SIZE; /************************************************* * Symmetric Algorithm * *************************************************/ -class SymmetricAlgorithm +class BOTAN_DLL SymmetricAlgorithm { public: const u32bit MAXIMUM_KEYLENGTH, MINIMUM_KEYLENGTH, KEYLENGTH_MULTIPLE; @@ -38,7 +38,7 @@ class SymmetricAlgorithm /************************************************* * Block Cipher * *************************************************/ -class BlockCipher : public SymmetricAlgorithm +class BOTAN_DLL BlockCipher : public SymmetricAlgorithm { public: const u32bit BLOCK_SIZE; @@ -61,7 +61,7 @@ class BlockCipher : public SymmetricAlgorithm /************************************************* * Stream Cipher * *************************************************/ -class StreamCipher : public SymmetricAlgorithm +class BOTAN_DLL StreamCipher : public SymmetricAlgorithm { public: const u32bit IV_LENGTH; @@ -85,7 +85,7 @@ class StreamCipher : public SymmetricAlgorithm /************************************************* * Buffered Computation * *************************************************/ -class BufferedComputation +class BOTAN_DLL BufferedComputation { public: const u32bit OUTPUT_LENGTH; @@ -108,7 +108,7 @@ class BufferedComputation /************************************************* * Hash Function * *************************************************/ -class HashFunction : public BufferedComputation +class BOTAN_DLL HashFunction : public BufferedComputation { public: const u32bit HASH_BLOCK_SIZE; @@ -124,7 +124,7 @@ class HashFunction : public BufferedComputation /************************************************* * Message Authentication Code * *************************************************/ -class MessageAuthenticationCode : public BufferedComputation, +class BOTAN_DLL MessageAuthenticationCode : public BufferedComputation, public SymmetricAlgorithm { public: @@ -141,7 +141,7 @@ class MessageAuthenticationCode : public BufferedComputation, /************************************************* * Entropy Source * *************************************************/ -class EntropySource +class BOTAN_DLL EntropySource { public: virtual u32bit slow_poll(byte[], u32bit) = 0; @@ -152,7 +152,7 @@ class EntropySource /************************************************* * Random Number Generator * *************************************************/ -class RandomNumberGenerator +class BOTAN_DLL RandomNumberGenerator { public: virtual void randomize(byte[], u32bit) throw(PRNG_Unseeded) = 0; diff --git a/include/base64.h b/include/base64.h index c0bbff0d1..0003875a6 100644 --- a/include/base64.h +++ b/include/base64.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Base64 Encoder * *************************************************/ -class Base64_Encoder : public Filter +class BOTAN_DLL Base64_Encoder : public Filter { public: static void encode(const byte[3], byte[4]); @@ -36,7 +36,7 @@ class Base64_Encoder : public Filter /************************************************* * Base64 Decoder * *************************************************/ -class Base64_Decoder : public Filter +class BOTAN_DLL Base64_Decoder : public Filter { public: static void decode(const byte[4], byte[3]); diff --git a/include/basefilt.h b/include/basefilt.h index d8df06f4f..d6c5b1e0b 100644 --- a/include/basefilt.h +++ b/include/basefilt.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Chain * *************************************************/ -class Chain : public Fanout_Filter +class BOTAN_DLL Chain : public Fanout_Filter { public: void write(const byte input[], u32bit length) { send(input, length); } @@ -25,7 +25,7 @@ class Chain : public Fanout_Filter /************************************************* * Fork * *************************************************/ -class Fork : public Fanout_Filter +class BOTAN_DLL Fork : public Fanout_Filter { public: void write(const byte input[], u32bit length) { send(input, length); } @@ -38,7 +38,7 @@ class Fork : public Fanout_Filter /************************************************* * Keyed Filter * *************************************************/ -class Keyed_Filter : public Filter +class BOTAN_DLL Keyed_Filter : public Filter { public: virtual void set_key(const SymmetricKey&); diff --git a/include/ber_dec.h b/include/ber_dec.h index 6eeaffc63..890af67a2 100644 --- a/include/ber_dec.h +++ b/include/ber_dec.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * BER Decoding Object * *************************************************/ -class BER_Decoder +class BOTAN_DLL BER_Decoder { public: BER_Object get_next_object(); @@ -120,7 +120,7 @@ BER_Decoder& BER_Decoder::decode_list(std::vector<T>& vec, bool clear_it) *************************************************/ namespace BER { -void decode(BER_Decoder&, Key_Constraints&); +void BOTAN_DLL decode(BER_Decoder&, Key_Constraints&); } diff --git a/include/bigint.h b/include/bigint.h index 04d8001b4..36abbb388 100644 --- a/include/bigint.h +++ b/include/bigint.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * BigInt * *************************************************/ -class BigInt +class BOTAN_DLL BigInt { public: enum Base { Octal = 8, Decimal = 10, Hexadecimal = 16, Binary = 256 }; @@ -113,14 +113,14 @@ class BigInt /************************************************* * Arithmetic Operators * *************************************************/ -BigInt operator+(const BigInt&, const BigInt&); -BigInt operator-(const BigInt&, const BigInt&); -BigInt operator*(const BigInt&, const BigInt&); -BigInt operator/(const BigInt&, const BigInt&); -BigInt operator%(const BigInt&, const BigInt&); -word operator%(const BigInt&, word); -BigInt operator<<(const BigInt&, u32bit); -BigInt operator>>(const BigInt&, u32bit); +BigInt BOTAN_DLL operator+(const BigInt&, const BigInt&); +BigInt BOTAN_DLL operator-(const BigInt&, const BigInt&); +BigInt BOTAN_DLL operator*(const BigInt&, const BigInt&); +BigInt BOTAN_DLL operator/(const BigInt&, const BigInt&); +BigInt BOTAN_DLL operator%(const BigInt&, const BigInt&); +word BOTAN_DLL operator%(const BigInt&, word); +BigInt BOTAN_DLL operator<<(const BigInt&, u32bit); +BigInt BOTAN_DLL operator>>(const BigInt&, u32bit); /************************************************* * Comparison Operators * @@ -141,8 +141,8 @@ inline bool operator>(const BigInt& a, const BigInt& b) /************************************************* * I/O Operators * *************************************************/ -std::ostream& operator<<(std::ostream&, const BigInt&); -std::istream& operator>>(std::istream&, BigInt&); +BOTAN_DLL std::ostream& operator<<(std::ostream&, const BigInt&); +BOTAN_DLL std::istream& operator>>(std::istream&, BigInt&); } diff --git a/include/blinding.h b/include/blinding.h index 49e0ee61b..958686fb1 100644 --- a/include/blinding.h +++ b/include/blinding.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Blinding Function Object * *************************************************/ -class Blinder +class BOTAN_DLL Blinder { public: BigInt blind(const BigInt&) const; diff --git a/include/blowfish.h b/include/blowfish.h index 4541a716c..b331e7baa 100644 --- a/include/blowfish.h +++ b/include/blowfish.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Blowfish * *************************************************/ -class Blowfish : public BlockCipher +class BOTAN_DLL Blowfish : public BlockCipher { public: void clear() throw(); @@ -26,7 +26,8 @@ class Blowfish : public BlockCipher void key(const byte[], u32bit); void generate_sbox(u32bit[], u32bit, u32bit&, u32bit&) const; - static const u32bit PBOX[18], SBOX[1024]; + static const u32bit PBOX[18]; + static const u32bit SBOX[1024]; SecureBuffer<u32bit, 256> S1, S2, S3, S4; SecureBuffer<u32bit, 18> P; diff --git a/include/buf_es.h b/include/buf_es.h index 516866c79..249adcb27 100644 --- a/include/buf_es.h +++ b/include/buf_es.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Buffered EntropySource * *************************************************/ -class Buffered_EntropySource : public EntropySource +class BOTAN_DLL Buffered_EntropySource : public EntropySource { public: u32bit slow_poll(byte[], u32bit); diff --git a/include/buf_filt.h b/include/buf_filt.h index 4e55d4d52..290c7eb75 100644 --- a/include/buf_filt.h +++ b/include/buf_filt.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Buffering Filter * *************************************************/ -class Buffering_Filter : public Filter +class BOTAN_DLL Buffering_Filter : public Filter { public: void write(const byte[], u32bit); diff --git a/include/cast128.h b/include/cast128.h index 58fc62c8b..0a7c53864 100644 --- a/include/cast128.h +++ b/include/cast128.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CAST-128 * *************************************************/ -class CAST_128 : public BlockCipher +class BOTAN_DLL CAST_128 : public BlockCipher { public: void clear() throw() { MK.clear(); RK.clear(); } @@ -27,7 +27,10 @@ class CAST_128 : public BlockCipher static void key_schedule(u32bit[16], u32bit[4]); - static const u32bit S5[256], S6[256], S7[256], S8[256]; + static const u32bit S5[256]; + static const u32bit S6[256]; + static const u32bit S7[256]; + static const u32bit S8[256]; SecureBuffer<u32bit, 16> MK, RK; }; diff --git a/include/cast256.h b/include/cast256.h index 85a844d04..d4b7c6b18 100644 --- a/include/cast256.h +++ b/include/cast256.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CAST-256 * *************************************************/ -class CAST_256 : public BlockCipher +class BOTAN_DLL CAST_256 : public BlockCipher { public: void clear() throw() { MK.clear(); RK.clear(); } diff --git a/include/cbc.h b/include/cbc.h index 38afe5426..a0a30f90f 100644 --- a/include/cbc.h +++ b/include/cbc.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * CBC Encryption * *************************************************/ -class CBC_Encryption : public BlockCipherMode +class BOTAN_DLL CBC_Encryption : public BlockCipherMode { public: CBC_Encryption(const std::string&, const std::string&); @@ -30,7 +30,7 @@ class CBC_Encryption : public BlockCipherMode /************************************************* * CBC Decryption * *************************************************/ -class CBC_Decryption : public BlockCipherMode +class BOTAN_DLL CBC_Decryption : public BlockCipherMode { public: CBC_Decryption(const std::string&, const std::string&); diff --git a/include/cbc_mac.h b/include/cbc_mac.h index 2ec9b1645..a5646d07a 100644 --- a/include/cbc_mac.h +++ b/include/cbc_mac.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CBC-MAC * *************************************************/ -class CBC_MAC : public MessageAuthenticationCode +class BOTAN_DLL CBC_MAC : public MessageAuthenticationCode { public: void clear() throw(); diff --git a/include/certstor.h b/include/certstor.h index ac5ea9236..ca0480496 100644 --- a/include/certstor.h +++ b/include/certstor.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Certificate Store Interface * *************************************************/ -class Certificate_Store +class BOTAN_DLL Certificate_Store { public: virtual std::vector<X509_Certificate> diff --git a/include/cfb.h b/include/cfb.h index caa4789c5..e8133bcf4 100644 --- a/include/cfb.h +++ b/include/cfb.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CFB Encryption * *************************************************/ -class CFB_Encryption : public BlockCipherMode +class BOTAN_DLL CFB_Encryption : public BlockCipherMode { public: CFB_Encryption(const std::string&, u32bit = 0); @@ -28,7 +28,7 @@ class CFB_Encryption : public BlockCipherMode /************************************************* * CFB Decryption * *************************************************/ -class CFB_Decryption : public BlockCipherMode +class BOTAN_DLL CFB_Decryption : public BlockCipherMode { public: CFB_Decryption(const std::string&, u32bit = 0); diff --git a/include/charset.h b/include/charset.h index 9c2be4c07..d585bf0ed 100644 --- a/include/charset.h +++ b/include/charset.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Character Set Transcoder Interface * *************************************************/ -class Charset_Transcoder +class BOTAN_DLL Charset_Transcoder { public: virtual std::string transcode(const std::string&, diff --git a/include/cmac.h b/include/cmac.h index bc0e00a73..de3f8b87a 100644 --- a/include/cmac.h +++ b/include/cmac.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CMAC * *************************************************/ -class CMAC : public MessageAuthenticationCode +class BOTAN_DLL CMAC : public MessageAuthenticationCode { public: void clear() throw(); diff --git a/include/config.h b/include/config.h index 86344cc86..7ef873e8f 100644 --- a/include/config.h +++ b/include/config.h @@ -17,7 +17,7 @@ namespace Botan { /************************************************* * Library Configuration Settings * *************************************************/ -class Config +class BOTAN_DLL Config { public: Config(); @@ -53,7 +53,7 @@ class Config /************************************************* * Hook for the global config * *************************************************/ -Config& global_config(); +BOTAN_DLL Config& global_config(); } diff --git a/include/crc24.h b/include/crc24.h index 82a6b6156..919f860ce 100644 --- a/include/crc24.h +++ b/include/crc24.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CRC24 * *************************************************/ -class CRC24 : public HashFunction +class BOTAN_DLL CRC24 : public HashFunction { public: void clear() throw() { crc = 0xB704CE; } diff --git a/include/crc32.h b/include/crc32.h index a8467044f..51939c6e1 100644 --- a/include/crc32.h +++ b/include/crc32.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CRC32 * *************************************************/ -class CRC32 : public HashFunction +class BOTAN_DLL CRC32 : public HashFunction { public: void clear() throw() { crc = 0xFFFFFFFF; } diff --git a/include/crl_ent.h b/include/crl_ent.h index 8cee60736..05a9338b3 100644 --- a/include/crl_ent.h +++ b/include/crl_ent.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CRL Entry * *************************************************/ -class CRL_Entry : public ASN1_Object +class BOTAN_DLL CRL_Entry : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -35,9 +35,9 @@ class CRL_Entry : public ASN1_Object /************************************************* * Comparison Operations * *************************************************/ -bool operator==(const CRL_Entry&, const CRL_Entry&); -bool operator!=(const CRL_Entry&, const CRL_Entry&); -bool operator<(const CRL_Entry&, const CRL_Entry&); +BOTAN_DLL bool operator==(const CRL_Entry&, const CRL_Entry&); +BOTAN_DLL bool operator!=(const CRL_Entry&, const CRL_Entry&); +BOTAN_DLL bool operator<(const CRL_Entry&, const CRL_Entry&); } diff --git a/include/ctr.h b/include/ctr.h index 073ad57b1..c3217a5d1 100644 --- a/include/ctr.h +++ b/include/ctr.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CTR-BE Mode * *************************************************/ -class CTR_BE : public BlockCipherMode +class BOTAN_DLL CTR_BE : public BlockCipherMode { public: CTR_BE(const std::string&); diff --git a/include/cts.h b/include/cts.h index 2245b2b9d..6a07c4eb2 100644 --- a/include/cts.h +++ b/include/cts.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * CTS Encryption * *************************************************/ -class CTS_Encryption : public BlockCipherMode +class BOTAN_DLL CTS_Encryption : public BlockCipherMode { public: CTS_Encryption(const std::string&); @@ -28,7 +28,7 @@ class CTS_Encryption : public BlockCipherMode /************************************************* * CTS Decryption * *************************************************/ -class CTS_Decryption : public BlockCipherMode +class BOTAN_DLL CTS_Decryption : public BlockCipherMode { public: CTS_Decryption(const std::string&); diff --git a/include/data_snk.h b/include/data_snk.h index f9011ad95..9afe9bc4e 100644 --- a/include/data_snk.h +++ b/include/data_snk.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Generic DataSink Interface * *************************************************/ -class DataSink : public Filter +class BOTAN_DLL DataSink : public Filter { public: bool attachable() { return false; } @@ -28,7 +28,7 @@ class DataSink : public Filter /************************************************* * Stream-Based DataSink * *************************************************/ -class DataSink_Stream : public DataSink +class BOTAN_DLL DataSink_Stream : public DataSink { public: void write(const byte[], u32bit); diff --git a/include/data_src.h b/include/data_src.h index a64141ef9..f7285e8fb 100644 --- a/include/data_src.h +++ b/include/data_src.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Generic DataSource Interface * *************************************************/ -class DataSource +class BOTAN_DLL DataSource { public: virtual u32bit read(byte[], u32bit) = 0; @@ -36,7 +36,7 @@ class DataSource /************************************************* * Memory-Based DataSource * *************************************************/ -class DataSource_Memory : public DataSource +class BOTAN_DLL DataSource_Memory : public DataSource { public: u32bit read(byte[], u32bit); @@ -54,7 +54,7 @@ class DataSource_Memory : public DataSource /************************************************* * Stream-Based DataSource * *************************************************/ -class DataSource_Stream : public DataSource +class BOTAN_DLL DataSource_Stream : public DataSource { public: u32bit read(byte[], u32bit); diff --git a/include/datastor.h b/include/datastor.h index 0f887c08e..0f6029189 100644 --- a/include/datastor.h +++ b/include/datastor.h @@ -17,10 +17,10 @@ namespace Botan { /************************************************* * Data Store * *************************************************/ -class Data_Store +class BOTAN_DLL Data_Store { public: - class Matcher + class BOTAN_DLL Matcher { public: virtual bool operator()(const std::string&, diff --git a/include/def_char.h b/include/def_char.h index 57080bd7f..71c2b975f 100644 --- a/include/def_char.h +++ b/include/def_char.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Default Character Set Transcoder Object * *************************************************/ -class Default_Charset_Transcoder : public Charset_Transcoder +class BOTAN_DLL Default_Charset_Transcoder : public Charset_Transcoder { public: std::string transcode(const std::string&, diff --git a/include/def_powm.h b/include/def_powm.h index 3fc13e6c7..c91ff002c 100644 --- a/include/def_powm.h +++ b/include/def_powm.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Fixed Window Exponentiator * *************************************************/ -class Fixed_Window_Exponentiator : public Modular_Exponentiator +class BOTAN_DLL Fixed_Window_Exponentiator : public Modular_Exponentiator { public: void set_exponent(const BigInt&); @@ -37,7 +37,7 @@ class Fixed_Window_Exponentiator : public Modular_Exponentiator /************************************************* * Montgomery Exponentiator * *************************************************/ -class Montgomery_Exponentiator : public Modular_Exponentiator +class BOTAN_DLL Montgomery_Exponentiator : public Modular_Exponentiator { public: void set_exponent(const BigInt&); diff --git a/include/defalloc.h b/include/defalloc.h index 6d25909ff..f162f5c71 100644 --- a/include/defalloc.h +++ b/include/defalloc.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Malloc Allocator * *************************************************/ -class Malloc_Allocator : public Allocator +class BOTAN_DLL Malloc_Allocator : public Allocator { public: void* allocate(u32bit); @@ -25,7 +25,7 @@ class Malloc_Allocator : public Allocator /************************************************* * Locking Allocator * *************************************************/ -class Locking_Allocator : public Pooling_Allocator +class BOTAN_DLL Locking_Allocator : public Pooling_Allocator { public: std::string type() const { return "locking"; } diff --git a/include/der_enc.h b/include/der_enc.h index 4bdcff4eb..86f33abe2 100644 --- a/include/der_enc.h +++ b/include/der_enc.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * General DER Encoding Object * *************************************************/ -class DER_Encoder +class BOTAN_DLL DER_Encoder { public: SecureVector<byte> get_contents(); 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(); } diff --git a/include/dh.h b/include/dh.h index 735514e6e..c2ee8bd7d 100644 --- a/include/dh.h +++ b/include/dh.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Diffie-Hellman Public Key * *************************************************/ -class DH_PublicKey : public virtual DL_Scheme_PublicKey +class BOTAN_DLL DH_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const { return "DH"; } @@ -33,7 +33,7 @@ class DH_PublicKey : public virtual DL_Scheme_PublicKey /************************************************* * Diffie-Hellman Private Key * *************************************************/ -class DH_PrivateKey : public DH_PublicKey, +class BOTAN_DLL DH_PrivateKey : public DH_PublicKey, public PK_Key_Agreement_Key, public virtual DL_Scheme_PrivateKey { diff --git a/include/dl_algo.h b/include/dl_algo.h index 3ae468cd0..f279d4633 100644 --- a/include/dl_algo.h +++ b/include/dl_algo.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * DL Public Key * *************************************************/ -class DL_Scheme_PublicKey : public virtual Public_Key +class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key { public: bool check_key(bool) const; @@ -39,7 +39,7 @@ class DL_Scheme_PublicKey : public virtual Public_Key /************************************************* * DL Private Key * *************************************************/ -class DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey, +class BOTAN_DLL DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey, public virtual Private_Key { public: diff --git a/include/dl_group.h b/include/dl_group.h index 0dc2dac5f..9fb242070 100644 --- a/include/dl_group.h +++ b/include/dl_group.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Discrete Logarithm Group * *************************************************/ -class DL_Group +class BOTAN_DLL DL_Group { public: const BigInt& get_p() const; diff --git a/include/dlies.h b/include/dlies.h index d2f6b08e5..703f17656 100644 --- a/include/dlies.h +++ b/include/dlies.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * DLIES Encryption * *************************************************/ -class DLIES_Encryptor : public PK_Encryptor +class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor { public: DLIES_Encryptor(const PK_Key_Agreement_Key&, @@ -33,7 +33,7 @@ class DLIES_Encryptor : public PK_Encryptor /************************************************* * DLIES Decryption * *************************************************/ -class DLIES_Decryptor : public PK_Decryptor +class BOTAN_DLL DLIES_Decryptor : public PK_Decryptor { public: DLIES_Decryptor(const PK_Key_Agreement_Key&, diff --git a/include/dsa.h b/include/dsa.h index 542e325b7..1bb501d27 100644 --- a/include/dsa.h +++ b/include/dsa.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * DSA Public Key * *************************************************/ -class DSA_PublicKey : public PK_Verifying_wo_MR_Key, +class BOTAN_DLL DSA_PublicKey : public PK_Verifying_wo_MR_Key, public virtual DL_Scheme_PublicKey { public: @@ -38,7 +38,7 @@ class DSA_PublicKey : public PK_Verifying_wo_MR_Key, /************************************************* * DSA Private Key * *************************************************/ -class DSA_PrivateKey : public DSA_PublicKey, +class BOTAN_DLL DSA_PrivateKey : public DSA_PublicKey, public PK_Signing_Key, public virtual DL_Scheme_PrivateKey { diff --git a/include/eax.h b/include/eax.h index 5840151c5..676e5334e 100644 --- a/include/eax.h +++ b/include/eax.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * EAX Base Class * *************************************************/ -class EAX_Base : public Keyed_Filter +class BOTAN_DLL EAX_Base : public Keyed_Filter { public: void set_key(const SymmetricKey&); @@ -39,7 +39,7 @@ class EAX_Base : public Keyed_Filter /************************************************* * EAX Encryption * *************************************************/ -class EAX_Encryption : public EAX_Base +class BOTAN_DLL EAX_Encryption : public EAX_Base { public: EAX_Encryption(const std::string&, u32bit = 0); @@ -53,7 +53,7 @@ class EAX_Encryption : public EAX_Base /************************************************* * EAX Decryption * *************************************************/ -class EAX_Decryption : public EAX_Base +class BOTAN_DLL EAX_Decryption : public EAX_Base { public: EAX_Decryption(const std::string&, u32bit = 0); diff --git a/include/ecb.h b/include/ecb.h index 6e4a4312a..b730a4fd4 100644 --- a/include/ecb.h +++ b/include/ecb.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * ECB * *************************************************/ -class ECB : public BlockCipherMode +class BOTAN_DLL ECB : public BlockCipherMode { protected: ECB(const std::string&, const std::string&); @@ -27,7 +27,7 @@ class ECB : public BlockCipherMode /************************************************* * ECB Encryption * *************************************************/ -class ECB_Encryption : public ECB +class BOTAN_DLL ECB_Encryption : public ECB { public: ECB_Encryption(const std::string&, const std::string&); @@ -41,7 +41,7 @@ class ECB_Encryption : public ECB /************************************************* * ECB Decryption * *************************************************/ -class ECB_Decryption : public ECB +class BOTAN_DLL ECB_Decryption : public ECB { public: ECB_Decryption(const std::string&, const std::string&); diff --git a/include/elgamal.h b/include/elgamal.h index e5507ef3f..3f39d22a7 100644 --- a/include/elgamal.h +++ b/include/elgamal.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * ElGamal Public Key * *************************************************/ -class ElGamal_PublicKey : public PK_Encrypting_Key, +class BOTAN_DLL ElGamal_PublicKey : public PK_Encrypting_Key, public virtual DL_Scheme_PublicKey { public: @@ -36,7 +36,7 @@ class ElGamal_PublicKey : public PK_Encrypting_Key, /************************************************* * ElGamal Private Key * *************************************************/ -class ElGamal_PrivateKey : public ElGamal_PublicKey, +class BOTAN_DLL ElGamal_PrivateKey : public ElGamal_PublicKey, public PK_Decrypting_Key, public virtual DL_Scheme_PrivateKey { diff --git a/include/eme.h b/include/eme.h index fca4f5009..738ed5e1e 100644 --- a/include/eme.h +++ b/include/eme.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * EME1 * *************************************************/ -class EME1 : public EME +class BOTAN_DLL EME1 : public EME { public: u32bit maximum_input_size(u32bit) const; @@ -31,7 +31,7 @@ class EME1 : public EME /************************************************* * EME_PKCS1v15 * *************************************************/ -class EME_PKCS1v15 : public EME +class BOTAN_DLL EME_PKCS1v15 : public EME { public: u32bit maximum_input_size(u32bit) const; diff --git a/include/emsa.h b/include/emsa.h index 026d3b210..7a9367dc9 100644 --- a/include/emsa.h +++ b/include/emsa.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * EMSA1 * *************************************************/ -class EMSA1 : public EMSA +class BOTAN_DLL EMSA1 : public EMSA { public: EMSA1(const std::string&); @@ -30,7 +30,7 @@ class EMSA1 : public EMSA /************************************************* * EMSA2 * *************************************************/ -class EMSA2 : public EMSA +class BOTAN_DLL EMSA2 : public EMSA { public: EMSA2(const std::string&); @@ -47,7 +47,7 @@ class EMSA2 : public EMSA /************************************************* * EMSA3 * *************************************************/ -class EMSA3 : public EMSA +class BOTAN_DLL EMSA3 : public EMSA { public: EMSA3(const std::string&); @@ -63,7 +63,7 @@ class EMSA3 : public EMSA /************************************************* * EMSA4 * *************************************************/ -class EMSA4 : public EMSA +class BOTAN_DLL EMSA4 : public EMSA { public: EMSA4(const std::string&, const std::string&); @@ -83,7 +83,7 @@ class EMSA4 : public EMSA /************************************************* * EMSA-Raw * *************************************************/ -class EMSA_Raw : public EMSA +class BOTAN_DLL EMSA_Raw : public EMSA { private: void update(const byte[], u32bit); diff --git a/include/eng_def.h b/include/eng_def.h index bfc57941f..95f1fc0f7 100644 --- a/include/eng_def.h +++ b/include/eng_def.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Default Engine * *************************************************/ -class Default_Engine : public Engine +class BOTAN_DLL Default_Engine : public Engine { public: IF_Operation* if_op(const BigInt&, const BigInt&, const BigInt&, diff --git a/include/engine.h b/include/engine.h index 55b76895a..13007e662 100644 --- a/include/engine.h +++ b/include/engine.h @@ -20,11 +20,11 @@ namespace Botan { /************************************************* * Engine Base Class * *************************************************/ -class Engine +class BOTAN_DLL Engine { public: template<typename T> - class Algorithm_Cache + class BOTAN_DLL Algorithm_Cache { public: virtual T* get(const std::string&) const = 0; diff --git a/include/exceptn.h b/include/exceptn.h index 5b0106105..7bf486fa7 100644 --- a/include/exceptn.h +++ b/include/exceptn.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Exception Base Class * *************************************************/ -class Exception : public std::exception +class BOTAN_DLL Exception : public std::exception { public: const char* what() const throw() { return msg.c_str(); } @@ -30,7 +30,7 @@ class Exception : public std::exception /************************************************* * Invalid_Argument Exception * *************************************************/ -struct Invalid_Argument : public Exception +struct BOTAN_DLL Invalid_Argument : public Exception { Invalid_Argument(const std::string& err = "") : Exception(err) {} }; @@ -38,7 +38,7 @@ struct Invalid_Argument : public Exception /************************************************* * Invalid_Key_Length Exception * *************************************************/ -struct Invalid_Key_Length : public Invalid_Argument +struct BOTAN_DLL Invalid_Key_Length : public Invalid_Argument { Invalid_Key_Length(const std::string&, u32bit); }; @@ -46,7 +46,7 @@ struct Invalid_Key_Length : public Invalid_Argument /************************************************* * Invalid_Block_Size Exception * *************************************************/ -struct Invalid_Block_Size : public Invalid_Argument +struct BOTAN_DLL Invalid_Block_Size : public Invalid_Argument { Invalid_Block_Size(const std::string&, const std::string&); }; @@ -54,7 +54,7 @@ struct Invalid_Block_Size : public Invalid_Argument /************************************************* * Invalid_IV_Length Exception * *************************************************/ -struct Invalid_IV_Length : public Invalid_Argument +struct BOTAN_DLL Invalid_IV_Length : public Invalid_Argument { Invalid_IV_Length(const std::string&, u32bit); }; @@ -62,7 +62,7 @@ struct Invalid_IV_Length : public Invalid_Argument /************************************************* * Invalid_State Exception * *************************************************/ -struct Invalid_State : public Exception +struct BOTAN_DLL Invalid_State : public Exception { Invalid_State(const std::string& err) : Exception(err) {} }; @@ -70,7 +70,7 @@ struct Invalid_State : public Exception /************************************************* * PRNG_Unseeded Exception * *************************************************/ -struct PRNG_Unseeded : public Invalid_State +struct BOTAN_DLL PRNG_Unseeded : public Invalid_State { PRNG_Unseeded(const std::string& algo) : Invalid_State("PRNG not seeded: " + algo) {} @@ -79,7 +79,7 @@ struct PRNG_Unseeded : public Invalid_State /************************************************* * Policy_Violation Exception * *************************************************/ -struct Policy_Violation : public Invalid_State +struct BOTAN_DLL Policy_Violation : public Invalid_State { Policy_Violation(const std::string& err) : Invalid_State("Policy violation: " + err) {} @@ -88,7 +88,7 @@ struct Policy_Violation : public Invalid_State /************************************************* * Lookup_Error Exception * *************************************************/ -struct Lookup_Error : public Exception +struct BOTAN_DLL Lookup_Error : public Exception { Lookup_Error(const std::string& err) : Exception(err) {} }; @@ -96,7 +96,7 @@ struct Lookup_Error : public Exception /************************************************* * Algorithm_Not_Found Exception * *************************************************/ -struct Algorithm_Not_Found : public Exception +struct BOTAN_DLL Algorithm_Not_Found : public Exception { Algorithm_Not_Found(const std::string&); }; @@ -104,7 +104,7 @@ struct Algorithm_Not_Found : public Exception /************************************************* * Format_Error Exception * *************************************************/ -struct Format_Error : public Exception +struct BOTAN_DLL Format_Error : public Exception { Format_Error(const std::string& err = "") : Exception(err) {} }; @@ -112,7 +112,7 @@ struct Format_Error : public Exception /************************************************* * Invalid_Algorithm_Name Exception * *************************************************/ -struct Invalid_Algorithm_Name : public Format_Error +struct BOTAN_DLL Invalid_Algorithm_Name : public Format_Error { Invalid_Algorithm_Name(const std::string&); }; @@ -120,7 +120,7 @@ struct Invalid_Algorithm_Name : public Format_Error /************************************************* * Encoding_Error Exception * *************************************************/ -struct Encoding_Error : public Format_Error +struct BOTAN_DLL Encoding_Error : public Format_Error { Encoding_Error(const std::string& name) : Format_Error("Encoding error: " + name) {} @@ -129,7 +129,7 @@ struct Encoding_Error : public Format_Error /************************************************* * Decoding_Error Exception * *************************************************/ -struct Decoding_Error : public Format_Error +struct BOTAN_DLL Decoding_Error : public Format_Error { Decoding_Error(const std::string& name) : Format_Error("Decoding error: " + name) {} @@ -138,7 +138,7 @@ struct Decoding_Error : public Format_Error /************************************************* * Invalid_OID Exception * *************************************************/ -struct Invalid_OID : public Decoding_Error +struct BOTAN_DLL Invalid_OID : public Decoding_Error { Invalid_OID(const std::string& oid) : Decoding_Error("Invalid ASN.1 OID: " + oid) {} @@ -147,7 +147,7 @@ struct Invalid_OID : public Decoding_Error /************************************************* * Stream_IO_Error Exception * *************************************************/ -struct Stream_IO_Error : public Exception +struct BOTAN_DLL Stream_IO_Error : public Exception { Stream_IO_Error(const std::string& err) : Exception("I/O error: " + err) {} @@ -156,7 +156,7 @@ struct Stream_IO_Error : public Exception /************************************************* * Configuration Error Exception * *************************************************/ -struct Config_Error : public Format_Error +struct BOTAN_DLL Config_Error : public Format_Error { Config_Error(const std::string& err) : Format_Error("Config error: " + err) {} @@ -166,7 +166,7 @@ struct Config_Error : public Format_Error /************************************************* * Integrity Failure Exception * *************************************************/ -struct Integrity_Failure : public Exception +struct BOTAN_DLL Integrity_Failure : public Exception { Integrity_Failure(const std::string& err) : Exception("Integrity failure: " + err) {} @@ -175,7 +175,7 @@ struct Integrity_Failure : public Exception /************************************************* * Internal_Error Exception * *************************************************/ -struct Internal_Error : public Exception +struct BOTAN_DLL Internal_Error : public Exception { Internal_Error(const std::string& err) : Exception("Internal error: " + err) {} @@ -184,7 +184,7 @@ struct Internal_Error : public Exception /************************************************* * Self Test Failure Exception * *************************************************/ -struct Self_Test_Failure : public Internal_Error +struct BOTAN_DLL Self_Test_Failure : public Internal_Error { Self_Test_Failure(const std::string& err) : Internal_Error("Self test failed: " + err) {} @@ -193,7 +193,7 @@ struct Self_Test_Failure : public Internal_Error /************************************************* * Memory Allocation Exception * *************************************************/ -struct Memory_Exhaustion : public Exception +struct BOTAN_DLL Memory_Exhaustion : public Exception { Memory_Exhaustion() : Exception("Ran out of memory, allocation failed") {} diff --git a/include/filter.h b/include/filter.h index ca2c7ffab..c73bda1be 100644 --- a/include/filter.h +++ b/include/filter.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Filter Base Class * *************************************************/ -class Filter +class BOTAN_DLL Filter { public: virtual void write(const byte[], u32bit) = 0; @@ -55,7 +55,7 @@ class Filter /************************************************* * Fanout Filter Base Class * *************************************************/ -class Fanout_Filter : public Filter +class BOTAN_DLL Fanout_Filter : public Filter { protected: void incr_owns() { ++filter_owns; } diff --git a/include/filters.h b/include/filters.h index a7c3c8cc7..ac1277a62 100644 --- a/include/filters.h +++ b/include/filters.h @@ -18,7 +18,7 @@ namespace Botan { /************************************************* * Stream Cipher Filter * *************************************************/ -class StreamCipher_Filter : public Keyed_Filter +class BOTAN_DLL StreamCipher_Filter : public Keyed_Filter { public: void seek(u32bit position) { cipher->seek(position); } @@ -38,7 +38,7 @@ class StreamCipher_Filter : public Keyed_Filter /************************************************* * Hash Filter * *************************************************/ -class Hash_Filter : public Filter +class BOTAN_DLL Hash_Filter : public Filter { public: void write(const byte input[], u32bit len) { hash->update(input, len); } @@ -54,7 +54,7 @@ class Hash_Filter : public Filter /************************************************* * MessageAuthenticationCode Filter * *************************************************/ -class MAC_Filter : public Keyed_Filter +class BOTAN_DLL MAC_Filter : public Keyed_Filter { public: void write(const byte input[], u32bit len) { mac->update(input, len); } diff --git a/include/fork256.h b/include/fork256.h index bcd2cb338..8ad9c1f8d 100644 --- a/include/fork256.h +++ b/include/fork256.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * FORK-256 * *************************************************/ -class FORK_256 : public MDx_HashFunction +class BOTAN_DLL FORK_256 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/gost.h b/include/gost.h index 16c4edb6c..d78e3245f 100644 --- a/include/gost.h +++ b/include/gost.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * GOST * *************************************************/ -class GOST : public BlockCipher +class BOTAN_DLL GOST : public BlockCipher { public: void clear() throw() { EK.clear(); } @@ -25,7 +25,10 @@ class GOST : public BlockCipher void dec(const byte[], byte[]) const; void key(const byte[], u32bit); - static const u32bit SBOX1[256], SBOX2[256], SBOX3[256], SBOX4[256]; + static const u32bit SBOX1[256]; + static const u32bit SBOX2[256]; + static const u32bit SBOX3[256]; + static const u32bit SBOX4[256]; SecureBuffer<u32bit, 32> EK; }; diff --git a/include/has160.h b/include/has160.h index 7cbcfa65f..9e35bfdca 100644 --- a/include/has160.h +++ b/include/has160.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * HAS-160 * *************************************************/ -class HAS_160 : public MDx_HashFunction +class BOTAN_DLL HAS_160 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/hash_id.h b/include/hash_id.h index d06e91537..157c45552 100644 --- a/include/hash_id.h +++ b/include/hash_id.h @@ -14,8 +14,8 @@ namespace Botan { /************************************************* * Return the values of various defined HashIDs * *************************************************/ -MemoryVector<byte> pkcs_hash_id(const std::string&); -byte ieee1363_hash_id(const std::string&); +BOTAN_DLL MemoryVector<byte> pkcs_hash_id(const std::string&); +BOTAN_DLL byte ieee1363_hash_id(const std::string&); } diff --git a/include/hex.h b/include/hex.h index 06dc25762..0ecddb588 100644 --- a/include/hex.h +++ b/include/hex.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Hex Encoder * *************************************************/ -class Hex_Encoder : public Filter +class BOTAN_DLL Hex_Encoder : public Filter { public: enum Case { Uppercase, Lowercase }; @@ -39,7 +39,7 @@ class Hex_Encoder : public Filter /************************************************* * Hex Decoder * *************************************************/ -class Hex_Decoder : public Filter +class BOTAN_DLL Hex_Decoder : public Filter { public: static byte decode(const byte[2]); diff --git a/include/hmac.h b/include/hmac.h index d757d9bf8..62529cf13 100644 --- a/include/hmac.h +++ b/include/hmac.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * HMAC * *************************************************/ -class HMAC : public MessageAuthenticationCode +class BOTAN_DLL HMAC : public MessageAuthenticationCode { public: void clear() throw(); diff --git a/include/idea.h b/include/idea.h index 39566e39b..4c5e82aca 100644 --- a/include/idea.h +++ b/include/idea.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * IDEA * *************************************************/ -class IDEA : public BlockCipher +class BOTAN_DLL IDEA : public BlockCipher { public: void clear() throw() { EK.clear(); DK.clear(); } diff --git a/include/if_algo.h b/include/if_algo.h index f0a1c97dc..aa336a067 100644 --- a/include/if_algo.h +++ b/include/if_algo.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * IF Public Key * *************************************************/ -class IF_Scheme_PublicKey : public virtual Public_Key +class BOTAN_DLL IF_Scheme_PublicKey : public virtual Public_Key { public: bool check_key(bool) const; @@ -36,7 +36,7 @@ class IF_Scheme_PublicKey : public virtual Public_Key /************************************************* * IF Private Key * *************************************************/ -class IF_Scheme_PrivateKey : public virtual IF_Scheme_PublicKey, +class BOTAN_DLL IF_Scheme_PrivateKey : public virtual IF_Scheme_PublicKey, public virtual Private_Key { public: diff --git a/include/init.h b/include/init.h index e07562eb0..85f47545f 100644 --- a/include/init.h +++ b/include/init.h @@ -6,6 +6,7 @@ #ifndef BOTAN_INIT_H__ #define BOTAN_INIT_H__ +#include <botan/build.h> #include <string> #include <map> @@ -14,7 +15,7 @@ namespace Botan { /************************************************* * Options for initializing the library * *************************************************/ -class InitializerOptions +class BOTAN_DLL InitializerOptions { public: bool thread_safe() const; @@ -32,7 +33,7 @@ class InitializerOptions /************************************************* * Library Initialization/Shutdown Object * *************************************************/ -class LibraryInitializer +class BOTAN_DLL LibraryInitializer { public: static void initialize(const std::string& = ""); diff --git a/include/kasumi.h b/include/kasumi.h index b7c594dcf..58888d909 100644 --- a/include/kasumi.h +++ b/include/kasumi.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * KASUMI * *************************************************/ -class KASUMI : public BlockCipher +class BOTAN_DLL KASUMI : public BlockCipher { public: void clear() throw() { EK.clear(); } diff --git a/include/kdf.h b/include/kdf.h index ee2e7724c..57f1dc047 100644 --- a/include/kdf.h +++ b/include/kdf.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * KDF1 * *************************************************/ -class KDF1 : public KDF +class BOTAN_DLL KDF1 : public KDF { public: KDF1(const std::string&); @@ -27,7 +27,7 @@ class KDF1 : public KDF /************************************************* * KDF2 * *************************************************/ -class KDF2 : public KDF +class BOTAN_DLL KDF2 : public KDF { public: @@ -41,7 +41,7 @@ class KDF2 : public KDF /************************************************* * X9.42 PRF * *************************************************/ -class X942_PRF : public KDF +class BOTAN_DLL X942_PRF : public KDF { public: X942_PRF(const std::string&); diff --git a/include/keypair.h b/include/keypair.h index 77b75b67f..0bd8f51bf 100644 --- a/include/keypair.h +++ b/include/keypair.h @@ -15,8 +15,8 @@ namespace KeyPair { /************************************************* * Check key pair consistency * *************************************************/ -void check_key(PK_Encryptor*, PK_Decryptor*); -void check_key(PK_Signer*, PK_Verifier*); +BOTAN_DLL void check_key(PK_Encryptor*, PK_Decryptor*); +BOTAN_DLL void check_key(PK_Signer*, PK_Verifier*); } diff --git a/include/libstate.h b/include/libstate.h index 40c4a94b0..5be88f460 100644 --- a/include/libstate.h +++ b/include/libstate.h @@ -19,7 +19,7 @@ namespace Botan { /************************************************* * Global State Container Base * *************************************************/ -class Library_State +class BOTAN_DLL Library_State { public: Library_State(); @@ -31,7 +31,7 @@ class Library_State void add_engine(class Engine*); - class Engine_Iterator + class BOTAN_DLL Engine_Iterator { public: class Engine* next(); @@ -42,7 +42,7 @@ class Library_State }; friend class Engine_Iterator; - class UI + class BOTAN_DLL UI { public: virtual void pulse(Pulse_Type) {} @@ -107,9 +107,9 @@ class Library_State /************************************************* * Global State * *************************************************/ -Library_State& global_state(); -void set_global_state(Library_State*); -Library_State* swap_global_state(Library_State*); +BOTAN_DLL Library_State& global_state(); +BOTAN_DLL void set_global_state(Library_State*); +BOTAN_DLL Library_State* swap_global_state(Library_State*); } diff --git a/include/lion.h b/include/lion.h index b89195797..70018838a 100644 --- a/include/lion.h +++ b/include/lion.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Lion * *************************************************/ -class Lion : public BlockCipher +class BOTAN_DLL Lion : public BlockCipher { public: void clear() throw(); diff --git a/include/look_add.h b/include/look_add.h index 5a360c082..4185cbc0a 100644 --- a/include/look_add.h +++ b/include/look_add.h @@ -15,12 +15,12 @@ namespace Botan { /************************************************* * Add an algorithm to the lookup table * *************************************************/ -void add_algorithm(BlockCipher*); -void add_algorithm(StreamCipher*); -void add_algorithm(HashFunction*); -void add_algorithm(MessageAuthenticationCode*); -void add_algorithm(S2K*); -void add_algorithm(BlockCipherModePaddingMethod*); +BOTAN_DLL void add_algorithm(BlockCipher*); +BOTAN_DLL void add_algorithm(StreamCipher*); +BOTAN_DLL void add_algorithm(HashFunction*); +BOTAN_DLL void add_algorithm(MessageAuthenticationCode*); +BOTAN_DLL void add_algorithm(S2K*); +BOTAN_DLL void add_algorithm(BlockCipherModePaddingMethod*); } diff --git a/include/look_pk.h b/include/look_pk.h index 3255bfd86..63756ad22 100644 --- a/include/look_pk.h +++ b/include/look_pk.h @@ -13,20 +13,25 @@ namespace Botan { /************************************************* * Get an PK algorithm object * *************************************************/ -PK_Encryptor* get_pk_encryptor(const PK_Encrypting_Key&, const std::string&); -PK_Decryptor* get_pk_decryptor(const PK_Decrypting_Key&, const std::string&); +BOTAN_DLL PK_Encryptor* get_pk_encryptor(const PK_Encrypting_Key&, + const std::string&); -PK_Signer* get_pk_signer(const PK_Signing_Key&, const std::string&, - Signature_Format = IEEE_1363); +BOTAN_DLL PK_Decryptor* get_pk_decryptor(const PK_Decrypting_Key&, + const std::string&); -PK_Verifier* get_pk_verifier(const PK_Verifying_with_MR_Key&, - const std::string&, - Signature_Format = IEEE_1363); -PK_Verifier* get_pk_verifier(const PK_Verifying_wo_MR_Key&, - const std::string&, - Signature_Format = IEEE_1363); +BOTAN_DLL PK_Signer* get_pk_signer(const PK_Signing_Key&, + const std::string&, + Signature_Format = IEEE_1363); -PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key&, const std::string&); +BOTAN_DLL PK_Verifier* get_pk_verifier(const PK_Verifying_with_MR_Key&, + const std::string&, + Signature_Format = IEEE_1363); +BOTAN_DLL PK_Verifier* get_pk_verifier(const PK_Verifying_wo_MR_Key&, + const std::string&, + Signature_Format = IEEE_1363); + +BOTAN_DLL PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key&, + const std::string&); } diff --git a/include/lookup.h b/include/lookup.h index ec24344d2..6e0cecdc7 100644 --- a/include/lookup.h +++ b/include/lookup.h @@ -17,64 +17,72 @@ namespace Botan { /************************************************* * Retrieve an object from the lookup table * *************************************************/ -const BlockCipher* retrieve_block_cipher(const std::string&); -const StreamCipher* retrieve_stream_cipher(const std::string&); -const HashFunction* retrieve_hash(const std::string&); -const MessageAuthenticationCode* retrieve_mac(const std::string&); -const S2K* retrieve_s2k(const std::string&); -const BlockCipherModePaddingMethod* retrieve_bc_pad(const std::string&); +BOTAN_DLL const BlockCipher* retrieve_block_cipher(const std::string&); +BOTAN_DLL const StreamCipher* retrieve_stream_cipher(const std::string&); +BOTAN_DLL const HashFunction* retrieve_hash(const std::string&); +BOTAN_DLL const MessageAuthenticationCode* retrieve_mac(const std::string&); +BOTAN_DLL const S2K* retrieve_s2k(const std::string&); + +BOTAN_DLL const BlockCipherModePaddingMethod* +retrieve_bc_pad(const std::string&); /************************************************* * Get an algorithm object * *************************************************/ -BlockCipher* get_block_cipher(const std::string&); -StreamCipher* get_stream_cipher(const std::string&); -HashFunction* get_hash(const std::string&); -MessageAuthenticationCode* get_mac(const std::string&); -S2K* get_s2k(const std::string&); -const BlockCipherModePaddingMethod* get_bc_pad(const std::string&); +BOTAN_DLL BlockCipher* get_block_cipher(const std::string&); +BOTAN_DLL StreamCipher* get_stream_cipher(const std::string&); +BOTAN_DLL HashFunction* get_hash(const std::string&); +BOTAN_DLL MessageAuthenticationCode* get_mac(const std::string&); +BOTAN_DLL S2K* get_s2k(const std::string&); +BOTAN_DLL const BlockCipherModePaddingMethod* get_bc_pad(const std::string&); /************************************************* * Get an EMSA/EME/KDF/MGF function * *************************************************/ -EME* get_eme(const std::string&); -EMSA* get_emsa(const std::string&); -MGF* get_mgf(const std::string&); -KDF* get_kdf(const std::string&); +BOTAN_DLL EME* get_eme(const std::string&); +BOTAN_DLL EMSA* get_emsa(const std::string&); +BOTAN_DLL MGF* get_mgf(const std::string&); +BOTAN_DLL KDF* get_kdf(const std::string&); /************************************************* * Get a cipher object * *************************************************/ -Keyed_Filter* get_cipher(const std::string&, const SymmetricKey&, - const InitializationVector&, Cipher_Dir); -Keyed_Filter* get_cipher(const std::string&, const SymmetricKey&, Cipher_Dir); -Keyed_Filter* get_cipher(const std::string&, Cipher_Dir); +BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, + const SymmetricKey&, + const InitializationVector&, + Cipher_Dir); + +BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, + const SymmetricKey&, + Cipher_Dir); + +BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, Cipher_Dir); /************************************************* * Check to see if an algorithm exists * *************************************************/ -bool have_algorithm(const std::string&); +BOTAN_DLL bool have_algorithm(const std::string&); -bool have_block_cipher(const std::string&); -bool have_stream_cipher(const std::string&); -bool have_hash(const std::string&); -bool have_mac(const std::string&); +BOTAN_DLL bool have_block_cipher(const std::string&); +BOTAN_DLL bool have_stream_cipher(const std::string&); +BOTAN_DLL bool have_hash(const std::string&); +BOTAN_DLL bool have_mac(const std::string&); /************************************************* * Dereference an alias * *************************************************/ -std::string deref_alias(const std::string&); +BOTAN_DLL std::string deref_alias(const std::string&); /************************************************* * Query information about an algorithm * *************************************************/ -u32bit block_size_of(const std::string&); -u32bit output_length_of(const std::string&); +BOTAN_DLL u32bit block_size_of(const std::string&); +BOTAN_DLL u32bit output_length_of(const std::string&); -bool valid_keylength_for(u32bit, const std::string&); -u32bit min_keylength_of(const std::string&); -u32bit max_keylength_of(const std::string&); -u32bit keylength_multiple_of(const std::string&); +BOTAN_DLL bool valid_keylength_for(u32bit, const std::string&); +BOTAN_DLL u32bit min_keylength_of(const std::string&); +BOTAN_DLL u32bit max_keylength_of(const std::string&); +BOTAN_DLL u32bit keylength_multiple_of(const std::string&); } diff --git a/include/lubyrack.h b/include/lubyrack.h index a4e22f086..e5a2e2a20 100644 --- a/include/lubyrack.h +++ b/include/lubyrack.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Luby-Rackoff * *************************************************/ -class LubyRackoff : public BlockCipher +class BOTAN_DLL LubyRackoff : public BlockCipher { public: void clear() throw(); diff --git a/include/mars.h b/include/mars.h index 5345f5613..6e1bc9f34 100644 --- a/include/mars.h +++ b/include/mars.h @@ -10,7 +10,7 @@ namespace Botan { -class MARS : public BlockCipher +class BOTAN_DLL MARS : public BlockCipher { public: void clear() throw() { EK.clear(); } diff --git a/include/md2.h b/include/md2.h index c9758d9fb..2c53d1cf0 100644 --- a/include/md2.h +++ b/include/md2.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * MD2 * *************************************************/ -class MD2 : public HashFunction +class BOTAN_DLL MD2 : public HashFunction { public: void clear() throw(); diff --git a/include/md4.h b/include/md4.h index 03ba9b4d7..4bb5e3903 100644 --- a/include/md4.h +++ b/include/md4.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * MD4 * *************************************************/ -class MD4 : public MDx_HashFunction +class BOTAN_DLL MD4 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/md5.h b/include/md5.h index 4cc6dc7ac..9634c526d 100644 --- a/include/md5.h +++ b/include/md5.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * MD5 * *************************************************/ -class MD5 : public MDx_HashFunction +class BOTAN_DLL MD5 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/mdx_hash.h b/include/mdx_hash.h index 3ac5e3c93..84f92493b 100644 --- a/include/mdx_hash.h +++ b/include/mdx_hash.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * MDx Hash Function Base Class * *************************************************/ -class MDx_HashFunction : public HashFunction +class BOTAN_DLL MDx_HashFunction : public HashFunction { public: MDx_HashFunction(u32bit, u32bit, bool, bool, u32bit = 8); diff --git a/include/mem_pool.h b/include/mem_pool.h index a39e88f07..3d28034e7 100644 --- a/include/mem_pool.h +++ b/include/mem_pool.h @@ -17,7 +17,7 @@ namespace Botan { /************************************************* * Pooling Allocator * *************************************************/ -class Pooling_Allocator : public Allocator +class BOTAN_DLL Pooling_Allocator : public Allocator { public: void* allocate(u32bit); @@ -34,7 +34,7 @@ class Pooling_Allocator : public Allocator virtual void* alloc_block(u32bit) = 0; virtual void dealloc_block(void*, u32bit) = 0; - class Memory_Block + class BOTAN_DLL Memory_Block { public: Memory_Block(void*); diff --git a/include/mgf1.h b/include/mgf1.h index 7f0e77e83..9e227dd93 100644 --- a/include/mgf1.h +++ b/include/mgf1.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * MGF1 * *************************************************/ -class MGF1 : public MGF +class BOTAN_DLL MGF1 : public MGF { public: void mask(const byte[], u32bit, byte[], u32bit) const; diff --git a/include/misty1.h b/include/misty1.h index 806aba256..9e506d536 100644 --- a/include/misty1.h +++ b/include/misty1.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * MISTY1 * *************************************************/ -class MISTY1 : public BlockCipher +class BOTAN_DLL MISTY1 : public BlockCipher { public: void clear() throw() { EK.clear(); DK.clear(); } @@ -25,7 +25,8 @@ class MISTY1 : public BlockCipher void dec(const byte[], byte[]) const; void key(const byte[], u32bit); - static const byte EK_ORDER[100], DK_ORDER[100]; + static const byte EK_ORDER[100]; + static const byte DK_ORDER[100]; SecureBuffer<u16bit, 100> EK, DK; }; diff --git a/include/mode_pad.h b/include/mode_pad.h index 85452167b..4041efcdc 100644 --- a/include/mode_pad.h +++ b/include/mode_pad.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Block Cipher Mode Padding Method * *************************************************/ -class BlockCipherModePaddingMethod +class BOTAN_DLL BlockCipherModePaddingMethod { public: virtual void pad(byte[], u32bit, u32bit) const = 0; @@ -28,7 +28,7 @@ class BlockCipherModePaddingMethod /************************************************* * PKCS#7 Padding * *************************************************/ -class PKCS7_Padding : public BlockCipherModePaddingMethod +class BOTAN_DLL PKCS7_Padding : public BlockCipherModePaddingMethod { public: void pad(byte[], u32bit, u32bit) const; @@ -40,7 +40,7 @@ class PKCS7_Padding : public BlockCipherModePaddingMethod /************************************************* * ANSI X9.23 Padding * *************************************************/ -class ANSI_X923_Padding : public BlockCipherModePaddingMethod +class BOTAN_DLL ANSI_X923_Padding : public BlockCipherModePaddingMethod { public: void pad(byte[], u32bit, u32bit) const; @@ -52,7 +52,7 @@ class ANSI_X923_Padding : public BlockCipherModePaddingMethod /************************************************* * One And Zeros Padding * *************************************************/ -class OneAndZeros_Padding : public BlockCipherModePaddingMethod +class BOTAN_DLL OneAndZeros_Padding : public BlockCipherModePaddingMethod { public: void pad(byte[], u32bit, u32bit) const; @@ -64,7 +64,7 @@ class OneAndZeros_Padding : public BlockCipherModePaddingMethod /************************************************* * Null Padding * *************************************************/ -class Null_Padding : public BlockCipherModePaddingMethod +class BOTAN_DLL Null_Padding : public BlockCipherModePaddingMethod { public: void pad(byte[], u32bit, u32bit) const { return; } diff --git a/include/modebase.h b/include/modebase.h index cac6aa644..90ab277b2 100644 --- a/include/modebase.h +++ b/include/modebase.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Block Cipher Mode * *************************************************/ -class BlockCipherMode : public Keyed_Filter +class BOTAN_DLL BlockCipherMode : public Keyed_Filter { public: std::string name() const; diff --git a/include/modules.h b/include/modules.h index 5b84e6ca1..9c5a12e20 100644 --- a/include/modules.h +++ b/include/modules.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Module Builder Interface * *************************************************/ -class Modules +class BOTAN_DLL Modules { public: virtual class Mutex_Factory* mutex_factory() const = 0; @@ -34,7 +34,7 @@ class Modules /************************************************* * Built In Modules * *************************************************/ -class Builtin_Modules : public Modules +class BOTAN_DLL Builtin_Modules : public Modules { public: class Mutex_Factory* mutex_factory() const; diff --git a/include/mutex.h b/include/mutex.h index ecf22a417..518da8fd5 100644 --- a/include/mutex.h +++ b/include/mutex.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Mutex Base Class * *************************************************/ -class Mutex +class BOTAN_DLL Mutex { public: virtual void lock() = 0; @@ -24,7 +24,7 @@ class Mutex /************************************************* * Mutex Factory * *************************************************/ -class Mutex_Factory +class BOTAN_DLL Mutex_Factory { public: virtual Mutex* make() = 0; @@ -34,7 +34,7 @@ class Mutex_Factory /************************************************* * Default Mutex Factory * *************************************************/ -class Default_Mutex_Factory : public Mutex_Factory +class BOTAN_DLL Default_Mutex_Factory : public Mutex_Factory { public: Mutex* make(); @@ -43,7 +43,7 @@ class Default_Mutex_Factory : public Mutex_Factory /************************************************* * Mutex Holding Class * *************************************************/ -class Mutex_Holder +class BOTAN_DLL Mutex_Holder { public: Mutex_Holder(Mutex*); diff --git a/include/nr.h b/include/nr.h index bdf664594..ef46db0b0 100644 --- a/include/nr.h +++ b/include/nr.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Nyberg-Rueppel Public Key * *************************************************/ -class NR_PublicKey : public PK_Verifying_with_MR_Key, +class BOTAN_DLL NR_PublicKey : public PK_Verifying_with_MR_Key, public virtual DL_Scheme_PublicKey { public: @@ -38,7 +38,7 @@ class NR_PublicKey : public PK_Verifying_with_MR_Key, /************************************************* * Nyberg-Rueppel Private Key * *************************************************/ -class NR_PrivateKey : public NR_PublicKey, +class BOTAN_DLL NR_PrivateKey : public NR_PublicKey, public PK_Signing_Key, public virtual DL_Scheme_PrivateKey { diff --git a/include/numthry.h b/include/numthry.h index 1f3a1f9b4..44d5d86d5 100644 --- a/include/numthry.h +++ b/include/numthry.h @@ -15,48 +15,50 @@ namespace Botan { /************************************************* * Fused Arithmetic Operations * *************************************************/ -BigInt mul_add(const BigInt&, const BigInt&, const BigInt&); -BigInt sub_mul(const BigInt&, const BigInt&, const BigInt&); +BigInt BOTAN_DLL mul_add(const BigInt&, const BigInt&, const BigInt&); +BigInt BOTAN_DLL sub_mul(const BigInt&, const BigInt&, const BigInt&); /************************************************* * Number Theory Functions * *************************************************/ inline BigInt abs(const BigInt& n) { return n.abs(); } -void divide(const BigInt&, const BigInt&, BigInt&, BigInt&); +void BOTAN_DLL divide(const BigInt&, const BigInt&, BigInt&, BigInt&); -BigInt gcd(const BigInt&, const BigInt&); -BigInt lcm(const BigInt&, const BigInt&); +BigInt BOTAN_DLL gcd(const BigInt&, const BigInt&); +BigInt BOTAN_DLL lcm(const BigInt&, const BigInt&); -BigInt square(const BigInt&); -BigInt inverse_mod(const BigInt&, const BigInt&); -s32bit jacobi(const BigInt&, const BigInt&); +BigInt BOTAN_DLL square(const BigInt&); +BigInt BOTAN_DLL inverse_mod(const BigInt&, const BigInt&); +s32bit BOTAN_DLL jacobi(const BigInt&, const BigInt&); -BigInt power_mod(const BigInt&, const BigInt&, const BigInt&); +BigInt BOTAN_DLL power_mod(const BigInt&, const BigInt&, const BigInt&); /************************************************* * Utility Functions * *************************************************/ -u32bit low_zero_bits(const BigInt&); +u32bit BOTAN_DLL low_zero_bits(const BigInt&); /************************************************* * Primality Testing * *************************************************/ -bool check_prime(const BigInt&); -bool is_prime(const BigInt&); -bool verify_prime(const BigInt&); +bool BOTAN_DLL check_prime(const BigInt&); +bool BOTAN_DLL is_prime(const BigInt&); +bool BOTAN_DLL verify_prime(const BigInt&); -s32bit simple_primality_tests(const BigInt&); -bool passes_mr_tests(const BigInt&, u32bit = 1); -bool run_primality_tests(const BigInt&, u32bit = 1); +s32bit BOTAN_DLL simple_primality_tests(const BigInt&); +bool BOTAN_DLL passes_mr_tests(const BigInt&, u32bit = 1); +bool BOTAN_DLL run_primality_tests(const BigInt&, u32bit = 1); /************************************************* * Random Number Generation * *************************************************/ -BigInt random_integer(u32bit); -BigInt random_integer(const BigInt&, const BigInt&); -BigInt random_prime(u32bit, const BigInt& = 1, u32bit = 1, u32bit = 2); -BigInt random_safe_prime(u32bit); +BigInt BOTAN_DLL random_integer(u32bit); +BigInt BOTAN_DLL random_integer(const BigInt&, const BigInt&); +BigInt BOTAN_DLL random_prime(u32bit, const BigInt& = 1, + u32bit = 1, u32bit = 2); + +BigInt BOTAN_DLL random_safe_prime(u32bit); /************************************************* * Prime Numbers * @@ -70,7 +72,7 @@ extern const u64bit PRIME_PRODUCTS[]; /************************************************* * Miller-Rabin Primality Tester * *************************************************/ -class MillerRabin_Test +class BOTAN_DLL MillerRabin_Test { public: bool passes_test(const BigInt&); diff --git a/include/ofb.h b/include/ofb.h index e6769d0e9..3bf6f9883 100644 --- a/include/ofb.h +++ b/include/ofb.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * OFB Mode * *************************************************/ -class OFB : public BlockCipherMode +class BOTAN_DLL OFB : public BlockCipherMode { public: OFB(const std::string&); diff --git a/include/oids.h b/include/oids.h index e836ceef1..b5be0e01f 100644 --- a/include/oids.h +++ b/include/oids.h @@ -15,19 +15,19 @@ namespace OIDS { /************************************************* * Register an OID to string mapping * *************************************************/ -void add_oid(const OID&, const std::string&); +BOTAN_DLL void add_oid(const OID&, const std::string&); /************************************************* * See if an OID exists in the internal table * *************************************************/ -bool have_oid(const std::string&); +BOTAN_DLL bool have_oid(const std::string&); /************************************************* * Perform OID<->string mappings * *************************************************/ -std::string lookup(const OID&); -OID lookup(const std::string&); -bool name_of(const OID&, const std::string&); +BOTAN_DLL std::string lookup(const OID&); +BOTAN_DLL OID lookup(const std::string&); +BOTAN_DLL bool name_of(const OID&, const std::string&); } diff --git a/include/openpgp.h b/include/openpgp.h index 1a1290f39..1a078a630 100644 --- a/include/openpgp.h +++ b/include/openpgp.h @@ -17,13 +17,13 @@ namespace OpenPGP { /************************************************* * OpenPGP Base64 encoding/decoding * *************************************************/ -std::string encode(const byte[], u32bit, const std::string&, - const std::map<std::string, std::string>&); -SecureVector<byte> decode(DataSource&, std::string&, - std::map<std::string, std::string>&); +BOTAN_DLL std::string encode(const byte[], u32bit, const std::string&, + const std::map<std::string, std::string>&); +BOTAN_DLL SecureVector<byte> decode(DataSource&, std::string&, + std::map<std::string, std::string>&); -std::string encode(const byte[], u32bit, const std::string&); -SecureVector<byte> decode(DataSource&, std::string&); +BOTAN_DLL std::string encode(const byte[], u32bit, const std::string&); +BOTAN_DLL SecureVector<byte> decode(DataSource&, std::string&); } diff --git a/include/out_buf.h b/include/out_buf.h index 1e169b9bc..103ea6cd7 100644 --- a/include/out_buf.h +++ b/include/out_buf.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Container of output buffers for Pipe * *************************************************/ -class Output_Buffers +class BOTAN_DLL Output_Buffers { public: u32bit read(byte[], u32bit, Pipe::message_id); diff --git a/include/par_hash.h b/include/par_hash.h index dec785ea9..844a6fb50 100644 --- a/include/par_hash.h +++ b/include/par_hash.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Parallel * *************************************************/ -class Parallel : public HashFunction +class BOTAN_DLL Parallel : public HashFunction { public: void clear() throw(); diff --git a/include/parsing.h b/include/parsing.h index 9c9128d33..9542e330a 100644 --- a/include/parsing.h +++ b/include/parsing.h @@ -15,22 +15,22 @@ namespace Botan { /************************************************* * String Parsing Functions * *************************************************/ -std::vector<std::string> parse_algorithm_name(const std::string&); -std::vector<std::string> split_on(const std::string&, char); -std::vector<u32bit> parse_asn1_oid(const std::string&); -bool x500_name_cmp(const std::string&, const std::string&); +BOTAN_DLL std::vector<std::string> parse_algorithm_name(const std::string&); +BOTAN_DLL std::vector<std::string> split_on(const std::string&, char); +BOTAN_DLL std::vector<u32bit> parse_asn1_oid(const std::string&); +BOTAN_DLL bool x500_name_cmp(const std::string&, const std::string&); /************************************************* * String/Integer Conversions * *************************************************/ -std::string to_string(u64bit, u32bit = 0); -u32bit to_u32bit(const std::string&); +BOTAN_DLL std::string to_string(u64bit, u32bit = 0); +BOTAN_DLL u32bit to_u32bit(const std::string&); /************************************************* * String/Network Address Conversions * *************************************************/ -u32bit string_to_ipv4(const std::string&); -std::string ipv4_to_string(u32bit); +BOTAN_DLL u32bit string_to_ipv4(const std::string&); +BOTAN_DLL std::string ipv4_to_string(u32bit); } diff --git a/include/pbe.h b/include/pbe.h index 2f39d6f15..323f37ce4 100644 --- a/include/pbe.h +++ b/include/pbe.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Password Based Encryption * *************************************************/ -class PBE : public Filter +class BOTAN_DLL PBE : public Filter { public: virtual void set_key(const std::string&) = 0; @@ -28,8 +28,8 @@ class PBE : public Filter /************************************************* * Get a PBE object * *************************************************/ -PBE* get_pbe(const std::string&); -PBE* get_pbe(const OID&, DataSource&); +BOTAN_DLL PBE* get_pbe(const std::string&); +BOTAN_DLL PBE* get_pbe(const OID&, DataSource&); } diff --git a/include/pbe_pkcs.h b/include/pbe_pkcs.h index 694a649e7..cd2f27ce4 100644 --- a/include/pbe_pkcs.h +++ b/include/pbe_pkcs.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * PKCS#5 v1.5 PBE * *************************************************/ -class PBE_PKCS5v15 : public PBE +class BOTAN_DLL PBE_PKCS5v15 : public PBE { public: void write(const byte[], u32bit); @@ -38,7 +38,7 @@ class PBE_PKCS5v15 : public PBE /************************************************* * PKCS#5 v2.0 PBE * *************************************************/ -class PBE_PKCS5v20 : public PBE +class BOTAN_DLL PBE_PKCS5v20 : public PBE { public: void write(const byte[], u32bit); diff --git a/include/pem.h b/include/pem.h index 1d873d238..e9f14ddc2 100644 --- a/include/pem.h +++ b/include/pem.h @@ -15,12 +15,16 @@ namespace PEM_Code { /************************************************* * PEM Encoding/Decoding * *************************************************/ -std::string encode(const byte[], u32bit, const std::string&, u32bit = 64); -std::string encode(const MemoryRegion<byte>&, const std::string&, u32bit = 64); - -SecureVector<byte> decode(DataSource&, std::string&); -SecureVector<byte> decode_check_label(DataSource&, const std::string&); -bool matches(DataSource&, const std::string& = "", u32bit search_range = 4096); +BOTAN_DLL std::string encode(const byte[], u32bit, + const std::string&, u32bit = 64); +BOTAN_DLL std::string encode(const MemoryRegion<byte>&, + const std::string&, u32bit = 64); + +BOTAN_DLL SecureVector<byte> decode(DataSource&, std::string&); +BOTAN_DLL SecureVector<byte> decode_check_label(DataSource&, + const std::string&); +BOTAN_DLL bool matches(DataSource&, const std::string& = "", + u32bit search_range = 4096); } diff --git a/include/pgp_s2k.h b/include/pgp_s2k.h index fdcb6751b..cd263a735 100644 --- a/include/pgp_s2k.h +++ b/include/pgp_s2k.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * OpenPGP S2K * *************************************************/ -class OpenPGP_S2K : public S2K +class BOTAN_DLL OpenPGP_S2K : public S2K { public: std::string name() const; diff --git a/include/pipe.h b/include/pipe.h index 89f1ac4db..ee13ad640 100644 --- a/include/pipe.h +++ b/include/pipe.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Pipe * *************************************************/ -class Pipe : public DataSource +class BOTAN_DLL Pipe : public DataSource { public: typedef u32bit message_id; @@ -26,7 +26,8 @@ class Pipe : public DataSource Invalid_Message_Number(const std::string&, message_id); }; - static const message_id LAST_MESSAGE, DEFAULT_MESSAGE; + static const message_id LAST_MESSAGE; + static const message_id DEFAULT_MESSAGE; void write(const byte[], u32bit); void write(const MemoryRegion<byte>&); @@ -87,8 +88,8 @@ class Pipe : public DataSource /************************************************* * I/O Operators for Pipe * *************************************************/ -std::ostream& operator<<(std::ostream&, Pipe&); -std::istream& operator>>(std::istream&, Pipe&); +BOTAN_DLL std::ostream& operator<<(std::ostream&, Pipe&); +BOTAN_DLL std::istream& operator>>(std::istream&, Pipe&); } diff --git a/include/pk_algs.h b/include/pk_algs.h index 89bdfa582..a8fa5f176 100644 --- a/include/pk_algs.h +++ b/include/pk_algs.h @@ -14,8 +14,8 @@ namespace Botan { /************************************************* * Get an PK key object * *************************************************/ -Public_Key* get_public_key(const std::string&); -Private_Key* get_private_key(const std::string&); +BOTAN_DLL Public_Key* get_public_key(const std::string&); +BOTAN_DLL Private_Key* get_private_key(const std::string&); } diff --git a/include/pk_core.h b/include/pk_core.h index 71beb3e7d..3f4ebda57 100644 --- a/include/pk_core.h +++ b/include/pk_core.h @@ -16,7 +16,7 @@ namespace Botan { /************************************************* * IF Core * *************************************************/ -class IF_Core +class BOTAN_DLL IF_Core { public: BigInt public_op(const BigInt&) const; @@ -38,7 +38,7 @@ class IF_Core /************************************************* * DSA Core * *************************************************/ -class DSA_Core +class BOTAN_DLL DSA_Core { public: SecureVector<byte> sign(const byte[], u32bit, const BigInt&) const; @@ -57,7 +57,7 @@ class DSA_Core /************************************************* * NR Core * *************************************************/ -class NR_Core +class BOTAN_DLL NR_Core { public: SecureVector<byte> sign(const byte[], u32bit, const BigInt&) const; @@ -76,7 +76,7 @@ class NR_Core /************************************************* * ElGamal Core * *************************************************/ -class ELG_Core +class BOTAN_DLL ELG_Core { public: SecureVector<byte> encrypt(const byte[], u32bit, const BigInt&) const; @@ -97,7 +97,7 @@ class ELG_Core /************************************************* * DH Core * *************************************************/ -class DH_Core +class BOTAN_DLL DH_Core { public: BigInt agree(const BigInt&) const; diff --git a/include/pk_filts.h b/include/pk_filts.h index cfb130dba..bba2fd954 100644 --- a/include/pk_filts.h +++ b/include/pk_filts.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * PK_Encryptor Filter * *************************************************/ -class PK_Encryptor_Filter : public Filter +class BOTAN_DLL PK_Encryptor_Filter : public Filter { public: void write(const byte[], u32bit); @@ -29,7 +29,7 @@ class PK_Encryptor_Filter : public Filter /************************************************* * PK_Decryptor Filter * *************************************************/ -class PK_Decryptor_Filter : public Filter +class BOTAN_DLL PK_Decryptor_Filter : public Filter { public: void write(const byte[], u32bit); @@ -44,7 +44,7 @@ class PK_Decryptor_Filter : public Filter /************************************************* * PK_Signer Filter * *************************************************/ -class PK_Signer_Filter : public Filter +class BOTAN_DLL PK_Signer_Filter : public Filter { public: void write(const byte[], u32bit); @@ -58,7 +58,7 @@ class PK_Signer_Filter : public Filter /************************************************* * PK_Verifier Filter * *************************************************/ -class PK_Verifier_Filter : public Filter +class BOTAN_DLL PK_Verifier_Filter : public Filter { public: void write(const byte[], u32bit); diff --git a/include/pk_keys.h b/include/pk_keys.h index 89173e739..36905e868 100644 --- a/include/pk_keys.h +++ b/include/pk_keys.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Public Key Base Class * *************************************************/ -class Public_Key +class BOTAN_DLL Public_Key { public: virtual std::string algo_name() const = 0; @@ -36,7 +36,7 @@ class Public_Key /************************************************* * Private Key Base Class * *************************************************/ -class Private_Key : public virtual Public_Key +class BOTAN_DLL Private_Key : public virtual Public_Key { public: virtual class PKCS8_Encoder* pkcs8_encoder() const { return 0; } @@ -49,7 +49,7 @@ class Private_Key : public virtual Public_Key /************************************************* * PK Encrypting Key * *************************************************/ -class PK_Encrypting_Key : public virtual Public_Key +class BOTAN_DLL PK_Encrypting_Key : public virtual Public_Key { public: virtual SecureVector<byte> encrypt(const byte[], u32bit) const = 0; @@ -59,7 +59,7 @@ class PK_Encrypting_Key : public virtual Public_Key /************************************************* * PK Decrypting Key * *************************************************/ -class PK_Decrypting_Key : public virtual Private_Key +class BOTAN_DLL PK_Decrypting_Key : public virtual Private_Key { public: virtual SecureVector<byte> decrypt(const byte[], u32bit) const = 0; @@ -69,7 +69,7 @@ class PK_Decrypting_Key : public virtual Private_Key /************************************************* * PK Signing Key * *************************************************/ -class PK_Signing_Key : public virtual Private_Key +class BOTAN_DLL PK_Signing_Key : public virtual Private_Key { public: virtual SecureVector<byte> sign(const byte[], u32bit) const = 0; @@ -79,7 +79,7 @@ class PK_Signing_Key : public virtual Private_Key /************************************************* * PK Verifying Key, Message Recovery Version * *************************************************/ -class PK_Verifying_with_MR_Key : public virtual Public_Key +class BOTAN_DLL PK_Verifying_with_MR_Key : public virtual Public_Key { public: virtual SecureVector<byte> verify(const byte[], u32bit) const = 0; @@ -89,7 +89,7 @@ class PK_Verifying_with_MR_Key : public virtual Public_Key /************************************************* * PK Verifying Key, No Message Recovery Version * *************************************************/ -class PK_Verifying_wo_MR_Key : public virtual Public_Key +class BOTAN_DLL PK_Verifying_wo_MR_Key : public virtual Public_Key { public: virtual bool verify(const byte[], u32bit, @@ -100,7 +100,7 @@ class PK_Verifying_wo_MR_Key : public virtual Public_Key /************************************************* * PK Secret Value Derivation Key * *************************************************/ -class PK_Key_Agreement_Key : public virtual Private_Key +class BOTAN_DLL PK_Key_Agreement_Key : public virtual Private_Key { public: virtual SecureVector<byte> derive_key(const byte[], u32bit) const = 0; diff --git a/include/pk_ops.h b/include/pk_ops.h index ef91ebf04..fad87b573 100644 --- a/include/pk_ops.h +++ b/include/pk_ops.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * IF Operation * *************************************************/ -class IF_Operation +class BOTAN_DLL IF_Operation { public: virtual BigInt public_op(const BigInt&) const = 0; @@ -26,7 +26,7 @@ class IF_Operation /************************************************* * DSA Operation * *************************************************/ -class DSA_Operation +class BOTAN_DLL DSA_Operation { public: virtual bool verify(const byte[], u32bit, @@ -40,7 +40,7 @@ class DSA_Operation /************************************************* * NR Operation * *************************************************/ -class NR_Operation +class BOTAN_DLL NR_Operation { public: virtual SecureVector<byte> verify(const byte[], u32bit) const = 0; @@ -53,7 +53,7 @@ class NR_Operation /************************************************* * ElGamal Operation * *************************************************/ -class ELG_Operation +class BOTAN_DLL ELG_Operation { public: virtual SecureVector<byte> encrypt(const byte[], u32bit, @@ -66,7 +66,7 @@ class ELG_Operation /************************************************* * DH Operation * *************************************************/ -class DH_Operation +class BOTAN_DLL DH_Operation { public: virtual BigInt agree(const BigInt&) const = 0; diff --git a/include/pk_util.h b/include/pk_util.h index 3269779d3..5888b6ac0 100644 --- a/include/pk_util.h +++ b/include/pk_util.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Encoding Method for Encryption * *************************************************/ -class EME +class BOTAN_DLL EME { public: virtual u32bit maximum_input_size(u32bit) const = 0; @@ -31,7 +31,7 @@ class EME /************************************************* * Encoding Method for Signatures, Appendix * *************************************************/ -class EMSA +class BOTAN_DLL EMSA { public: virtual void update(const byte[], u32bit) = 0; @@ -46,7 +46,7 @@ class EMSA /************************************************* * Key Derivation Function * *************************************************/ -class KDF +class BOTAN_DLL KDF { public: SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&, @@ -70,7 +70,7 @@ class KDF /************************************************* * Mask Generation Function * *************************************************/ -class MGF +class BOTAN_DLL MGF { public: virtual void mask(const byte[], u32bit, byte[], u32bit) const = 0; diff --git a/include/pkcs10.h b/include/pkcs10.h index ac9ff4fee..f688688ee 100644 --- a/include/pkcs10.h +++ b/include/pkcs10.h @@ -16,7 +16,7 @@ namespace Botan { /************************************************* * PKCS #10 Certificate Request * *************************************************/ -class PKCS10_Request : public X509_Object +class BOTAN_DLL PKCS10_Request : public X509_Object { public: Public_Key* subject_public_key() const; diff --git a/include/pkcs5.h b/include/pkcs5.h index e57f33149..22b16b7c5 100644 --- a/include/pkcs5.h +++ b/include/pkcs5.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * PKCS #5 PBKDF1 * *************************************************/ -class PKCS5_PBKDF1 : public S2K +class BOTAN_DLL PKCS5_PBKDF1 : public S2K { public: std::string name() const; @@ -28,7 +28,7 @@ class PKCS5_PBKDF1 : public S2K /************************************************* * PKCS #5 PBKDF2 * *************************************************/ -class PKCS5_PBKDF2 : public S2K +class BOTAN_DLL PKCS5_PBKDF2 : public S2K { public: std::string name() const; diff --git a/include/pkcs8.h b/include/pkcs8.h index 871178412..0c7c97e6c 100644 --- a/include/pkcs8.h +++ b/include/pkcs8.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * PKCS #8 Private Key Encoder * *************************************************/ -class PKCS8_Encoder +class BOTAN_DLL PKCS8_Encoder { public: virtual AlgorithmIdentifier alg_id() const = 0; @@ -25,7 +25,7 @@ class PKCS8_Encoder /************************************************* * PKCS #8 Private Key Decoder * *************************************************/ -class PKCS8_Decoder +class BOTAN_DLL PKCS8_Decoder { public: virtual void alg_id(const AlgorithmIdentifier&) = 0; @@ -47,21 +47,21 @@ namespace PKCS8 { /************************************************* * PKCS #8 Private Key Encoding/Decoding * *************************************************/ -void encode(const Private_Key&, Pipe&, X509_Encoding = PEM); -void encrypt_key(const Private_Key&, Pipe&, const std::string&, - const std::string& = "", X509_Encoding = PEM); +BOTAN_DLL void encode(const Private_Key&, Pipe&, X509_Encoding = PEM); +BOTAN_DLL void encrypt_key(const Private_Key&, Pipe&, const std::string&, + const std::string& = "", X509_Encoding = PEM); -std::string PEM_encode(const Private_Key&); -std::string PEM_encode(const Private_Key&, const std::string&, - const std::string& = ""); +BOTAN_DLL std::string PEM_encode(const Private_Key&); +BOTAN_DLL std::string PEM_encode(const Private_Key&, const std::string&, + const std::string& = ""); -Private_Key* load_key(DataSource&, const User_Interface&); -Private_Key* load_key(DataSource&, const std::string& = ""); +BOTAN_DLL Private_Key* load_key(DataSource&, const User_Interface&); +BOTAN_DLL Private_Key* load_key(DataSource&, const std::string& = ""); -Private_Key* load_key(const std::string&, const User_Interface&); -Private_Key* load_key(const std::string&, const std::string& = ""); +BOTAN_DLL Private_Key* load_key(const std::string&, const User_Interface&); +BOTAN_DLL Private_Key* load_key(const std::string&, const std::string& = ""); -Private_Key* copy_key(const Private_Key&); +BOTAN_DLL Private_Key* copy_key(const Private_Key&); } diff --git a/include/pow_mod.h b/include/pow_mod.h index 269a31116..37e0871da 100644 --- a/include/pow_mod.h +++ b/include/pow_mod.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Modular Exponentiator Interface * *************************************************/ -class Modular_Exponentiator +class BOTAN_DLL Modular_Exponentiator { public: virtual void set_base(const BigInt&) = 0; @@ -26,7 +26,7 @@ class Modular_Exponentiator /************************************************* * Modular Exponentiator Proxy * *************************************************/ -class Power_Mod +class BOTAN_DLL Power_Mod { public: enum Usage_Hints { @@ -61,7 +61,7 @@ class Power_Mod /************************************************* * Fixed Exponent Modular Exponentiator Proxy * *************************************************/ -class Fixed_Exponent_Power_Mod : public Power_Mod +class BOTAN_DLL Fixed_Exponent_Power_Mod : public Power_Mod { public: BigInt operator()(const BigInt& b) const @@ -75,7 +75,7 @@ class Fixed_Exponent_Power_Mod : public Power_Mod /************************************************* * Fixed Base Modular Exponentiator Proxy * *************************************************/ -class Fixed_Base_Power_Mod : public Power_Mod +class BOTAN_DLL Fixed_Base_Power_Mod : public Power_Mod { public: BigInt operator()(const BigInt& e) const diff --git a/include/pubkey.h b/include/pubkey.h index 8d4764bce..798d97661 100644 --- a/include/pubkey.h +++ b/include/pubkey.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Public Key Encryptor * *************************************************/ -class PK_Encryptor +class BOTAN_DLL PK_Encryptor { public: SecureVector<byte> encrypt(const byte[], u32bit) const; @@ -29,7 +29,7 @@ class PK_Encryptor /************************************************* * Public Key Decryptor * *************************************************/ -class PK_Decryptor +class BOTAN_DLL PK_Decryptor { public: SecureVector<byte> decrypt(const byte[], u32bit) const; @@ -42,7 +42,7 @@ class PK_Decryptor /************************************************* * Public Key Signer * *************************************************/ -class PK_Signer +class BOTAN_DLL PK_Signer { public: SecureVector<byte> sign_message(const byte[], u32bit); @@ -67,7 +67,7 @@ class PK_Signer /************************************************* * Public Key Verifier * *************************************************/ -class PK_Verifier +class BOTAN_DLL PK_Verifier { public: bool verify_message(const byte[], u32bit, const byte[], u32bit); @@ -98,7 +98,7 @@ class PK_Verifier /************************************************* * Key Agreement * *************************************************/ -class PK_Key_Agreement +class BOTAN_DLL PK_Key_Agreement { public: SymmetricKey derive_key(u32bit, const byte[], u32bit, @@ -115,7 +115,7 @@ class PK_Key_Agreement /************************************************* * Encryption with an MR algorithm and an EME * *************************************************/ -class PK_Encryptor_MR_with_EME : public PK_Encryptor +class BOTAN_DLL PK_Encryptor_MR_with_EME : public PK_Encryptor { public: u32bit maximum_input_size() const; @@ -130,7 +130,7 @@ class PK_Encryptor_MR_with_EME : public PK_Encryptor /************************************************* * Decryption with an MR algorithm and an EME * *************************************************/ -class PK_Decryptor_MR_with_EME : public PK_Decryptor +class BOTAN_DLL PK_Decryptor_MR_with_EME : public PK_Decryptor { public: PK_Decryptor_MR_with_EME(const PK_Decrypting_Key&, const std::string&); @@ -144,7 +144,7 @@ class PK_Decryptor_MR_with_EME : public PK_Decryptor /************************************************* * Public Key Verifier with Message Recovery * *************************************************/ -class PK_Verifier_with_MR : public PK_Verifier +class BOTAN_DLL PK_Verifier_with_MR : public PK_Verifier { public: PK_Verifier_with_MR(const PK_Verifying_with_MR_Key&, const std::string&); @@ -159,7 +159,7 @@ class PK_Verifier_with_MR : public PK_Verifier /************************************************* * Public Key Verifier without Message Recovery * *************************************************/ -class PK_Verifier_wo_MR : public PK_Verifier +class BOTAN_DLL PK_Verifier_wo_MR : public PK_Verifier { public: PK_Verifier_wo_MR(const PK_Verifying_wo_MR_Key&, const std::string&); diff --git a/include/randpool.h b/include/randpool.h index 30a96386a..24f0a8270 100644 --- a/include/randpool.h +++ b/include/randpool.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Randpool * *************************************************/ -class Randpool : public RandomNumberGenerator +class BOTAN_DLL Randpool : public RandomNumberGenerator { public: void randomize(byte[], u32bit) throw(PRNG_Unseeded); diff --git a/include/rc2.h b/include/rc2.h index 9701e0451..8f46821a4 100644 --- a/include/rc2.h +++ b/include/rc2.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * RC2 * *************************************************/ -class RC2 : public BlockCipher +class BOTAN_DLL RC2 : public BlockCipher { public: static byte EKB_code(u32bit); diff --git a/include/rc5.h b/include/rc5.h index 066aa9356..0827048dc 100644 --- a/include/rc5.h +++ b/include/rc5.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * RC5 * *************************************************/ -class RC5 : public BlockCipher +class BOTAN_DLL RC5 : public BlockCipher { public: void clear() throw() { S.clear(); } diff --git a/include/rc6.h b/include/rc6.h index 34997c065..d629b0995 100644 --- a/include/rc6.h +++ b/include/rc6.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * RC6 * *************************************************/ -class RC6 : public BlockCipher +class BOTAN_DLL RC6 : public BlockCipher { public: void clear() throw() { S.clear(); } diff --git a/include/reducer.h b/include/reducer.h index 95160b477..48008e73b 100644 --- a/include/reducer.h +++ b/include/reducer.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Modular Reducer * *************************************************/ -class Modular_Reducer +class BOTAN_DLL Modular_Reducer { public: BigInt multiply(const BigInt&, const BigInt&) const; diff --git a/include/rmd128.h b/include/rmd128.h index ba82de51d..2cb98e516 100644 --- a/include/rmd128.h +++ b/include/rmd128.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * RIPEMD-128 * *************************************************/ -class RIPEMD_128 : public MDx_HashFunction +class BOTAN_DLL RIPEMD_128 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/rmd160.h b/include/rmd160.h index 59861ddd5..0544f21cc 100644 --- a/include/rmd160.h +++ b/include/rmd160.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * RIPEMD-160 * *************************************************/ -class RIPEMD_160 : public MDx_HashFunction +class BOTAN_DLL RIPEMD_160 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/rng.h b/include/rng.h index fee9c088f..7dd4c1698 100644 --- a/include/rng.h +++ b/include/rng.h @@ -15,15 +15,15 @@ namespace Botan { *************************************************/ namespace Global_RNG { -void randomize(byte[], u32bit); -byte random(); +BOTAN_DLL void randomize(byte[], u32bit); +BOTAN_DLL byte random(); -void add_entropy(const byte[], u32bit); -void add_entropy(EntropySource&, bool = true); +BOTAN_DLL void add_entropy(const byte[], u32bit); +BOTAN_DLL void add_entropy(EntropySource&, bool = true); -u32bit seed(bool = true, u32bit = 256); +BOTAN_DLL u32bit seed(bool = true, u32bit = 256); -void add_es(EntropySource*, bool = true); +BOTAN_DLL void add_es(EntropySource*, bool = true); } diff --git a/include/rsa.h b/include/rsa.h index f3f0e2e5e..415bc2af6 100644 --- a/include/rsa.h +++ b/include/rsa.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * RSA Public Key * *************************************************/ -class RSA_PublicKey : public PK_Encrypting_Key, +class BOTAN_DLL RSA_PublicKey : public PK_Encrypting_Key, public PK_Verifying_with_MR_Key, public virtual IF_Scheme_PublicKey { @@ -32,7 +32,7 @@ class RSA_PublicKey : public PK_Encrypting_Key, /************************************************* * RSA Private Key * *************************************************/ -class RSA_PrivateKey : public RSA_PublicKey, +class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey, public PK_Decrypting_Key, public PK_Signing_Key, public IF_Scheme_PrivateKey diff --git a/include/rw.h b/include/rw.h index 843334cb3..896e29545 100644 --- a/include/rw.h +++ b/include/rw.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Rabin-Williams Public Key * *************************************************/ -class RW_PublicKey : public PK_Verifying_with_MR_Key, +class BOTAN_DLL RW_PublicKey : public PK_Verifying_with_MR_Key, public virtual IF_Scheme_PublicKey { public: @@ -30,7 +30,7 @@ class RW_PublicKey : public PK_Verifying_with_MR_Key, /************************************************* * Rabin-Williams Private Key * *************************************************/ -class RW_PrivateKey : public RW_PublicKey, +class BOTAN_DLL RW_PrivateKey : public RW_PublicKey, public PK_Signing_Key, public IF_Scheme_PrivateKey { diff --git a/include/s2k.h b/include/s2k.h index 39789ad2a..88cc16d68 100644 --- a/include/s2k.h +++ b/include/s2k.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * S2K Interface * *************************************************/ -class S2K +class BOTAN_DLL S2K { public: virtual S2K* clone() const = 0; diff --git a/include/safer_sk.h b/include/safer_sk.h index a7d9017ee..1bc65e2f7 100644 --- a/include/safer_sk.h +++ b/include/safer_sk.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * SAFER-SK * *************************************************/ -class SAFER_SK : public BlockCipher +class BOTAN_DLL SAFER_SK : public BlockCipher { public: void clear() throw() { EK.clear(); } @@ -24,7 +24,11 @@ class SAFER_SK : public BlockCipher void enc(const byte[], byte[]) const; void dec(const byte[], byte[]) const; void key(const byte[], u32bit); - static const byte EXP[256], LOG[512], BIAS[208], KEY_INDEX[208]; + + static const byte EXP[256]; + static const byte LOG[512]; + static const byte BIAS[208]; + static const byte KEY_INDEX[208]; SecureVector<byte> EK; const u32bit ROUNDS; }; diff --git a/include/secqueue.h b/include/secqueue.h index b688196ae..71d902109 100644 --- a/include/secqueue.h +++ b/include/secqueue.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * SecureQueue * *************************************************/ -class SecureQueue : public Fanout_Filter, public DataSource +class BOTAN_DLL SecureQueue : public Fanout_Filter, public DataSource { public: void write(const byte[], u32bit); diff --git a/include/seed.h b/include/seed.h index ed347b82a..95ddbe1d5 100644 --- a/include/seed.h +++ b/include/seed.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * SEED * *************************************************/ -class SEED : public BlockCipher +class BOTAN_DLL SEED : public BlockCipher { public: void clear() throw() { K.clear(); } diff --git a/include/selftest.h b/include/selftest.h index 1283b3dd4..ff011a32c 100644 --- a/include/selftest.h +++ b/include/selftest.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Self Tests * *************************************************/ -bool passes_self_tests(); +BOTAN_DLL bool passes_self_tests(); } diff --git a/include/serpent.h b/include/serpent.h index 57cdd027e..685470e4c 100644 --- a/include/serpent.h +++ b/include/serpent.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Serpent * *************************************************/ -class Serpent : public BlockCipher +class BOTAN_DLL Serpent : public BlockCipher { public: void clear() throw() { round_key.clear(); } diff --git a/include/sha160.h b/include/sha160.h index f493fbcc5..022ab9514 100644 --- a/include/sha160.h +++ b/include/sha160.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * SHA-160 * *************************************************/ -class SHA_160 : public MDx_HashFunction +class BOTAN_DLL SHA_160 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/sha256.h b/include/sha256.h index 912eb3dfe..cdbe02822 100644 --- a/include/sha256.h +++ b/include/sha256.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * SHA-256 * *************************************************/ -class SHA_256 : public MDx_HashFunction +class BOTAN_DLL SHA_256 : public MDx_HashFunction { public: void clear() throw(); diff --git a/include/sha_64.h b/include/sha_64.h index 6535fa6c3..e590d088d 100644 --- a/include/sha_64.h +++ b/include/sha_64.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * SHA-{384,512} Base * *************************************************/ -class SHA_64_BASE : public MDx_HashFunction +class BOTAN_DLL SHA_64_BASE : public MDx_HashFunction { protected: void clear() throw(); @@ -29,7 +29,7 @@ class SHA_64_BASE : public MDx_HashFunction /************************************************* * SHA-384 * *************************************************/ -class SHA_384 : public SHA_64_BASE +class BOTAN_DLL SHA_384 : public SHA_64_BASE { public: void clear() throw(); @@ -41,7 +41,7 @@ class SHA_384 : public SHA_64_BASE /************************************************* * SHA-512 * *************************************************/ -class SHA_512 : public SHA_64_BASE +class BOTAN_DLL SHA_512 : public SHA_64_BASE { public: void clear() throw(); diff --git a/include/skipjack.h b/include/skipjack.h index 602eabdc3..240148f19 100644 --- a/include/skipjack.h +++ b/include/skipjack.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Skipjack * *************************************************/ -class Skipjack : public BlockCipher +class BOTAN_DLL Skipjack : public BlockCipher { public: void clear() throw(); diff --git a/include/square.h b/include/square.h index 863ed8864..efbc6e730 100644 --- a/include/square.h +++ b/include/square.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Square * *************************************************/ -class Square : public BlockCipher +class BOTAN_DLL Square : public BlockCipher { public: void clear() throw(); @@ -27,9 +27,19 @@ class Square : public BlockCipher static void transform(u32bit[4]); - static const byte SE[256], SD[256], Log[256], ALog[255]; - static const u32bit TE0[256], TE1[256], TE2[256], TE3[256], - TD0[256], TD1[256], TD2[256], TD3[256]; + static const byte SE[256]; + static const byte SD[256]; + static const byte Log[256]; + static const byte ALog[255]; + + static const u32bit TE0[256]; + static const u32bit TE1[256]; + static const u32bit TE2[256]; + static const u32bit TE3[256]; + static const u32bit TD0[256]; + static const u32bit TD1[256]; + static const u32bit TD2[256]; + static const u32bit TD3[256]; SecureBuffer<u32bit, 28> EK, DK; SecureBuffer<byte, 32> ME, MD; diff --git a/include/symkey.h b/include/symkey.h index c199f0cb1..ba77a94a4 100644 --- a/include/symkey.h +++ b/include/symkey.h @@ -14,7 +14,7 @@ namespace Botan { /************************************************* * Octet String * *************************************************/ -class OctetString +class BOTAN_DLL OctetString { public: u32bit length() const { return bits.size(); } @@ -45,10 +45,10 @@ class OctetString /************************************************* * Operations on Octet Strings * *************************************************/ -bool operator==(const OctetString&, const OctetString&); -bool operator!=(const OctetString&, const OctetString&); -OctetString operator+(const OctetString&, const OctetString&); -OctetString operator^(const OctetString&, const OctetString&); +BOTAN_DLL bool operator==(const OctetString&, const OctetString&); +BOTAN_DLL bool operator!=(const OctetString&, const OctetString&); +BOTAN_DLL OctetString operator+(const OctetString&, const OctetString&); +BOTAN_DLL OctetString operator^(const OctetString&, const OctetString&); /************************************************* * Alternate Names * diff --git a/include/tea.h b/include/tea.h index 3be8168ab..2fc9fe838 100644 --- a/include/tea.h +++ b/include/tea.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * TEA * *************************************************/ -class TEA : public BlockCipher +class BOTAN_DLL TEA : public BlockCipher { public: void clear() throw() { K.clear(); } diff --git a/include/tiger.h b/include/tiger.h index 4355886ae..4c95fa784 100644 --- a/include/tiger.h +++ b/include/tiger.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Tiger * *************************************************/ -class Tiger : public MDx_HashFunction +class BOTAN_DLL Tiger : public MDx_HashFunction { public: void clear() throw(); @@ -27,7 +27,10 @@ class Tiger : public MDx_HashFunction static void pass(u64bit&, u64bit&, u64bit&, u64bit[8], byte); static void mix(u64bit[8]); - static const u64bit SBOX1[256], SBOX2[256], SBOX3[256], SBOX4[256]; + static const u64bit SBOX1[256]; + static const u64bit SBOX2[256]; + static const u64bit SBOX3[256]; + static const u64bit SBOX4[256]; SecureBuffer<u64bit, 8> X; SecureBuffer<u64bit, 3> digest; diff --git a/include/timers.h b/include/timers.h index c4213de5b..b2384e480 100644 --- a/include/timers.h +++ b/include/timers.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Timer Interface * *************************************************/ -class Timer +class BOTAN_DLL Timer { public: virtual u64bit clock() const; diff --git a/include/turing.h b/include/turing.h index 1f31eea2d..14b2e6fd6 100644 --- a/include/turing.h +++ b/include/turing.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Turing * *************************************************/ -class Turing : public StreamCipher +class BOTAN_DLL Turing : public StreamCipher { public: void clear() throw(); @@ -31,7 +31,8 @@ class Turing : public StreamCipher const MemoryRegion<u32bit>&); static const u32bit Q_BOX[256]; - static const byte SBOX[256], OFFSETS[272]; + static const byte SBOX[256]; + static const byte OFFSETS[272]; SecureBuffer<u32bit, 256> S0, S1, S2, S3; SecureBuffer<u32bit, 17> R; diff --git a/include/twofish.h b/include/twofish.h index 1b2f545b1..8519a9aa8 100644 --- a/include/twofish.h +++ b/include/twofish.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Twofish * *************************************************/ -class Twofish : public BlockCipher +class BOTAN_DLL Twofish : public BlockCipher { public: void clear() throw(); @@ -27,9 +27,15 @@ class Twofish : public BlockCipher static void rs_mul(byte[4], byte, u32bit); - static const u32bit MDS0[256], MDS1[256], MDS2[256], MDS3[256]; - static const byte Q0[256], Q1[256], RS[32]; - static const byte EXP_TO_POLY[255], POLY_TO_EXP[255]; + static const u32bit MDS0[256]; + static const u32bit MDS1[256]; + static const u32bit MDS2[256]; + static const u32bit MDS3[256]; + static const byte Q0[256]; + static const byte Q1[256]; + static const byte RS[32]; + static const byte EXP_TO_POLY[255]; + static const byte POLY_TO_EXP[255]; SecureBuffer<u32bit, 256> SBox0, SBox1, SBox2, SBox3; SecureBuffer<u32bit, 40> round_key; diff --git a/include/ui.h b/include/ui.h index 09a6dd396..57a96780a 100644 --- a/include/ui.h +++ b/include/ui.h @@ -6,6 +6,7 @@ #ifndef BOTAN_UI_H__ #define BOTAN_UI_H__ +#include <botan/build.h> #include <string> namespace Botan { @@ -13,7 +14,7 @@ namespace Botan { /************************************************* * User Interface * *************************************************/ -class User_Interface +class BOTAN_DLL User_Interface { public: enum UI_Result { OK, CANCEL_ACTION }; diff --git a/include/util.h b/include/util.h index f3817cd7e..5feab59c1 100644 --- a/include/util.h +++ b/include/util.h @@ -13,26 +13,26 @@ namespace Botan { /************************************************* * Timer Access Functions * *************************************************/ -u64bit system_time(); -u64bit system_clock(); +BOTAN_DLL u64bit system_time(); +BOTAN_DLL u64bit system_clock(); /************************************************* * Memory Locking Functions * *************************************************/ -void lock_mem(void*, u32bit); -void unlock_mem(void*, u32bit); +BOTAN_DLL void lock_mem(void*, u32bit); +BOTAN_DLL void unlock_mem(void*, u32bit); /************************************************* * Misc Utility Functions * *************************************************/ -u32bit round_up(u32bit, u32bit); -u32bit round_down(u32bit, u32bit); +BOTAN_DLL u32bit round_up(u32bit, u32bit); +BOTAN_DLL u32bit round_down(u32bit, u32bit); /************************************************* * Work Factor Estimates * *************************************************/ -u32bit entropy_estimate(const byte[], u32bit); -u32bit dl_work_factor(u32bit); +BOTAN_DLL u32bit entropy_estimate(const byte[], u32bit); +BOTAN_DLL u32bit dl_work_factor(u32bit); } diff --git a/include/version.h b/include/version.h index 1e36a6984..6604b1885 100644 --- a/include/version.h +++ b/include/version.h @@ -14,10 +14,10 @@ namespace Botan { /************************************************* * Get information describing the version * *************************************************/ -std::string version_string(); -u32bit version_major(); -u32bit version_minor(); -u32bit version_patch(); +BOTAN_DLL std::string version_string(); +BOTAN_DLL u32bit version_major(); +BOTAN_DLL u32bit version_minor(); +BOTAN_DLL u32bit version_patch(); /************************************************* * Macros for compile-time version checks * diff --git a/include/whrlpool.h b/include/whrlpool.h index c7c40f4cc..22f747520 100644 --- a/include/whrlpool.h +++ b/include/whrlpool.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Whirlpool * *************************************************/ -class Whirlpool : public MDx_HashFunction +class BOTAN_DLL Whirlpool : public MDx_HashFunction { public: void clear() throw(); @@ -24,8 +24,14 @@ class Whirlpool : public MDx_HashFunction void hash(const byte[]); void copy_out(byte[]); - static const u64bit C0[256], C1[256], C2[256], C3[256], - C4[256], C5[256], C6[256], C7[256]; + static const u64bit C0[256]; + static const u64bit C1[256]; + static const u64bit C2[256]; + static const u64bit C3[256]; + static const u64bit C4[256]; + static const u64bit C5[256]; + static const u64bit C6[256]; + static const u64bit C7[256]; SecureBuffer<u64bit, 8> M, digest; }; diff --git a/include/wid_wake.h b/include/wid_wake.h index 17f2d72f7..09171a8f5 100644 --- a/include/wid_wake.h +++ b/include/wid_wake.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * WiderWake4+1-BE * *************************************************/ -class WiderWake_41_BE : public StreamCipher +class BOTAN_DLL WiderWake_41_BE : public StreamCipher { public: void clear() throw(); diff --git a/include/x509_ca.h b/include/x509_ca.h index 3c2610d7f..f6564d045 100644 --- a/include/x509_ca.h +++ b/include/x509_ca.h @@ -18,7 +18,7 @@ namespace Botan { /************************************************* * X.509 Certificate Authority * *************************************************/ -class X509_CA +class BOTAN_DLL X509_CA { public: X509_Certificate sign_request(const PKCS10_Request& req, @@ -53,7 +53,8 @@ class X509_CA /************************************************* * Choose a signing format for the key * *************************************************/ -PK_Signer* choose_sig_format(const Private_Key&, AlgorithmIdentifier&); +BOTAN_DLL PK_Signer* choose_sig_format(const Private_Key&, + AlgorithmIdentifier&); } diff --git a/include/x509_crl.h b/include/x509_crl.h index 2b1f6d14d..f7623b940 100644 --- a/include/x509_crl.h +++ b/include/x509_crl.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * X.509 CRL * *************************************************/ -class X509_CRL : public X509_Object +class BOTAN_DLL X509_CRL : public X509_Object { public: struct X509_CRL_Error : public Exception diff --git a/include/x509_ext.h b/include/x509_ext.h index 85aa47c92..079d6ae32 100644 --- a/include/x509_ext.h +++ b/include/x509_ext.h @@ -17,7 +17,7 @@ namespace Botan { /************************************************* * X.509 Certificate Extension * *************************************************/ -class Certificate_Extension +class BOTAN_DLL Certificate_Extension { public: OID oid_of() const; @@ -39,7 +39,7 @@ class Certificate_Extension /************************************************* * X.509 Certificate Extension List * *************************************************/ -class Extensions : public ASN1_Object +class BOTAN_DLL Extensions : public ASN1_Object { public: void encode_into(class DER_Encoder&) const; @@ -65,7 +65,7 @@ namespace Cert_Extension { /************************************************* * Basic Constraints Extension * *************************************************/ -class Basic_Constraints : public Certificate_Extension +class BOTAN_DLL Basic_Constraints : public Certificate_Extension { public: Basic_Constraints* copy() const @@ -91,7 +91,7 @@ class Basic_Constraints : public Certificate_Extension /************************************************* * Key Usage Constraints Extension * *************************************************/ -class Key_Usage : public Certificate_Extension +class BOTAN_DLL Key_Usage : public Certificate_Extension { public: Key_Usage* copy() const { return new Key_Usage(constraints); } @@ -114,7 +114,7 @@ class Key_Usage : public Certificate_Extension /************************************************* * Subject Key Identifier Extension * *************************************************/ -class Subject_Key_ID : public Certificate_Extension +class BOTAN_DLL Subject_Key_ID : public Certificate_Extension { public: Subject_Key_ID* copy() const { return new Subject_Key_ID(key_id); } @@ -138,7 +138,7 @@ class Subject_Key_ID : public Certificate_Extension /************************************************* * Authority Key Identifier Extension * *************************************************/ -class Authority_Key_ID : public Certificate_Extension +class BOTAN_DLL Authority_Key_ID : public Certificate_Extension { public: Authority_Key_ID* copy() const { return new Authority_Key_ID(key_id); } @@ -162,7 +162,7 @@ class Authority_Key_ID : public Certificate_Extension /************************************************* * Alternative Name Extension Base Class * *************************************************/ -class Alternative_Name : public Certificate_Extension +class BOTAN_DLL Alternative_Name : public Certificate_Extension { public: AlternativeName get_alt_name() const { return alt_name; } @@ -188,7 +188,7 @@ class Alternative_Name : public Certificate_Extension /************************************************* * Subject Alternative Name Extension * *************************************************/ -class Subject_Alternative_Name : public Alternative_Name +class BOTAN_DLL Subject_Alternative_Name : public Alternative_Name { public: Subject_Alternative_Name* copy() const @@ -200,7 +200,7 @@ class Subject_Alternative_Name : public Alternative_Name /************************************************* * Issuer Alternative Name Extension * *************************************************/ -class Issuer_Alternative_Name : public Alternative_Name +class BOTAN_DLL Issuer_Alternative_Name : public Alternative_Name { public: Issuer_Alternative_Name* copy() const @@ -212,7 +212,7 @@ class Issuer_Alternative_Name : public Alternative_Name /************************************************* * Extended Key Usage Extension * *************************************************/ -class Extended_Key_Usage : public Certificate_Extension +class BOTAN_DLL Extended_Key_Usage : public Certificate_Extension { public: Extended_Key_Usage* copy() const { return new Extended_Key_Usage(oids); } @@ -236,7 +236,7 @@ class Extended_Key_Usage : public Certificate_Extension /************************************************* * Certificate Policies Extension * *************************************************/ -class Certificate_Policies : public Certificate_Extension +class BOTAN_DLL Certificate_Policies : public Certificate_Extension { public: Certificate_Policies* copy() const @@ -261,7 +261,7 @@ class Certificate_Policies : public Certificate_Extension /************************************************* * CRL Number Extension * *************************************************/ -class CRL_Number : public Certificate_Extension +class BOTAN_DLL CRL_Number : public Certificate_Extension { public: CRL_Number* copy() const; @@ -286,7 +286,7 @@ class CRL_Number : public Certificate_Extension /************************************************* * CRL Entry Reason Code Extension * *************************************************/ -class CRL_ReasonCode : public Certificate_Extension +class BOTAN_DLL CRL_ReasonCode : public Certificate_Extension { public: CRL_ReasonCode* copy() const { return new CRL_ReasonCode(reason); } diff --git a/include/x509_key.h b/include/x509_key.h index a07268e53..6f45887ca 100644 --- a/include/x509_key.h +++ b/include/x509_key.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * X.509 Public Key Encoder * *************************************************/ -class X509_Encoder +class BOTAN_DLL X509_Encoder { public: virtual AlgorithmIdentifier alg_id() const = 0; @@ -26,7 +26,7 @@ class X509_Encoder /************************************************* * X.509 Public Key Decoder * *************************************************/ -class X509_Decoder +class BOTAN_DLL X509_Decoder { public: virtual void alg_id(const AlgorithmIdentifier&) = 0; @@ -39,16 +39,16 @@ namespace X509 { /************************************************* * X.509 Public Key Encoding/Decoding * *************************************************/ -void encode(const Public_Key&, Pipe&, X509_Encoding = PEM); -std::string PEM_encode(const Public_Key&); +BOTAN_DLL void encode(const Public_Key&, Pipe&, X509_Encoding = PEM); +BOTAN_DLL std::string PEM_encode(const Public_Key&); -Public_Key* load_key(DataSource&); -Public_Key* load_key(const std::string&); -Public_Key* load_key(const MemoryRegion<byte>&); +BOTAN_DLL Public_Key* load_key(DataSource&); +BOTAN_DLL Public_Key* load_key(const std::string&); +BOTAN_DLL Public_Key* load_key(const MemoryRegion<byte>&); -Public_Key* copy_key(const Public_Key&); +BOTAN_DLL Public_Key* copy_key(const Public_Key&); -Key_Constraints find_constraints(const Public_Key&, Key_Constraints); +BOTAN_DLL Key_Constraints find_constraints(const Public_Key&, Key_Constraints); } diff --git a/include/x509_obj.h b/include/x509_obj.h index 6e5eb6d17..88110d9ad 100644 --- a/include/x509_obj.h +++ b/include/x509_obj.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Generic X.509 SIGNED Object * *************************************************/ -class X509_Object +class BOTAN_DLL X509_Object { public: SecureVector<byte> tbs_data() const; diff --git a/include/x509cert.h b/include/x509cert.h index c94b46b14..c8dc2c435 100644 --- a/include/x509cert.h +++ b/include/x509cert.h @@ -17,7 +17,7 @@ namespace Botan { /************************************************* * X.509 Certificate * *************************************************/ -class X509_Certificate : public X509_Object +class BOTAN_DLL X509_Certificate : public X509_Object { public: Public_Key* subject_public_key() const; @@ -59,13 +59,13 @@ class X509_Certificate : public X509_Object /************************************************* * X.509 Certificate Comparison * *************************************************/ -bool operator!=(const X509_Certificate&, const X509_Certificate&); +BOTAN_DLL bool operator!=(const X509_Certificate&, const X509_Certificate&); /************************************************* * Data Store Extraction Operations * *************************************************/ -X509_DN create_dn(const Data_Store&); -AlternativeName create_alt_name(const Data_Store&); +BOTAN_DLL X509_DN create_dn(const Data_Store&); +BOTAN_DLL AlternativeName create_alt_name(const Data_Store&); } diff --git a/include/x509find.h b/include/x509find.h index eea4315c6..65781199f 100644 --- a/include/x509find.h +++ b/include/x509find.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * Search based on the contents of a DN entry * *************************************************/ -class DN_Check : public X509_Store::Search_Func +class BOTAN_DLL DN_Check : public X509_Store::Search_Func { public: typedef bool (*compare_fn)(const std::string&, const std::string&); @@ -31,7 +31,7 @@ class DN_Check : public X509_Store::Search_Func /************************************************* * Search for a certificate by issuer/serial * *************************************************/ -class IandS_Match : public X509_Store::Search_Func +class BOTAN_DLL IandS_Match : public X509_Store::Search_Func { public: bool match(const X509_Certificate& cert) const; @@ -44,7 +44,7 @@ class IandS_Match : public X509_Store::Search_Func /************************************************* * Search for a certificate by subject keyid * *************************************************/ -class SKID_Match : public X509_Store::Search_Func +class BOTAN_DLL SKID_Match : public X509_Store::Search_Func { public: bool match(const X509_Certificate& cert) const; diff --git a/include/x509self.h b/include/x509self.h index 4ad7f8f5c..8f3308492 100644 --- a/include/x509self.h +++ b/include/x509self.h @@ -15,7 +15,7 @@ namespace Botan { /************************************************* * Options for X.509 Certificates * *************************************************/ -class X509_Cert_Options +class BOTAN_DLL X509_Cert_Options { public: std::string common_name; @@ -56,14 +56,14 @@ namespace X509 { /************************************************* * Create a self-signed X.509 certificate * *************************************************/ -X509_Certificate create_self_signed_cert(const X509_Cert_Options&, - const Private_Key&); +BOTAN_DLL X509_Certificate create_self_signed_cert(const X509_Cert_Options&, + const Private_Key&); /************************************************* * Create a PKCS #10 certificate request * *************************************************/ -PKCS10_Request create_cert_req(const X509_Cert_Options&, - const Private_Key&); +BOTAN_DLL PKCS10_Request create_cert_req(const X509_Cert_Options&, + const Private_Key&); } diff --git a/include/x509stat.h b/include/x509stat.h index 4f734941f..6ed7c2a08 100644 --- a/include/x509stat.h +++ b/include/x509stat.h @@ -10,7 +10,7 @@ namespace Botan { /************************************************* * Prototype for a Certificate Extension * *************************************************/ -class Extension_Prototype +class BOTAN_DLL Extension_Prototype { public: virtual class Certificate_Extension* make(const OID&) = 0; @@ -20,7 +20,7 @@ class Extension_Prototype /************************************************* * X.509 Global State * *************************************************/ -class X509_GlobalState +class BOTAN_DLL X509_GlobalState { public: void add(Extension_Prototype*); diff --git a/include/x509stor.h b/include/x509stor.h index e12400a9e..d033e3daf 100644 --- a/include/x509stor.h +++ b/include/x509stor.h @@ -43,10 +43,10 @@ enum X509_Code { /************************************************* * X.509 Certificate Store * *************************************************/ -class X509_Store +class BOTAN_DLL X509_Store { public: - class Search_Func + class BOTAN_DLL Search_Func { public: virtual bool match(const X509_Certificate&) const = 0; @@ -84,7 +84,7 @@ class X509_Store private: X509_Store& operator=(const X509_Store&) { return (*this); } - class Cert_Info + class BOTAN_DLL Cert_Info { public: bool is_verified() const; @@ -101,7 +101,7 @@ class X509_Store mutable u64bit last_checked; }; - class CRL_Data + class BOTAN_DLL CRL_Data { public: X509_DN issuer; diff --git a/include/x919_mac.h b/include/x919_mac.h index d8cca9315..bedb2cf58 100644 --- a/include/x919_mac.h +++ b/include/x919_mac.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * ANSI X9.19 MAC * *************************************************/ -class ANSI_X919_MAC : public MessageAuthenticationCode +class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode { public: void clear() throw(); diff --git a/include/x931_rng.h b/include/x931_rng.h index 771ab64c6..3cfa52b6a 100644 --- a/include/x931_rng.h +++ b/include/x931_rng.h @@ -13,7 +13,7 @@ namespace Botan { /************************************************* * ANSI X9.31 RNG * *************************************************/ -class ANSI_X931_RNG : public RandomNumberGenerator +class BOTAN_DLL ANSI_X931_RNG : public RandomNumberGenerator { public: void randomize(byte[], u32bit) throw(PRNG_Unseeded); |