diff options
Diffstat (limited to 'src/lib/pubkey')
38 files changed, 107 insertions, 107 deletions
diff --git a/src/lib/pubkey/blinding.h b/src/lib/pubkey/blinding.h index bc05d97e7..805b1a070 100644 --- a/src/lib/pubkey/blinding.h +++ b/src/lib/pubkey/blinding.h @@ -19,7 +19,7 @@ class RandomNumberGenerator; /** * Blinding Function Object. */ -class BOTAN_DLL Blinder +class BOTAN_PUBLIC_API(2,0) Blinder { public: /** diff --git a/src/lib/pubkey/cecpq1/cecpq1.h b/src/lib/pubkey/cecpq1/cecpq1.h index 9fe0b04ae..cad3acade 100644 --- a/src/lib/pubkey/cecpq1/cecpq1.h +++ b/src/lib/pubkey/cecpq1/cecpq1.h @@ -20,16 +20,16 @@ class CECPQ1_key newhope_poly m_newhope; }; -void BOTAN_DLL CECPQ1_offer(uint8_t* offer_message, +void BOTAN_PUBLIC_API(2,0) CECPQ1_offer(uint8_t* offer_message, CECPQ1_key* offer_key_output, RandomNumberGenerator& rng); -void BOTAN_DLL CECPQ1_accept(uint8_t* shared_key, +void BOTAN_PUBLIC_API(2,0) CECPQ1_accept(uint8_t* shared_key, uint8_t* accept_message, const uint8_t* offer_message, RandomNumberGenerator& rng); -void BOTAN_DLL CECPQ1_finish(uint8_t* shared_key, +void BOTAN_PUBLIC_API(2,0) CECPQ1_finish(uint8_t* shared_key, const CECPQ1_key& offer_key, const uint8_t* accept_message); diff --git a/src/lib/pubkey/curve25519/curve25519.h b/src/lib/pubkey/curve25519/curve25519.h index da64113d5..b148facf1 100644 --- a/src/lib/pubkey/curve25519/curve25519.h +++ b/src/lib/pubkey/curve25519/curve25519.h @@ -12,7 +12,7 @@ namespace Botan { -class BOTAN_DLL Curve25519_PublicKey : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) Curve25519_PublicKey : public virtual Public_Key { public: std::string algo_name() const override { return "Curve25519"; } @@ -55,7 +55,7 @@ class BOTAN_DLL Curve25519_PublicKey : public virtual Public_Key std::vector<uint8_t> m_public; }; -class BOTAN_DLL Curve25519_PrivateKey : public Curve25519_PublicKey, +class BOTAN_PUBLIC_API(2,0) Curve25519_PrivateKey : public Curve25519_PublicKey, public virtual Private_Key, public virtual PK_Key_Agreement_Key { @@ -103,7 +103,7 @@ class BOTAN_DLL Curve25519_PrivateKey : public Curve25519_PublicKey, * The types above are just wrappers for curve25519_donna, plus defining * encodings for public and private keys. */ -void BOTAN_DLL curve25519_donna(uint8_t mypublic[32], +void BOTAN_PUBLIC_API(2,0) curve25519_donna(uint8_t mypublic[32], const uint8_t secret[32], const uint8_t basepoint[32]); @@ -112,7 +112,7 @@ void BOTAN_DLL curve25519_donna(uint8_t mypublic[32], * @param mypublic output value * @param secret random scalar */ -void BOTAN_DLL curve25519_basepoint(uint8_t mypublic[32], +void BOTAN_PUBLIC_API(2,0) curve25519_basepoint(uint8_t mypublic[32], const uint8_t secret[32]); } diff --git a/src/lib/pubkey/dh/dh.h b/src/lib/pubkey/dh/dh.h index f3f4b746b..359d68f10 100644 --- a/src/lib/pubkey/dh/dh.h +++ b/src/lib/pubkey/dh/dh.h @@ -15,7 +15,7 @@ namespace Botan { /** * This class represents Diffie-Hellman public keys. */ -class BOTAN_DLL DH_PublicKey : public virtual DL_Scheme_PublicKey +class BOTAN_PUBLIC_API(2,0) DH_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const override { return "DH"; } @@ -46,7 +46,7 @@ class BOTAN_DLL DH_PublicKey : public virtual DL_Scheme_PublicKey /** * This class represents Diffie-Hellman private keys. */ -class BOTAN_DLL DH_PrivateKey : public DH_PublicKey, +class BOTAN_PUBLIC_API(2,0) DH_PrivateKey : public DH_PublicKey, public PK_Key_Agreement_Key, public virtual DL_Scheme_PrivateKey { diff --git a/src/lib/pubkey/dl_algo/dl_algo.h b/src/lib/pubkey/dl_algo/dl_algo.h index 94bf24387..c2ea6e0b9 100644 --- a/src/lib/pubkey/dl_algo/dl_algo.h +++ b/src/lib/pubkey/dl_algo/dl_algo.h @@ -16,7 +16,7 @@ namespace Botan { /** * This class represents discrete logarithm (DL) public keys. */ -class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) DL_Scheme_PublicKey : public virtual Public_Key { public: bool check_key(RandomNumberGenerator& rng, bool) const override; @@ -92,7 +92,7 @@ class BOTAN_DLL DL_Scheme_PublicKey : public virtual Public_Key /** * This class represents discrete logarithm (DL) private keys. */ -class BOTAN_DLL DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey, +class BOTAN_PUBLIC_API(2,0) DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey, public virtual Private_Key { public: diff --git a/src/lib/pubkey/dl_group/dl_group.h b/src/lib/pubkey/dl_group/dl_group.h index 7cbf81c20..a5ec71fd7 100644 --- a/src/lib/pubkey/dl_group/dl_group.h +++ b/src/lib/pubkey/dl_group/dl_group.h @@ -17,7 +17,7 @@ namespace Botan { * This class represents discrete logarithm groups. It holds a prime p, * a prime q = (p-1)/2 and g = x^((p-1)/q) mod p. */ -class BOTAN_DLL DL_Group +class BOTAN_PUBLIC_API(2,0) DL_Group { public: diff --git a/src/lib/pubkey/dlies/dlies.h b/src/lib/pubkey/dlies/dlies.h index 54b8f3f48..8220356c1 100644 --- a/src/lib/pubkey/dlies/dlies.h +++ b/src/lib/pubkey/dlies/dlies.h @@ -20,7 +20,7 @@ namespace Botan { /** * DLIES Encryption */ -class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor +class BOTAN_PUBLIC_API(2,0) DLIES_Encryptor : public PK_Encryptor { public: /** @@ -93,7 +93,7 @@ class BOTAN_DLL DLIES_Encryptor : public PK_Encryptor /** * DLIES Decryption */ -class BOTAN_DLL DLIES_Decryptor : public PK_Decryptor +class BOTAN_PUBLIC_API(2,0) DLIES_Decryptor : public PK_Decryptor { public: /** diff --git a/src/lib/pubkey/dsa/dsa.h b/src/lib/pubkey/dsa/dsa.h index 8fa338748..085439c99 100644 --- a/src/lib/pubkey/dsa/dsa.h +++ b/src/lib/pubkey/dsa/dsa.h @@ -15,7 +15,7 @@ namespace Botan { /** * DSA Public Key */ -class BOTAN_DLL DSA_PublicKey : public virtual DL_Scheme_PublicKey +class BOTAN_PUBLIC_API(2,0) DSA_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const override { return "DSA"; } @@ -52,7 +52,7 @@ class BOTAN_DLL DSA_PublicKey : public virtual DL_Scheme_PublicKey /** * DSA Private Key */ -class BOTAN_DLL DSA_PrivateKey : public DSA_PublicKey, +class BOTAN_PUBLIC_API(2,0) DSA_PrivateKey : public DSA_PublicKey, public virtual DL_Scheme_PrivateKey { public: diff --git a/src/lib/pubkey/ec_group/ec_group.h b/src/lib/pubkey/ec_group/ec_group.h index a2cd4d719..0bedd4f52 100644 --- a/src/lib/pubkey/ec_group/ec_group.h +++ b/src/lib/pubkey/ec_group/ec_group.h @@ -28,7 +28,7 @@ enum EC_Group_Encoding { /** * Class representing an elliptic curve */ -class BOTAN_DLL EC_Group +class BOTAN_PUBLIC_API(2,0) EC_Group { public: diff --git a/src/lib/pubkey/ecc_key/ecc_key.h b/src/lib/pubkey/ecc_key/ecc_key.h index fc60bb17c..11363b613 100644 --- a/src/lib/pubkey/ecc_key/ecc_key.h +++ b/src/lib/pubkey/ecc_key/ecc_key.h @@ -26,7 +26,7 @@ namespace Botan { * cannot be used for verification until its domain parameters are set * by calling the corresponding member function. */ -class BOTAN_DLL EC_PublicKey : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) EC_PublicKey : public virtual Public_Key { public: /** @@ -107,7 +107,7 @@ class BOTAN_DLL EC_PublicKey : public virtual Public_Key /** * This abstract class represents ECC private keys */ -class BOTAN_DLL EC_PrivateKey : public virtual EC_PublicKey, +class BOTAN_PUBLIC_API(2,0) EC_PrivateKey : public virtual EC_PublicKey, public virtual Private_Key { public: diff --git a/src/lib/pubkey/ecdh/ecdh.h b/src/lib/pubkey/ecdh/ecdh.h index baa3f6f94..630917969 100644 --- a/src/lib/pubkey/ecdh/ecdh.h +++ b/src/lib/pubkey/ecdh/ecdh.h @@ -17,7 +17,7 @@ namespace Botan { /** * This class represents ECDH Public Keys. */ -class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey +class BOTAN_PUBLIC_API(2,0) ECDH_PublicKey : public virtual EC_PublicKey { public: /** @@ -63,7 +63,7 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey /** * This class represents ECDH Private Keys. */ -class BOTAN_DLL ECDH_PrivateKey : public ECDH_PublicKey, +class BOTAN_PUBLIC_API(2,0) ECDH_PrivateKey : public ECDH_PublicKey, public EC_PrivateKey, public PK_Key_Agreement_Key { diff --git a/src/lib/pubkey/ecdsa/ecdsa.h b/src/lib/pubkey/ecdsa/ecdsa.h index 304a27776..2af571c9b 100644 --- a/src/lib/pubkey/ecdsa/ecdsa.h +++ b/src/lib/pubkey/ecdsa/ecdsa.h @@ -17,7 +17,7 @@ namespace Botan { /** * This class represents ECDSA Public Keys. */ -class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey +class BOTAN_PUBLIC_API(2,0) ECDSA_PublicKey : public virtual EC_PublicKey { public: @@ -60,7 +60,7 @@ class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey /** * This class represents ECDSA Private Keys */ -class BOTAN_DLL ECDSA_PrivateKey : public ECDSA_PublicKey, +class BOTAN_PUBLIC_API(2,0) ECDSA_PrivateKey : public ECDSA_PublicKey, public EC_PrivateKey { public: diff --git a/src/lib/pubkey/ecgdsa/ecgdsa.h b/src/lib/pubkey/ecgdsa/ecgdsa.h index 06a675531..4a9f62240 100644 --- a/src/lib/pubkey/ecgdsa/ecgdsa.h +++ b/src/lib/pubkey/ecgdsa/ecgdsa.h @@ -15,7 +15,7 @@ namespace Botan { /** * This class represents ECGDSA public keys. */ -class BOTAN_DLL ECGDSA_PublicKey : public virtual EC_PublicKey +class BOTAN_PUBLIC_API(2,0) ECGDSA_PublicKey : public virtual EC_PublicKey { public: @@ -58,7 +58,7 @@ class BOTAN_DLL ECGDSA_PublicKey : public virtual EC_PublicKey /** * This class represents ECGDSA private keys. */ -class BOTAN_DLL ECGDSA_PrivateKey : public ECGDSA_PublicKey, +class BOTAN_PUBLIC_API(2,0) ECGDSA_PrivateKey : public ECGDSA_PublicKey, public EC_PrivateKey { public: diff --git a/src/lib/pubkey/ecies/ecies.h b/src/lib/pubkey/ecies/ecies.h index 958ef1b9e..a5d2538cb 100644 --- a/src/lib/pubkey/ecies/ecies.h +++ b/src/lib/pubkey/ecies/ecies.h @@ -56,7 +56,7 @@ inline ECIES_Flags operator &(ECIES_Flags a, ECIES_Flags b) /** * Parameters for ECIES secret derivation */ -class BOTAN_DLL ECIES_KA_Params +class BOTAN_PUBLIC_API(2,0) ECIES_KA_Params { public: /** @@ -122,7 +122,7 @@ class BOTAN_DLL ECIES_KA_Params }; -class BOTAN_DLL ECIES_System_Params : public ECIES_KA_Params +class BOTAN_PUBLIC_API(2,0) ECIES_System_Params : public ECIES_KA_Params { public: /** @@ -183,7 +183,7 @@ class BOTAN_DLL ECIES_System_Params : public ECIES_KA_Params /** * ECIES secret derivation according to ISO 18033-2 */ -class BOTAN_DLL ECIES_KA_Operation +class BOTAN_PUBLIC_API(2,0) ECIES_KA_Operation { public: /** @@ -215,7 +215,7 @@ class BOTAN_DLL ECIES_KA_Operation /** * ECIES Encryption according to ISO 18033-2 */ -class BOTAN_DLL ECIES_Encryptor : public PK_Encryptor +class BOTAN_PUBLIC_API(2,0) ECIES_Encryptor : public PK_Encryptor { public: /** @@ -272,7 +272,7 @@ class BOTAN_DLL ECIES_Encryptor : public PK_Encryptor /** * ECIES Decryption according to ISO 18033-2 */ -class BOTAN_DLL ECIES_Decryptor : public PK_Decryptor +class BOTAN_PUBLIC_API(2,0) ECIES_Decryptor : public PK_Decryptor { public: /** diff --git a/src/lib/pubkey/eckcdsa/eckcdsa.h b/src/lib/pubkey/eckcdsa/eckcdsa.h index 3959c5f78..0ee8abd21 100644 --- a/src/lib/pubkey/eckcdsa/eckcdsa.h +++ b/src/lib/pubkey/eckcdsa/eckcdsa.h @@ -15,7 +15,7 @@ namespace Botan { /** * This class represents ECKCDSA public keys. */ -class BOTAN_DLL ECKCDSA_PublicKey : public virtual EC_PublicKey +class BOTAN_PUBLIC_API(2,0) ECKCDSA_PublicKey : public virtual EC_PublicKey { public: @@ -58,7 +58,7 @@ class BOTAN_DLL ECKCDSA_PublicKey : public virtual EC_PublicKey /** * This class represents ECKCDSA private keys. */ -class BOTAN_DLL ECKCDSA_PrivateKey : public ECKCDSA_PublicKey, +class BOTAN_PUBLIC_API(2,0) ECKCDSA_PrivateKey : public ECKCDSA_PublicKey, public EC_PrivateKey { public: diff --git a/src/lib/pubkey/elgamal/elgamal.h b/src/lib/pubkey/elgamal/elgamal.h index 33345d56f..1afe89414 100644 --- a/src/lib/pubkey/elgamal/elgamal.h +++ b/src/lib/pubkey/elgamal/elgamal.h @@ -15,7 +15,7 @@ namespace Botan { /** * ElGamal Public Key */ -class BOTAN_DLL ElGamal_PublicKey : public virtual DL_Scheme_PublicKey +class BOTAN_PUBLIC_API(2,0) ElGamal_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const override { return "ElGamal"; } @@ -50,7 +50,7 @@ class BOTAN_DLL ElGamal_PublicKey : public virtual DL_Scheme_PublicKey /** * ElGamal Private Key */ -class BOTAN_DLL ElGamal_PrivateKey : public ElGamal_PublicKey, +class BOTAN_PUBLIC_API(2,0) ElGamal_PrivateKey : public ElGamal_PublicKey, public virtual DL_Scheme_PrivateKey { public: diff --git a/src/lib/pubkey/gost_3410/gost_3410.h b/src/lib/pubkey/gost_3410/gost_3410.h index c6fc148ca..85ac55ed3 100644 --- a/src/lib/pubkey/gost_3410/gost_3410.h +++ b/src/lib/pubkey/gost_3410/gost_3410.h @@ -17,7 +17,7 @@ namespace Botan { /** * GOST-34.10 Public Key */ -class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey +class BOTAN_PUBLIC_API(2,0) GOST_3410_PublicKey : public virtual EC_PublicKey { public: @@ -64,7 +64,7 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey /** * GOST-34.10 Private Key */ -class BOTAN_DLL GOST_3410_PrivateKey : public GOST_3410_PublicKey, +class BOTAN_PUBLIC_API(2,0) GOST_3410_PrivateKey : public GOST_3410_PublicKey, public EC_PrivateKey { public: diff --git a/src/lib/pubkey/keypair/keypair.h b/src/lib/pubkey/keypair/keypair.h index 894749583..ed7672340 100644 --- a/src/lib/pubkey/keypair/keypair.h +++ b/src/lib/pubkey/keypair/keypair.h @@ -23,7 +23,7 @@ namespace KeyPair { * @param padding the encryption padding method to use * @return true if consistent otherwise false */ -BOTAN_DLL bool +BOTAN_PUBLIC_API(2,0) bool encryption_consistency_check(RandomNumberGenerator& rng, const Private_Key& private_key, const Public_Key& public_key, @@ -38,7 +38,7 @@ encryption_consistency_check(RandomNumberGenerator& rng, * @param padding the signature padding method to use * @return true if consistent otherwise false */ -BOTAN_DLL bool +BOTAN_PUBLIC_API(2,0) bool signature_consistency_check(RandomNumberGenerator& rng, const Private_Key& private_key, const Public_Key& public_key, diff --git a/src/lib/pubkey/mce/gf2m_small_m.h b/src/lib/pubkey/mce/gf2m_small_m.h index d8c5f5b8f..b15061267 100644 --- a/src/lib/pubkey/mce/gf2m_small_m.h +++ b/src/lib/pubkey/mce/gf2m_small_m.h @@ -22,7 +22,7 @@ typedef uint16_t gf2m; /** * GF(2^m) field for m = [2...16] */ -class BOTAN_DLL GF2m_Field +class BOTAN_PUBLIC_API(2,0) GF2m_Field { public: explicit GF2m_Field(size_t extdeg); diff --git a/src/lib/pubkey/mce/mceliece.h b/src/lib/pubkey/mce/mceliece.h index 946083128..d18888784 100644 --- a/src/lib/pubkey/mce/mceliece.h +++ b/src/lib/pubkey/mce/mceliece.h @@ -18,7 +18,7 @@ namespace Botan { -class BOTAN_DLL McEliece_PublicKey : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) McEliece_PublicKey : public virtual Public_Key { public: explicit McEliece_PublicKey(const std::vector<uint8_t>& key_bits); @@ -67,7 +67,7 @@ class BOTAN_DLL McEliece_PublicKey : public virtual Public_Key uint32_t m_code_length; }; -class BOTAN_DLL McEliece_PrivateKey : public virtual McEliece_PublicKey, +class BOTAN_PUBLIC_API(2,0) McEliece_PrivateKey : public virtual McEliece_PublicKey, public virtual Private_Key { public: @@ -129,7 +129,7 @@ class BOTAN_DLL McEliece_PrivateKey : public virtual McEliece_PublicKey, * Estimate work factor for McEliece * @return estimated security level for these key parameters */ -BOTAN_DLL size_t mceliece_work_factor(size_t code_size, size_t t); +BOTAN_PUBLIC_API(2,0) size_t mceliece_work_factor(size_t code_size, size_t t); } diff --git a/src/lib/pubkey/mceies/mceies.h b/src/lib/pubkey/mceies/mceies.h index 372404cc1..a60f56e9b 100644 --- a/src/lib/pubkey/mceies/mceies.h +++ b/src/lib/pubkey/mceies/mceies.h @@ -22,7 +22,7 @@ class McEliece_PrivateKey; * plaintext and AD using AES-256 in OCB mode. */ secure_vector<uint8_t> -BOTAN_DLL mceies_encrypt(const McEliece_PublicKey& pubkey, +BOTAN_PUBLIC_API(2,0) mceies_encrypt(const McEliece_PublicKey& pubkey, const uint8_t pt[], size_t pt_len, const uint8_t ad[], size_t ad_len, RandomNumberGenerator& rng, @@ -34,7 +34,7 @@ BOTAN_DLL mceies_encrypt(const McEliece_PublicKey& pubkey, * ciphertext and AD using AES-256 in OCB mode. */ secure_vector<uint8_t> -BOTAN_DLL mceies_decrypt(const McEliece_PrivateKey& privkey, +BOTAN_PUBLIC_API(2,0) mceies_decrypt(const McEliece_PrivateKey& privkey, const uint8_t ct[], size_t ct_len, const uint8_t ad[], size_t ad_len, const std::string& aead = "AES-256/OCB"); diff --git a/src/lib/pubkey/pbes2/pbes2.h b/src/lib/pubkey/pbes2/pbes2.h index 951ba3178..0eaa6e2cf 100644 --- a/src/lib/pubkey/pbes2/pbes2.h +++ b/src/lib/pubkey/pbes2/pbes2.h @@ -24,7 +24,7 @@ namespace Botan { * @param rng a random number generator */ std::pair<AlgorithmIdentifier, std::vector<uint8_t>> -BOTAN_DLL pbes2_encrypt(const secure_vector<uint8_t>& key_bits, +BOTAN_PUBLIC_API(2,0) pbes2_encrypt(const secure_vector<uint8_t>& key_bits, const std::string& passphrase, std::chrono::milliseconds msec, const std::string& cipher, @@ -75,7 +75,7 @@ BOTAN_DLL pbes2_encrypt_iter(const secure_vector<uint8_t>& key_bits, * @param params the PBES2 parameters */ secure_vector<uint8_t> -BOTAN_DLL pbes2_decrypt(const secure_vector<uint8_t>& key_bits, +BOTAN_PUBLIC_API(2,0) pbes2_decrypt(const secure_vector<uint8_t>& key_bits, const std::string& passphrase, const std::vector<uint8_t>& params); diff --git a/src/lib/pubkey/pem/pem.h b/src/lib/pubkey/pem/pem.h index 1f9483ea8..c5f66aaf2 100644 --- a/src/lib/pubkey/pem/pem.h +++ b/src/lib/pubkey/pem/pem.h @@ -21,7 +21,7 @@ namespace PEM_Code { * @param label PEM label put after BEGIN and END * @param line_width after this many characters, a new line is inserted */ -BOTAN_DLL std::string encode(const uint8_t data[], +BOTAN_PUBLIC_API(2,0) std::string encode(const uint8_t data[], size_t data_len, const std::string& label, size_t line_width = 64); @@ -57,7 +57,7 @@ inline std::string encode(const secure_vector<uint8_t>& data, * @param pem a datasource containing PEM encoded data * @param label is set to the PEM label found for later inspection */ -BOTAN_DLL secure_vector<uint8_t> decode(DataSource& pem, +BOTAN_PUBLIC_API(2,0) secure_vector<uint8_t> decode(DataSource& pem, std::string& label); /** @@ -65,7 +65,7 @@ BOTAN_DLL secure_vector<uint8_t> decode(DataSource& pem, * @param pem a string containing PEM encoded data * @param label is set to the PEM label found for later inspection */ -BOTAN_DLL secure_vector<uint8_t> decode(const std::string& pem, +BOTAN_PUBLIC_API(2,0) secure_vector<uint8_t> decode(const std::string& pem, std::string& label); /** @@ -73,7 +73,7 @@ BOTAN_DLL secure_vector<uint8_t> decode(const std::string& pem, * @param pem a datasource containing PEM encoded data * @param label is what we expect the label to be */ -BOTAN_DLL secure_vector<uint8_t> decode_check_label( +BOTAN_PUBLIC_API(2,0) secure_vector<uint8_t> decode_check_label( DataSource& pem, const std::string& label); @@ -82,14 +82,14 @@ BOTAN_DLL secure_vector<uint8_t> decode_check_label( * @param pem a string containing PEM encoded data * @param label is what we expect the label to be */ -BOTAN_DLL secure_vector<uint8_t> decode_check_label( +BOTAN_PUBLIC_API(2,0) secure_vector<uint8_t> decode_check_label( const std::string& pem, const std::string& label); /** * Heuristic test for PEM data. */ -BOTAN_DLL bool matches(DataSource& source, +BOTAN_PUBLIC_API(2,0) bool matches(DataSource& source, const std::string& extra = "", size_t search_range = 4096); diff --git a/src/lib/pubkey/pk_algs.h b/src/lib/pubkey/pk_algs.h index 5deded423..b215914c1 100644 --- a/src/lib/pubkey/pk_algs.h +++ b/src/lib/pubkey/pk_algs.h @@ -14,11 +14,11 @@ namespace Botan { -BOTAN_DLL std::unique_ptr<Public_Key> +BOTAN_PUBLIC_API(2,0) std::unique_ptr<Public_Key> load_public_key(const AlgorithmIdentifier& alg_id, const std::vector<uint8_t>& key_bits); -BOTAN_DLL std::unique_ptr<Private_Key> +BOTAN_PUBLIC_API(2,0) std::unique_ptr<Private_Key> load_private_key(const AlgorithmIdentifier& alg_id, const secure_vector<uint8_t>& key_bits); @@ -30,7 +30,7 @@ load_private_key(const AlgorithmIdentifier& alg_id, * For McEliece, algo_params is n,t * If algo_params is left empty, suitable default parameters are chosen. */ -BOTAN_DLL std::unique_ptr<Private_Key> +BOTAN_PUBLIC_API(2,0) std::unique_ptr<Private_Key> create_private_key(const std::string& algo_name, RandomNumberGenerator& rng, const std::string& algo_params = "", diff --git a/src/lib/pubkey/pk_keys.h b/src/lib/pubkey/pk_keys.h index 13e0dc768..dacd68412 100644 --- a/src/lib/pubkey/pk_keys.h +++ b/src/lib/pubkey/pk_keys.h @@ -21,7 +21,7 @@ class RandomNumberGenerator; /** * Public Key Base Class. */ -class BOTAN_DLL Public_Key +class BOTAN_PUBLIC_API(2,0) Public_Key { public: Public_Key() =default; @@ -163,7 +163,7 @@ class BOTAN_DLL Public_Key /** * Private Key Base Class */ -class BOTAN_DLL Private_Key : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) Private_Key : public virtual Public_Key { public: Private_Key() = default; @@ -268,7 +268,7 @@ class BOTAN_DLL Private_Key : public virtual Public_Key /** * PK Secret Value Derivation Key */ -class BOTAN_DLL PK_Key_Agreement_Key : public virtual Private_Key +class BOTAN_PUBLIC_API(2,0) PK_Key_Agreement_Key : public virtual Private_Key { public: /* diff --git a/src/lib/pubkey/pk_ops.h b/src/lib/pubkey/pk_ops.h index d270954f9..40e541ddb 100644 --- a/src/lib/pubkey/pk_ops.h +++ b/src/lib/pubkey/pk_ops.h @@ -33,7 +33,7 @@ namespace PK_Ops { /** * Public key encryption interface */ -class BOTAN_DLL Encryption +class BOTAN_PUBLIC_API(2,0) Encryption { public: virtual secure_vector<uint8_t> encrypt(const uint8_t msg[], @@ -48,7 +48,7 @@ class BOTAN_DLL Encryption /** * Public key decryption interface */ -class BOTAN_DLL Decryption +class BOTAN_PUBLIC_API(2,0) Decryption { public: virtual secure_vector<uint8_t> decrypt(uint8_t& valid_mask, @@ -61,7 +61,7 @@ class BOTAN_DLL Decryption /** * Public key signature verification interface */ -class BOTAN_DLL Verification +class BOTAN_PUBLIC_API(2,0) Verification { public: /* @@ -83,7 +83,7 @@ class BOTAN_DLL Verification /** * Public key signature creation interface */ -class BOTAN_DLL Signature +class BOTAN_PUBLIC_API(2,0) Signature { public: /* @@ -105,7 +105,7 @@ class BOTAN_DLL Signature /** * A generic key agreement operation (eg DH or ECDH) */ -class BOTAN_DLL Key_Agreement +class BOTAN_PUBLIC_API(2,0) Key_Agreement { public: virtual secure_vector<uint8_t> agree(size_t key_len, @@ -118,7 +118,7 @@ class BOTAN_DLL Key_Agreement /** * KEM (key encapsulation) */ -class BOTAN_DLL KEM_Encryption +class BOTAN_PUBLIC_API(2,0) KEM_Encryption { public: virtual void kem_encrypt(secure_vector<uint8_t>& out_encapsulated_key, @@ -131,7 +131,7 @@ class BOTAN_DLL KEM_Encryption virtual ~KEM_Encryption() = default; }; -class BOTAN_DLL KEM_Decryption +class BOTAN_PUBLIC_API(2,0) KEM_Decryption { public: virtual secure_vector<uint8_t> kem_decrypt(const uint8_t encap_key[], diff --git a/src/lib/pubkey/pkcs8.h b/src/lib/pubkey/pkcs8.h index 71f10dd2f..e7799ebe0 100644 --- a/src/lib/pubkey/pkcs8.h +++ b/src/lib/pubkey/pkcs8.h @@ -17,7 +17,7 @@ namespace Botan { /** * PKCS #8 General Exception */ -struct BOTAN_DLL PKCS8_Exception : public Decoding_Error +struct BOTAN_PUBLIC_API(2,0) PKCS8_Exception : public Decoding_Error { explicit PKCS8_Exception(const std::string& error) : Decoding_Error("PKCS #8: " + error) {} @@ -33,14 +33,14 @@ namespace PKCS8 { * @param key the private key to encode * @return BER encoded key */ -BOTAN_DLL secure_vector<uint8_t> BER_encode(const Private_Key& key); +BOTAN_PUBLIC_API(2,0) secure_vector<uint8_t> BER_encode(const Private_Key& key); /** * Get a string containing a PEM encoded private key. * @param key the key to encode * @return encoded key */ -BOTAN_DLL std::string PEM_encode(const Private_Key& key); +BOTAN_PUBLIC_API(2,0) std::string PEM_encode(const Private_Key& key); /** * Encrypt a key using PKCS #8 encryption @@ -53,7 +53,7 @@ BOTAN_DLL std::string PEM_encode(const Private_Key& key); default will be chosen. * @return encrypted key in binary BER form */ -BOTAN_DLL std::vector<uint8_t> +BOTAN_PUBLIC_API(2,0) std::vector<uint8_t> BER_encode(const Private_Key& key, RandomNumberGenerator& rng, const std::string& pass, @@ -72,7 +72,7 @@ BER_encode(const Private_Key& key, default will be chosen. * @return encrypted key in PEM form */ -BOTAN_DLL std::string +BOTAN_PUBLIC_API(2,0) std::string PEM_encode(const Private_Key& key, RandomNumberGenerator& rng, const std::string& pass, @@ -177,7 +177,7 @@ PEM_encode_encrypted_pbkdf_msec(const Private_Key& key, * @param get_passphrase a function that returns passphrases * @return loaded private key object */ -BOTAN_DLL Private_Key* load_key(DataSource& source, +BOTAN_PUBLIC_API(2,0) Private_Key* load_key(DataSource& source, RandomNumberGenerator& rng, std::function<std::string ()> get_passphrase); @@ -187,7 +187,7 @@ BOTAN_DLL Private_Key* load_key(DataSource& source, * @param pass the passphrase to decrypt the key * @return loaded private key object */ -BOTAN_DLL Private_Key* load_key(DataSource& source, +BOTAN_PUBLIC_API(2,0) Private_Key* load_key(DataSource& source, RandomNumberGenerator& rng, const std::string& pass); @@ -196,7 +196,7 @@ BOTAN_DLL Private_Key* load_key(DataSource& source, * @param rng ignored for compatability * @return loaded private key object */ -BOTAN_DLL Private_Key* load_key(DataSource& source, +BOTAN_PUBLIC_API(2,0) Private_Key* load_key(DataSource& source, RandomNumberGenerator& rng); #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) @@ -207,7 +207,7 @@ BOTAN_DLL Private_Key* load_key(DataSource& source, * @param get_passphrase a function that returns passphrases * @return loaded private key object */ -BOTAN_DLL Private_Key* load_key(const std::string& filename, +BOTAN_PUBLIC_API(2,0) Private_Key* load_key(const std::string& filename, RandomNumberGenerator& rng, std::function<std::string ()> get_passphrase); @@ -217,7 +217,7 @@ BOTAN_DLL Private_Key* load_key(const std::string& filename, * @param pass the passphrase to decrypt the key * @return loaded private key object */ -BOTAN_DLL Private_Key* load_key(const std::string& filename, +BOTAN_PUBLIC_API(2,0) Private_Key* load_key(const std::string& filename, RandomNumberGenerator& rng, const std::string& pass); @@ -226,7 +226,7 @@ BOTAN_DLL Private_Key* load_key(const std::string& filename, * @param rng ignored for compatability * @return loaded private key object */ -BOTAN_DLL Private_Key* load_key(const std::string& filename, +BOTAN_PUBLIC_API(2,0) Private_Key* load_key(const std::string& filename, RandomNumberGenerator& rng); #endif @@ -236,7 +236,7 @@ BOTAN_DLL Private_Key* load_key(const std::string& filename, * @param rng ignored for compatability * @return new copy of the key */ -BOTAN_DLL Private_Key* copy_key(const Private_Key& key, +BOTAN_PUBLIC_API(2,0) Private_Key* copy_key(const Private_Key& key, RandomNumberGenerator& rng); } diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h index 93eb07894..e1bf4a421 100644 --- a/src/lib/pubkey/pubkey.h +++ b/src/lib/pubkey/pubkey.h @@ -32,7 +32,7 @@ enum Signature_Format { IEEE_1363, DER_SEQUENCE }; * Public Key Encryptor * This is the primary interface for public key encryption */ -class BOTAN_DLL PK_Encryptor +class BOTAN_PUBLIC_API(2,0) PK_Encryptor { public: @@ -82,7 +82,7 @@ class BOTAN_DLL PK_Encryptor /** * Public Key Decryptor */ -class BOTAN_DLL PK_Decryptor +class BOTAN_PUBLIC_API(2,0) PK_Decryptor { public: /** @@ -158,7 +158,7 @@ class BOTAN_DLL PK_Decryptor * messages. Use multiple calls update() to process large messages and * generate the signature by finally calling signature(). */ -class BOTAN_DLL PK_Signer final +class BOTAN_PUBLIC_API(2,0) PK_Signer final { public: @@ -285,7 +285,7 @@ class BOTAN_DLL PK_Signer final * messages. Use multiple calls update() to process large messages and * verify the signature by finally calling check_signature(). */ -class BOTAN_DLL PK_Verifier final +class BOTAN_PUBLIC_API(2,0) PK_Verifier final { public: /** @@ -397,7 +397,7 @@ class BOTAN_DLL PK_Verifier final /** * Key used for key agreement */ -class BOTAN_DLL PK_Key_Agreement final +class BOTAN_PUBLIC_API(2,0) PK_Key_Agreement final { public: @@ -507,7 +507,7 @@ class BOTAN_DLL PK_Key_Agreement final * Encryption using a standard message recovery algorithm like RSA or * ElGamal, paired with an encoding scheme like OAEP. */ -class BOTAN_DLL PK_Encryptor_EME final : public PK_Encryptor +class BOTAN_PUBLIC_API(2,0) PK_Encryptor_EME final : public PK_Encryptor { public: size_t maximum_input_size() const override; @@ -551,7 +551,7 @@ class BOTAN_DLL PK_Encryptor_EME final : public PK_Encryptor /** * Decryption with an MR algorithm and an EME. */ -class BOTAN_DLL PK_Decryptor_EME final : public PK_Decryptor +class BOTAN_PUBLIC_API(2,0) PK_Decryptor_EME final : public PK_Decryptor { public: /** @@ -594,7 +594,7 @@ class BOTAN_DLL PK_Decryptor_EME final : public PK_Decryptor /** * Public Key Key Encapsulation Mechanism Encryption. */ -class BOTAN_DLL PK_KEM_Encryptor final +class BOTAN_PUBLIC_API(2,0) PK_KEM_Encryptor final { public: /** @@ -688,7 +688,7 @@ class BOTAN_DLL PK_KEM_Encryptor final /** * Public Key Key Encapsulation Mechanism Decryption. */ -class BOTAN_DLL PK_KEM_Decryptor final +class BOTAN_PUBLIC_API(2,0) PK_KEM_Decryptor final { public: /** diff --git a/src/lib/pubkey/rfc6979/rfc6979.h b/src/lib/pubkey/rfc6979/rfc6979.h index 90b4e3697..752386f43 100644 --- a/src/lib/pubkey/rfc6979/rfc6979.h +++ b/src/lib/pubkey/rfc6979/rfc6979.h @@ -16,7 +16,7 @@ namespace Botan { class HMAC_DRBG; -class BOTAN_DLL RFC6979_Nonce_Generator +class BOTAN_PUBLIC_API(2,0) RFC6979_Nonce_Generator { public: /** @@ -43,7 +43,7 @@ class BOTAN_DLL RFC6979_Nonce_Generator * @param h the message hash already reduced mod q * @param hash the hash function used to generate h */ -BigInt BOTAN_DLL generate_rfc6979_nonce(const BigInt& x, +BigInt BOTAN_PUBLIC_API(2,0) generate_rfc6979_nonce(const BigInt& x, const BigInt& q, const BigInt& h, const std::string& hash); diff --git a/src/lib/pubkey/rsa/rsa.h b/src/lib/pubkey/rsa/rsa.h index 89555b51b..419219c3f 100644 --- a/src/lib/pubkey/rsa/rsa.h +++ b/src/lib/pubkey/rsa/rsa.h @@ -16,7 +16,7 @@ namespace Botan { /** * RSA Public Key */ -class BOTAN_DLL RSA_PublicKey : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) RSA_PublicKey : public virtual Public_Key { public: /** @@ -79,7 +79,7 @@ class BOTAN_DLL RSA_PublicKey : public virtual Public_Key /** * RSA Private Key */ -class BOTAN_DLL RSA_PrivateKey : public Private_Key, public RSA_PublicKey +class BOTAN_PUBLIC_API(2,0) RSA_PrivateKey : public Private_Key, public RSA_PublicKey { public: /** diff --git a/src/lib/pubkey/workfactor.h b/src/lib/pubkey/workfactor.h index 1fccc1a1b..d0cdf6730 100644 --- a/src/lib/pubkey/workfactor.h +++ b/src/lib/pubkey/workfactor.h @@ -17,7 +17,7 @@ namespace Botan { * @param prime_group_size size of the group in bits * @return estimated security level for this group */ -BOTAN_DLL size_t dl_work_factor(size_t prime_group_size); +BOTAN_PUBLIC_API(2,0) size_t dl_work_factor(size_t prime_group_size); /** * Return the appropriate exponent size to use for a particular prime @@ -29,21 +29,21 @@ BOTAN_DLL size_t dl_work_factor(size_t prime_group_size); * algorithm can compute the DL in sqrt(x) operations) while minimizing * the exponent size for performance reasons. */ -BOTAN_DLL size_t dl_exponent_size(size_t prime_group_size); +BOTAN_PUBLIC_API(2,0) size_t dl_exponent_size(size_t prime_group_size); /** * Estimate work factor for integer factorization * @param n_bits size of modulus in bits * @return estimated security level for this modulus */ -BOTAN_DLL size_t if_work_factor(size_t n_bits); +BOTAN_PUBLIC_API(2,0) size_t if_work_factor(size_t n_bits); /** * Estimate work factor for EC discrete logarithm * @param prime_group_size size of the group in bits * @return estimated security level for this group */ -BOTAN_DLL size_t ecp_work_factor(size_t prime_group_size); +BOTAN_PUBLIC_API(2,0) size_t ecp_work_factor(size_t prime_group_size); } diff --git a/src/lib/pubkey/x509_key.h b/src/lib/pubkey/x509_key.h index 1844e6568..b3c1cd969 100644 --- a/src/lib/pubkey/x509_key.h +++ b/src/lib/pubkey/x509_key.h @@ -30,21 +30,21 @@ namespace X509 { * @param key the public key to encode * @return BER encoding of this key */ -BOTAN_DLL std::vector<uint8_t> BER_encode(const Public_Key& key); +BOTAN_PUBLIC_API(2,0) std::vector<uint8_t> BER_encode(const Public_Key& key); /** * PEM encode a public key into a string. * @param key the key to encode * @return PEM encoded key */ -BOTAN_DLL std::string PEM_encode(const Public_Key& key); +BOTAN_PUBLIC_API(2,0) std::string PEM_encode(const Public_Key& key); /** * Create a public key from a data source. * @param source the source providing the DER or PEM encoded key * @return new public key object */ -BOTAN_DLL Public_Key* load_key(DataSource& source); +BOTAN_PUBLIC_API(2,0) Public_Key* load_key(DataSource& source); #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) /** @@ -52,7 +52,7 @@ BOTAN_DLL Public_Key* load_key(DataSource& source); * @param filename pathname to the file to load * @return new public key object */ -BOTAN_DLL Public_Key* load_key(const std::string& filename); +BOTAN_PUBLIC_API(2,0) Public_Key* load_key(const std::string& filename); #endif /** @@ -60,14 +60,14 @@ BOTAN_DLL Public_Key* load_key(const std::string& filename); * @param enc the memory region containing the DER or PEM encoded key * @return new public key object */ -BOTAN_DLL Public_Key* load_key(const std::vector<uint8_t>& enc); +BOTAN_PUBLIC_API(2,0) Public_Key* load_key(const std::vector<uint8_t>& enc); /** * Copy a key. * @param key the public key to copy * @return new public key object */ -BOTAN_DLL Public_Key* copy_key(const Public_Key& key); +BOTAN_PUBLIC_API(2,0) Public_Key* copy_key(const Public_Key& key); } diff --git a/src/lib/pubkey/xmss/xmss_key_pair.h b/src/lib/pubkey/xmss/xmss_key_pair.h index d6c82af60..3245ea2d2 100644 --- a/src/lib/pubkey/xmss/xmss_key_pair.h +++ b/src/lib/pubkey/xmss/xmss_key_pair.h @@ -20,7 +20,7 @@ namespace Botan { /** * A pair of XMSS public and private key. **/ -class BOTAN_DLL XMSS_Key_Pair +class BOTAN_PUBLIC_API(2,0) XMSS_Key_Pair { public: XMSS_Key_Pair(XMSS_Parameters::xmss_algorithm_t xmss_oid, diff --git a/src/lib/pubkey/xmss/xmss_parameters.h b/src/lib/pubkey/xmss/xmss_parameters.h index 1e8048217..8db49dd02 100644 --- a/src/lib/pubkey/xmss/xmss_parameters.h +++ b/src/lib/pubkey/xmss/xmss_parameters.h @@ -25,7 +25,7 @@ namespace Botan { * https://datatracker.ietf.org/doc/ * draft-irtf-cfrg-xmss-hash-based-signatures/?include_text=1 **/ -class BOTAN_DLL XMSS_Parameters +class BOTAN_PUBLIC_API(2,0) XMSS_Parameters { public: enum xmss_algorithm_t diff --git a/src/lib/pubkey/xmss/xmss_privatekey.h b/src/lib/pubkey/xmss/xmss_privatekey.h index c8db2d7b8..01b64abf7 100644 --- a/src/lib/pubkey/xmss/xmss_privatekey.h +++ b/src/lib/pubkey/xmss/xmss_privatekey.h @@ -37,7 +37,7 @@ namespace Botan { * https://datatracker.ietf.org/doc/ * draft-irtf-cfrg-xmss-hash-based-signatures/?include_text=1 **/ -class BOTAN_DLL XMSS_PrivateKey : public virtual XMSS_PublicKey, +class BOTAN_PUBLIC_API(2,0) XMSS_PrivateKey : public virtual XMSS_PublicKey, public XMSS_Common_Ops, public virtual Private_Key { diff --git a/src/lib/pubkey/xmss/xmss_publickey.h b/src/lib/pubkey/xmss/xmss_publickey.h index 99e5e0a7e..53a470e06 100644 --- a/src/lib/pubkey/xmss/xmss_publickey.h +++ b/src/lib/pubkey/xmss/xmss_publickey.h @@ -39,7 +39,7 @@ class XMSS_Verification_Operation; * https://datatracker.ietf.org/doc/ * draft-irtf-cfrg-xmss-hash-based-signatures/?include_text=1 **/ -class BOTAN_DLL XMSS_PublicKey : public virtual Public_Key +class BOTAN_PUBLIC_API(2,0) XMSS_PublicKey : public virtual Public_Key { public: /** diff --git a/src/lib/pubkey/xmss/xmss_wots_privatekey.h b/src/lib/pubkey/xmss/xmss_wots_privatekey.h index 445105640..8c8dd2df8 100644 --- a/src/lib/pubkey/xmss/xmss_wots_privatekey.h +++ b/src/lib/pubkey/xmss/xmss_wots_privatekey.h @@ -24,7 +24,7 @@ namespace Botan { /** A Winternitz One Time Signature private key for use with Extended Hash-Based * Signatures. **/ -class BOTAN_DLL XMSS_WOTS_PrivateKey : public virtual XMSS_WOTS_PublicKey, +class BOTAN_PUBLIC_API(2,0) XMSS_WOTS_PrivateKey : public virtual XMSS_WOTS_PublicKey, public virtual Private_Key { public: diff --git a/src/lib/pubkey/xmss/xmss_wots_publickey.h b/src/lib/pubkey/xmss/xmss_wots_publickey.h index eb2f9695b..3e29fe88d 100644 --- a/src/lib/pubkey/xmss/xmss_wots_publickey.h +++ b/src/lib/pubkey/xmss/xmss_wots_publickey.h @@ -29,7 +29,7 @@ typedef std::vector<secure_vector<uint8_t>> wots_keysig_t; * A Winternitz One Time Signature public key for use with Extended Hash-Based * Signatures. **/ -class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key +class BOTAN_PUBLIC_API(2,0) XMSS_WOTS_PublicKey : virtual public Public_Key { public: class TreeSignature |