diff options
author | Jack Lloyd <[email protected]> | 2017-09-19 13:07:29 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-19 22:30:44 -0400 |
commit | 2f4b1610dc0b273c66c494e7bbef0116d9fd6511 (patch) | |
tree | 34cd53c634d3eaab362382193757cbb247dcdae2 /src/lib | |
parent | d179678fe398d9fba22b204a576747397e01d584 (diff) |
More annotations
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/block/aria/aria.h | 6 | ||||
-rw-r--r-- | src/lib/block/shacal2/shacal2.h | 2 | ||||
-rw-r--r-- | src/lib/block/sm4/sm4.h | 2 | ||||
-rw-r--r-- | src/lib/ffi/ffi.h | 573 | ||||
-rw-r--r-- | src/lib/hash/sm3/sm3.h | 2 | ||||
-rw-r--r-- | src/lib/hash/streebog/streebog.h | 6 | ||||
-rw-r--r-- | src/lib/prov/openssl/openssl_mode.cpp | 2 | ||||
-rw-r--r-- | src/lib/rng/chacha_rng/chacha_rng.h | 2 | ||||
-rw-r--r-- | src/lib/tls/tls_messages.h | 16 | ||||
-rw-r--r-- | src/lib/tls/tls_policy.h | 2 | ||||
-rw-r--r-- | src/lib/utils/cpuid/cpuid.h | 2 | ||||
-rw-r--r-- | src/lib/utils/os_utils.h | 16 |
12 files changed, 327 insertions, 304 deletions
diff --git a/src/lib/block/aria/aria.h b/src/lib/block/aria/aria.h index 3058b2a5e..17d665e9e 100644 --- a/src/lib/block/aria/aria.h +++ b/src/lib/block/aria/aria.h @@ -23,7 +23,7 @@ namespace Botan { /** * ARIA-128 */ -class BOTAN_DLL ARIA_128 final : public Block_Cipher_Fixed_Params<16, 16> +class BOTAN_PUBLIC_API(2,3) ARIA_128 final : public Block_Cipher_Fixed_Params<16, 16> { public: void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; @@ -42,7 +42,7 @@ class BOTAN_DLL ARIA_128 final : public Block_Cipher_Fixed_Params<16, 16> /** * ARIA-192 */ -class BOTAN_DLL ARIA_192 final : public Block_Cipher_Fixed_Params<16, 24> +class BOTAN_PUBLIC_API(2,3) ARIA_192 final : public Block_Cipher_Fixed_Params<16, 24> { public: void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; @@ -61,7 +61,7 @@ class BOTAN_DLL ARIA_192 final : public Block_Cipher_Fixed_Params<16, 24> /** * ARIA-256 */ -class BOTAN_DLL ARIA_256 final : public Block_Cipher_Fixed_Params<16, 32> +class BOTAN_PUBLIC_API(2,3) ARIA_256 final : public Block_Cipher_Fixed_Params<16, 32> { public: void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; diff --git a/src/lib/block/shacal2/shacal2.h b/src/lib/block/shacal2/shacal2.h index d63c1453d..6d1613558 100644 --- a/src/lib/block/shacal2/shacal2.h +++ b/src/lib/block/shacal2/shacal2.h @@ -15,7 +15,7 @@ namespace Botan { /** * SHACAL2 */ -class BOTAN_DLL SHACAL2 final : public Block_Cipher_Fixed_Params<32, 16, 64, 4> +class BOTAN_PUBLIC_API(2,3) SHACAL2 final : public Block_Cipher_Fixed_Params<32, 16, 64, 4> { public: void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; diff --git a/src/lib/block/sm4/sm4.h b/src/lib/block/sm4/sm4.h index 873a44c60..f740ba6f5 100644 --- a/src/lib/block/sm4/sm4.h +++ b/src/lib/block/sm4/sm4.h @@ -15,7 +15,7 @@ namespace Botan { /** * SM4 */ -class BOTAN_DLL SM4 final : public Block_Cipher_Fixed_Params<16, 16> +class BOTAN_PUBLIC_API(2,2) SM4 final : public Block_Cipher_Fixed_Params<16, 16> { public: void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h index 73c999f66..1b846a5a4 100644 --- a/src/lib/ffi/ffi.h +++ b/src/lib/ffi/ffi.h @@ -66,39 +66,39 @@ how to provide the cleanest API for such users would be most welcome. * expressed in the form YYYYMMDD of the release date of this version * of the API. */ -BOTAN_DLL uint32_t botan_ffi_api_version(); +BOTAN_PUBLIC_API(2,0) uint32_t botan_ffi_api_version(); /** * Return 0 (ok) if the version given is one this library supports. * botan_ffi_supports_api(botan_ffi_api_version()) will always return 0. */ -BOTAN_DLL int botan_ffi_supports_api(uint32_t api_version); +BOTAN_PUBLIC_API(2,0) int botan_ffi_supports_api(uint32_t api_version); /** * Return a free-form version string, e.g., 2.0.0 */ -BOTAN_DLL const char* botan_version_string(); +BOTAN_PUBLIC_API(2,0) const char* botan_version_string(); /** * Return the major version of the library */ -BOTAN_DLL uint32_t botan_version_major(); +BOTAN_PUBLIC_API(2,0) uint32_t botan_version_major(); /** * Return the minor version of the library */ -BOTAN_DLL uint32_t botan_version_minor(); +BOTAN_PUBLIC_API(2,0) uint32_t botan_version_minor(); /** * Return the patch version of the library */ -BOTAN_DLL uint32_t botan_version_patch(); +BOTAN_PUBLIC_API(2,0) uint32_t botan_version_patch(); /** * Return the date this version was released as * an integer, or 0 if an unreleased version */ -BOTAN_DLL uint32_t botan_version_datestamp(); +BOTAN_PUBLIC_API(2,0) uint32_t botan_version_datestamp(); /* * Error handling @@ -155,18 +155,18 @@ doesn't exactly work well either! /** * Returns 0 if x[0..len] == y[0..len], or otherwise -1 */ -BOTAN_DLL int botan_constant_time_compare(const uint8_t* x, const uint8_t* y, size_t len); +BOTAN_PUBLIC_API(2,3) int botan_constant_time_compare(const uint8_t* x, const uint8_t* y, size_t len); /** * Deprecated equivalent to botan_constant_time_compare */ -BOTAN_DLL int botan_same_mem(const uint8_t* x, const uint8_t* y, size_t len); +BOTAN_PUBLIC_API(2,0) int botan_same_mem(const uint8_t* x, const uint8_t* y, size_t len); /** * Clear out memory using a system specific approach to bypass elision by the * compiler (currently using RtlSecureZeroMemory or tricks with volatile pointers). */ -BOTAN_DLL int botan_scrub_mem(void* mem, size_t bytes); +BOTAN_PUBLIC_API(2,2) int botan_scrub_mem(void* mem, size_t bytes); #define BOTAN_FFI_HEX_LOWER_CASE 1 @@ -178,7 +178,7 @@ BOTAN_DLL int botan_scrub_mem(void* mem, size_t bytes); * @param flags flags out be upper or lower case? * @return 0 on success, 1 on failure */ -BOTAN_DLL int botan_hex_encode(const uint8_t* x, size_t len, char* out, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_hex_encode(const uint8_t* x, size_t len, char* out, uint32_t flags); /** * Perform hex decoding @@ -187,19 +187,19 @@ BOTAN_DLL int botan_hex_encode(const uint8_t* x, size_t len, char* out, uint32_t * @param out the output buffer should be at least strlen(hex_str)/2 bytes * @param out_len the size of out */ -BOTAN_DLL int botan_hex_decode(const char* hex_str, size_t in_len, uint8_t* out, size_t* out_len); +BOTAN_PUBLIC_API(2,3) int botan_hex_decode(const char* hex_str, size_t in_len, uint8_t* out, size_t* out_len); /** * Perform base64 encoding */ -BOTAN_DLL int botan_base64_encode(const uint8_t* x, size_t len, char* out, size_t* out_len); +BOTAN_PUBLIC_API(2,3) int botan_base64_encode(const uint8_t* x, size_t len, char* out, size_t* out_len); /** * Perform base64 decoding */ -BOTAN_DLL int botan_base64_decode(const char* base64_str, size_t in_len, - uint8_t* out, size_t* out_len); +BOTAN_PUBLIC_API(2,3) int botan_base64_decode(const char* base64_str, size_t in_len, + uint8_t* out, size_t* out_len); /** * RNG type @@ -215,7 +215,7 @@ typedef struct botan_rng_struct* botan_rng_t; * * TODO: replace rng_type with simple flags? */ -BOTAN_DLL int botan_rng_init(botan_rng_t* rng, const char* rng_type); +BOTAN_PUBLIC_API(2,0) int botan_rng_init(botan_rng_t* rng, const char* rng_type); /** * Get random bytes from a random number generator @@ -226,7 +226,7 @@ BOTAN_DLL int botan_rng_init(botan_rng_t* rng, const char* rng_type); * * TODO: better name */ -BOTAN_DLL int botan_rng_get(botan_rng_t rng, uint8_t* out, size_t out_len); +BOTAN_PUBLIC_API(2,0) int botan_rng_get(botan_rng_t rng, uint8_t* out, size_t out_len); /** * Reseed a random number generator @@ -236,14 +236,14 @@ BOTAN_DLL int botan_rng_get(botan_rng_t rng, uint8_t* out, size_t out_len); * @param bits number of bits to to reseed with * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_rng_reseed(botan_rng_t rng, size_t bits); +BOTAN_PUBLIC_API(2,0) int botan_rng_reseed(botan_rng_t rng, size_t bits); /** * Frees all resources of the random number generator object * @param rng rng object * @return always returns 0 */ -BOTAN_DLL int botan_rng_destroy(botan_rng_t rng); +BOTAN_PUBLIC_API(2,0) int botan_rng_destroy(botan_rng_t rng); /* * Hash type @@ -260,7 +260,7 @@ typedef struct botan_hash_struct* botan_hash_t; * TODO: since output_length is effectively required to use this API, * return it from init as an output parameter */ -BOTAN_DLL int botan_hash_init(botan_hash_t* hash, const char* hash_name, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_hash_init(botan_hash_t* hash, const char* hash_name, uint32_t flags); /** * Copy the state of a hash function object @@ -268,7 +268,7 @@ BOTAN_DLL int botan_hash_init(botan_hash_t* hash, const char* hash_name, uint32_ * @param source source hash object * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_hash_copy_state(botan_hash_t *dest, const botan_hash_t source); +BOTAN_PUBLIC_API(2,2) int botan_hash_copy_state(botan_hash_t *dest, const botan_hash_t source); /** * Writes the output length of the hash function to *output_length @@ -276,7 +276,7 @@ BOTAN_DLL int botan_hash_copy_state(botan_hash_t *dest, const botan_hash_t sourc * @param output_length output buffer to hold the hash function output length * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_hash_output_length(botan_hash_t hash, size_t* output_length); +BOTAN_PUBLIC_API(2,0) int botan_hash_output_length(botan_hash_t hash, size_t* output_length); /** * Writes the block size of the hash function to *block_size @@ -284,7 +284,7 @@ BOTAN_DLL int botan_hash_output_length(botan_hash_t hash, size_t* output_length) * @param block_size output buffer to hold the hash function output length * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_hash_block_size(botan_hash_t hash, size_t* block_size); +BOTAN_PUBLIC_API(2,2) int botan_hash_block_size(botan_hash_t hash, size_t* block_size); /** * Send more input to the hash function @@ -293,7 +293,7 @@ BOTAN_DLL int botan_hash_block_size(botan_hash_t hash, size_t* block_size); * @param in_len number of bytes to read from the input buffer * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_hash_update(botan_hash_t hash, const uint8_t* in, size_t in_len); +BOTAN_PUBLIC_API(2,0) int botan_hash_update(botan_hash_t hash, const uint8_t* in, size_t in_len); /** * Finalizes the hash computation and writes the output to @@ -303,7 +303,7 @@ BOTAN_DLL int botan_hash_update(botan_hash_t hash, const uint8_t* in, size_t in_ * @param out output buffer * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_hash_final(botan_hash_t hash, uint8_t out[]); +BOTAN_PUBLIC_API(2,0) int botan_hash_final(botan_hash_t hash, uint8_t out[]); /** * Reinitializes the state of the hash computation. A hash can @@ -311,19 +311,19 @@ BOTAN_DLL int botan_hash_final(botan_hash_t hash, uint8_t out[]); * @param hash hash object * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_hash_clear(botan_hash_t hash); +BOTAN_PUBLIC_API(2,0) int botan_hash_clear(botan_hash_t hash); /** * Frees all resources of the hash object * @param hash hash object * @return always returns 0 */ -BOTAN_DLL int botan_hash_destroy(botan_hash_t hash); +BOTAN_PUBLIC_API(2,0) int botan_hash_destroy(botan_hash_t hash); /** * TODO has no implementation */ -BOTAN_DLL int botan_hash_name(botan_hash_t hash, char* name, size_t name_len); +BOTAN_PUBLIC_API(2,0) int botan_hash_name(botan_hash_t hash, char* name, size_t name_len); /* * Message Authentication type @@ -338,7 +338,7 @@ typedef struct botan_mac_struct* botan_mac_t; * and return a negative value (error code) * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_mac_init(botan_mac_t* mac, const char* mac_name, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_mac_init(botan_mac_t* mac, const char* mac_name, uint32_t flags); /** * Writes the output length of the message authentication code to *output_length @@ -346,7 +346,7 @@ BOTAN_DLL int botan_mac_init(botan_mac_t* mac, const char* mac_name, uint32_t fl * @param output_length output buffer to hold the MAC output length * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_mac_output_length(botan_mac_t mac, size_t* output_length); +BOTAN_PUBLIC_API(2,0) int botan_mac_output_length(botan_mac_t mac, size_t* output_length); /** * Sets the key on the MAC @@ -355,7 +355,7 @@ BOTAN_DLL int botan_mac_output_length(botan_mac_t mac, size_t* output_length); * @param key_len size of the key buffer in bytes * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_mac_set_key(botan_mac_t mac, const uint8_t* key, size_t key_len); +BOTAN_PUBLIC_API(2,0) int botan_mac_set_key(botan_mac_t mac, const uint8_t* key, size_t key_len); /** * Send more input to the message authentication code @@ -364,7 +364,7 @@ BOTAN_DLL int botan_mac_set_key(botan_mac_t mac, const uint8_t* key, size_t key_ * @param len number of bytes to read from the input buffer * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_mac_update(botan_mac_t mac, const uint8_t* buf, size_t len); +BOTAN_PUBLIC_API(2,0) int botan_mac_update(botan_mac_t mac, const uint8_t* buf, size_t len); /** * Finalizes the MAC computation and writes the output to @@ -374,7 +374,7 @@ BOTAN_DLL int botan_mac_update(botan_mac_t mac, const uint8_t* buf, size_t len); * @param out output buffer * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_mac_final(botan_mac_t mac, uint8_t out[]); +BOTAN_PUBLIC_API(2,0) int botan_mac_final(botan_mac_t mac, uint8_t out[]); /** * Reinitializes the state of the MAC computation. A MAC can @@ -382,14 +382,14 @@ BOTAN_DLL int botan_mac_final(botan_mac_t mac, uint8_t out[]); * @param mac mac object * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_mac_clear(botan_mac_t mac); +BOTAN_PUBLIC_API(2,0) int botan_mac_clear(botan_mac_t mac); /** * Frees all resources of the MAC object * @param mac mac object * @return always returns 0 */ -BOTAN_DLL int botan_mac_destroy(botan_mac_t mac); +BOTAN_PUBLIC_API(2,0) int botan_mac_destroy(botan_mac_t mac); /* * Cipher modes @@ -400,29 +400,29 @@ typedef struct botan_cipher_struct* botan_cipher_t; #define BOTAN_CIPHER_INIT_FLAG_ENCRYPT 0 #define BOTAN_CIPHER_INIT_FLAG_DECRYPT 1 -BOTAN_DLL int botan_cipher_init(botan_cipher_t* cipher, const char* name, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_cipher_init(botan_cipher_t* cipher, const char* name, uint32_t flags); -BOTAN_DLL int botan_cipher_valid_nonce_length(botan_cipher_t cipher, size_t nl); -BOTAN_DLL int botan_cipher_get_tag_length(botan_cipher_t cipher, size_t* tag_size); -BOTAN_DLL int botan_cipher_get_default_nonce_length(botan_cipher_t cipher, size_t* nl); -BOTAN_DLL int botan_cipher_get_update_granularity(botan_cipher_t cipher, size_t* ug); +BOTAN_PUBLIC_API(2,0) int botan_cipher_valid_nonce_length(botan_cipher_t cipher, size_t nl); +BOTAN_PUBLIC_API(2,0) int botan_cipher_get_tag_length(botan_cipher_t cipher, size_t* tag_size); +BOTAN_PUBLIC_API(2,0) int botan_cipher_get_default_nonce_length(botan_cipher_t cipher, size_t* nl); +BOTAN_PUBLIC_API(2,0) int botan_cipher_get_update_granularity(botan_cipher_t cipher, size_t* ug); -BOTAN_DLL int botan_cipher_query_keylen(botan_cipher_t, +BOTAN_PUBLIC_API(2,0) int botan_cipher_query_keylen(botan_cipher_t, size_t* out_minimum_keylength, size_t* out_maximum_keylength); -BOTAN_DLL int botan_cipher_set_key(botan_cipher_t cipher, +BOTAN_PUBLIC_API(2,0) int botan_cipher_set_key(botan_cipher_t cipher, const uint8_t* key, size_t key_len); -BOTAN_DLL int botan_cipher_set_associated_data(botan_cipher_t cipher, +BOTAN_PUBLIC_API(2,0) int botan_cipher_set_associated_data(botan_cipher_t cipher, const uint8_t* ad, size_t ad_len); -BOTAN_DLL int botan_cipher_start(botan_cipher_t cipher, +BOTAN_PUBLIC_API(2,0) int botan_cipher_start(botan_cipher_t cipher, const uint8_t* nonce, size_t nonce_len); #define BOTAN_CIPHER_UPDATE_FLAG_FINAL (1U << 0) -BOTAN_DLL int botan_cipher_update(botan_cipher_t cipher, +BOTAN_PUBLIC_API(2,0) int botan_cipher_update(botan_cipher_t cipher, uint32_t flags, uint8_t output[], size_t output_size, @@ -431,8 +431,8 @@ BOTAN_DLL int botan_cipher_update(botan_cipher_t cipher, size_t input_size, size_t* input_consumed); -BOTAN_DLL int botan_cipher_clear(botan_cipher_t hash); -BOTAN_DLL int botan_cipher_destroy(botan_cipher_t cipher); +BOTAN_PUBLIC_API(2,0) int botan_cipher_clear(botan_cipher_t hash); +BOTAN_PUBLIC_API(2,0) int botan_cipher_destroy(botan_cipher_t cipher); /* * Derive a key from a passphrase for a number of iterations @@ -445,7 +445,7 @@ BOTAN_DLL int botan_cipher_destroy(botan_cipher_t cipher); * @param iterations the number of iterations to use (use 10K or more) * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_pbkdf(const char* pbkdf_algo, +BOTAN_PUBLIC_API(2,0) int botan_pbkdf(const char* pbkdf_algo, uint8_t out[], size_t out_len, const char* passphrase, const uint8_t salt[], size_t salt_len, @@ -464,7 +464,7 @@ BOTAN_DLL int botan_pbkdf(const char* pbkdf_algo, * @param out_iterations_used set to the number iterations executed * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_pbkdf_timed(const char* pbkdf_algo, +BOTAN_PUBLIC_API(2,0) int botan_pbkdf_timed(const char* pbkdf_algo, uint8_t out[], size_t out_len, const char* passphrase, const uint8_t salt[], size_t salt_len, @@ -484,7 +484,7 @@ BOTAN_DLL int botan_pbkdf_timed(const char* pbkdf_algo, * @param label_len size of label in bytes * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_kdf(const char* kdf_algo, +BOTAN_PUBLIC_API(2,0) int botan_kdf(const char* kdf_algo, uint8_t out[], size_t out_len, const uint8_t secret[], size_t secret_len, const uint8_t salt[], size_t salt_len, @@ -503,7 +503,7 @@ BOTAN_DLL int botan_kdf(const char* kdf_algo, * Output is formatted bcrypt $2a$... */ -BOTAN_DLL int botan_bcrypt_generate(uint8_t* out, size_t* out_len, +BOTAN_PUBLIC_API(2,0) int botan_bcrypt_generate(uint8_t* out, size_t* out_len, const char* password, botan_rng_t rng, size_t work_factor, @@ -517,38 +517,38 @@ typedef struct botan_block_cipher_struct* botan_block_cipher_t; /** * Initialize a block cipher object */ -BOTAN_DLL int botan_block_cipher_init(botan_block_cipher_t* bc, +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_init(botan_block_cipher_t* bc, const char* cipher_name); /** * Destroy a block cipher object */ -BOTAN_DLL int botan_block_cipher_destroy(botan_block_cipher_t bc); +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_destroy(botan_block_cipher_t bc); /** * Reinitializes the block cipher * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_block_cipher_clear(botan_block_cipher_t bc); +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_clear(botan_block_cipher_t bc); /** * Set the key for a block cipher instance */ -BOTAN_DLL int botan_block_cipher_set_key(botan_block_cipher_t bc, +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_set_key(botan_block_cipher_t bc, const uint8_t key[], size_t len); /** * Return the positive block size of this block cipher, or negative to * indicate an error */ -BOTAN_DLL int botan_block_cipher_block_size(botan_block_cipher_t bc); +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_block_size(botan_block_cipher_t bc); -BOTAN_DLL int botan_block_cipher_encrypt_blocks(botan_block_cipher_t bc, +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_encrypt_blocks(botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks); -BOTAN_DLL int botan_block_cipher_decrypt_blocks(botan_block_cipher_t bc, +BOTAN_PUBLIC_API(2,2) int botan_block_cipher_decrypt_blocks(botan_block_cipher_t bc, const uint8_t in[], uint8_t out[], size_t blocks); @@ -559,57 +559,57 @@ BOTAN_DLL int botan_block_cipher_decrypt_blocks(botan_block_cipher_t bc, */ typedef struct botan_mp_struct* botan_mp_t; -BOTAN_DLL int botan_mp_init(botan_mp_t* mp); -BOTAN_DLL int botan_mp_destroy(botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_init(botan_mp_t* mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_destroy(botan_mp_t mp); // writes botan_mp_num_bytes(mp)*2 + 1 bytes to out[] -BOTAN_DLL int botan_mp_to_hex(const botan_mp_t mp, char* out); -BOTAN_DLL int botan_mp_to_str(const botan_mp_t mp, uint8_t base, char* out, size_t* out_len); +BOTAN_PUBLIC_API(2,2) int botan_mp_to_hex(const botan_mp_t mp, char* out); +BOTAN_PUBLIC_API(2,2) int botan_mp_to_str(const botan_mp_t mp, uint8_t base, char* out, size_t* out_len); -BOTAN_DLL int botan_mp_clear(botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_clear(botan_mp_t mp); -BOTAN_DLL int botan_mp_set_from_int(botan_mp_t mp, int initial_value); -BOTAN_DLL int botan_mp_set_from_mp(botan_mp_t dest, const botan_mp_t source); -BOTAN_DLL int botan_mp_set_from_str(botan_mp_t dest, const char* str); -BOTAN_DLL int botan_mp_set_from_radix_str(botan_mp_t dest, const char* str, size_t radix); +BOTAN_PUBLIC_API(2,2) int botan_mp_set_from_int(botan_mp_t mp, int initial_value); +BOTAN_PUBLIC_API(2,2) int botan_mp_set_from_mp(botan_mp_t dest, const botan_mp_t source); +BOTAN_PUBLIC_API(2,2) int botan_mp_set_from_str(botan_mp_t dest, const char* str); +BOTAN_PUBLIC_API(2,2) int botan_mp_set_from_radix_str(botan_mp_t dest, const char* str, size_t radix); -BOTAN_DLL int botan_mp_num_bits(const botan_mp_t n, size_t* bits); -BOTAN_DLL int botan_mp_num_bytes(const botan_mp_t n, size_t* bytes); +BOTAN_PUBLIC_API(2,2) int botan_mp_num_bits(const botan_mp_t n, size_t* bits); +BOTAN_PUBLIC_API(2,2) int botan_mp_num_bytes(const botan_mp_t n, size_t* bytes); // Writes botan_mp_num_bytes(mp) to vec -BOTAN_DLL int botan_mp_to_bin(const botan_mp_t mp, uint8_t vec[]); -BOTAN_DLL int botan_mp_from_bin(const botan_mp_t mp, const uint8_t vec[], size_t vec_len); +BOTAN_PUBLIC_API(2,2) int botan_mp_to_bin(const botan_mp_t mp, uint8_t vec[]); +BOTAN_PUBLIC_API(2,2) int botan_mp_from_bin(const botan_mp_t mp, const uint8_t vec[], size_t vec_len); -BOTAN_DLL int botan_mp_to_uint32(const botan_mp_t mp, uint32_t* val); +BOTAN_PUBLIC_API(2,2) int botan_mp_to_uint32(const botan_mp_t mp, uint32_t* val); /** * This function is not well named. Returns 1 iff mp is greater than * *or equal to* zero. Use botan_mp_is_negative to detect negative * numbers, botan_mp_is_zero to check for zero. */ -BOTAN_DLL int botan_mp_is_positive(const botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_is_positive(const botan_mp_t mp); /** * Return 1 iff mp is less than 0 */ -BOTAN_DLL int botan_mp_is_negative(const botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_is_negative(const botan_mp_t mp); -BOTAN_DLL int botan_mp_flip_sign(botan_mp_t mp); -//BOTAN_DLL int botan_mp_set_negative(botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_flip_sign(botan_mp_t mp); +//BOTAN_PUBLIC_API(2,2) int botan_mp_set_negative(botan_mp_t mp); -BOTAN_DLL int botan_mp_is_zero(const botan_mp_t mp); -BOTAN_DLL int botan_mp_is_odd(const botan_mp_t mp); -BOTAN_DLL int botan_mp_is_even(const botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_is_zero(const botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_is_odd(const botan_mp_t mp); +BOTAN_PUBLIC_API(2,2) int botan_mp_is_even(const botan_mp_t mp); -BOTAN_DLL int botan_mp_add(botan_mp_t result, const botan_mp_t x, const botan_mp_t y); -BOTAN_DLL int botan_mp_sub(botan_mp_t result, const botan_mp_t x, const botan_mp_t y); -BOTAN_DLL int botan_mp_mul(botan_mp_t result, const botan_mp_t x, const botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_add(botan_mp_t result, const botan_mp_t x, const botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_sub(botan_mp_t result, const botan_mp_t x, const botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_mul(botan_mp_t result, const botan_mp_t x, const botan_mp_t y); -BOTAN_DLL int botan_mp_div(botan_mp_t quotient, +BOTAN_PUBLIC_API(2,2) int botan_mp_div(botan_mp_t quotient, botan_mp_t remainder, const botan_mp_t x, const botan_mp_t y); -BOTAN_DLL int botan_mp_mod_mul(botan_mp_t result, const botan_mp_t x, +BOTAN_PUBLIC_API(2,2) int botan_mp_mod_mul(botan_mp_t result, const botan_mp_t x, const botan_mp_t y, const botan_mp_t mod); /* @@ -617,58 +617,58 @@ BOTAN_DLL int botan_mp_mod_mul(botan_mp_t result, const botan_mp_t x, * Returns 1 if x == y * Returns negative number on error */ -BOTAN_DLL int botan_mp_equal(const botan_mp_t x, const botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_equal(const botan_mp_t x, const botan_mp_t y); /* * Sets *result to comparison result: * -1 if x < y, 0 if x == y, 1 if x > y * Returns negative number on error or zero on success */ -BOTAN_DLL int botan_mp_cmp(int* result, const botan_mp_t x, const botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_cmp(int* result, const botan_mp_t x, const botan_mp_t y); /* * Swap two botan_mp_t */ -BOTAN_DLL int botan_mp_swap(botan_mp_t x, botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_swap(botan_mp_t x, botan_mp_t y); // Return (base^exponent) % modulus -BOTAN_DLL int botan_mp_powmod(botan_mp_t out, const botan_mp_t base, const botan_mp_t exponent, const botan_mp_t modulus); +BOTAN_PUBLIC_API(2,2) int botan_mp_powmod(botan_mp_t out, const botan_mp_t base, const botan_mp_t exponent, const botan_mp_t modulus); -BOTAN_DLL int botan_mp_lshift(botan_mp_t out, const botan_mp_t in, size_t shift); -BOTAN_DLL int botan_mp_rshift(botan_mp_t out, const botan_mp_t in, size_t shift); +BOTAN_PUBLIC_API(2,2) int botan_mp_lshift(botan_mp_t out, const botan_mp_t in, size_t shift); +BOTAN_PUBLIC_API(2,2) int botan_mp_rshift(botan_mp_t out, const botan_mp_t in, size_t shift); -BOTAN_DLL int botan_mp_mod_inverse(botan_mp_t out, const botan_mp_t in, const botan_mp_t modulus); +BOTAN_PUBLIC_API(2,2) int botan_mp_mod_inverse(botan_mp_t out, const botan_mp_t in, const botan_mp_t modulus); -BOTAN_DLL int botan_mp_rand_bits(botan_mp_t rand_out, botan_rng_t rng, size_t bits); +BOTAN_PUBLIC_API(2,2) int botan_mp_rand_bits(botan_mp_t rand_out, botan_rng_t rng, size_t bits); -BOTAN_DLL int botan_mp_rand_range(botan_mp_t rand_out, botan_rng_t rng, +BOTAN_PUBLIC_API(2,2) int botan_mp_rand_range(botan_mp_t rand_out, botan_rng_t rng, const botan_mp_t lower_bound, const botan_mp_t upper_bound); -BOTAN_DLL int botan_mp_gcd(botan_mp_t out, const botan_mp_t x, const botan_mp_t y); +BOTAN_PUBLIC_API(2,2) int botan_mp_gcd(botan_mp_t out, const botan_mp_t x, const botan_mp_t y); /** * Returns 0 if n is not prime * Returns 1 if n is prime * Returns negative number on error */ -BOTAN_DLL int botan_mp_is_prime(const botan_mp_t n, botan_rng_t rng, size_t test_prob); +BOTAN_PUBLIC_API(2,2) int botan_mp_is_prime(const botan_mp_t n, botan_rng_t rng, size_t test_prob); /** * Returns 0 if specified bit of n is not set * Returns 1 if specified bit of n is set * Returns negative number on error */ -BOTAN_DLL int botan_mp_get_bit(const botan_mp_t n, size_t bit); +BOTAN_PUBLIC_API(2,2) int botan_mp_get_bit(const botan_mp_t n, size_t bit); /** * Set the specified bit */ -BOTAN_DLL int botan_mp_set_bit(botan_mp_t n, size_t bit); +BOTAN_PUBLIC_API(2,2) int botan_mp_set_bit(botan_mp_t n, size_t bit); /** * Clear the specified bit */ -BOTAN_DLL int botan_mp_clear_bit(botan_mp_t n, size_t bit); +BOTAN_PUBLIC_API(2,2) int botan_mp_clear_bit(botan_mp_t n, size_t bit); /* Bcrypt password hashing */ @@ -680,37 +680,37 @@ BOTAN_DLL int botan_mp_clear_bit(botan_mp_t n, size_t bit); * 1 if the combination is not valid (but otherwise well formed), * negative on error */ -BOTAN_DLL int botan_bcrypt_is_valid(const char* pass, const char* hash); +BOTAN_PUBLIC_API(2,0) int botan_bcrypt_is_valid(const char* pass, const char* hash); /* * Public/private key creation, import, ... */ typedef struct botan_privkey_struct* botan_privkey_t; -BOTAN_DLL int botan_privkey_create(botan_privkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_create(botan_privkey_t* key, const char* algo_name, const char* algo_params, botan_rng_t rng); #define BOTAN_CHECK_KEY_EXPENSIVE_TESTS 1 -BOTAN_DLL int botan_privkey_check_key(botan_privkey_t key, botan_rng_t rng, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_privkey_check_key(botan_privkey_t key, botan_rng_t rng, uint32_t flags); -BOTAN_DLL int botan_privkey_create_rsa(botan_privkey_t* key, botan_rng_t rng, size_t n_bits); -BOTAN_DLL int botan_privkey_create_ecdsa(botan_privkey_t* key, botan_rng_t rng, const char* params); -BOTAN_DLL int botan_privkey_create_ecdh(botan_privkey_t* key, botan_rng_t rng, const char* params); -BOTAN_DLL int botan_privkey_create_mceliece(botan_privkey_t* key, botan_rng_t rng, size_t n, size_t t); -BOTAN_DLL int botan_privkey_create_dh(botan_privkey_t* key, botan_rng_t rng, const char* param); +BOTAN_PUBLIC_API(2,0) int botan_privkey_create_rsa(botan_privkey_t* key, botan_rng_t rng, size_t n_bits); +BOTAN_PUBLIC_API(2,0) int botan_privkey_create_ecdsa(botan_privkey_t* key, botan_rng_t rng, const char* params); +BOTAN_PUBLIC_API(2,0) int botan_privkey_create_ecdh(botan_privkey_t* key, botan_rng_t rng, const char* params); +BOTAN_PUBLIC_API(2,0) int botan_privkey_create_mceliece(botan_privkey_t* key, botan_rng_t rng, size_t n, size_t t); +BOTAN_PUBLIC_API(2,0) int botan_privkey_create_dh(botan_privkey_t* key, botan_rng_t rng, const char* param); /* * Input currently assumed to be PKCS #8 structure; * Set password to NULL to indicate no encryption expected */ -BOTAN_DLL int botan_privkey_load(botan_privkey_t* key, botan_rng_t rng, +BOTAN_PUBLIC_API(2,0) int botan_privkey_load(botan_privkey_t* key, botan_rng_t rng, const uint8_t bits[], size_t len, const char* password); -BOTAN_DLL int botan_privkey_destroy(botan_privkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_destroy(botan_privkey_t key); #define BOTAN_PRIVKEY_EXPORT_FLAG_DER 0 #define BOTAN_PRIVKEY_EXPORT_FLAG_PEM 1 @@ -722,7 +722,7 @@ BOTAN_DLL int botan_privkey_destroy(botan_privkey_t key); * Returns 0 on success and sets * If some other error occurs a negative integer is returned. */ -BOTAN_DLL int botan_privkey_export(botan_privkey_t key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_export(botan_privkey_t key, uint8_t out[], size_t* out_len, uint32_t flags); @@ -730,7 +730,7 @@ BOTAN_DLL int botan_privkey_export(botan_privkey_t key, * Set encryption_algo to NULL or "" to have the library choose a default (recommended) */ BOTAN_DEPRECATED("Use botan_privkey_export_encrypted_pbkdf_{msec,iter}") -BOTAN_DLL int botan_privkey_export_encrypted(botan_privkey_t key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_export_encrypted(botan_privkey_t key, uint8_t out[], size_t* out_len, botan_rng_t rng, const char* passphrase, @@ -741,7 +741,7 @@ BOTAN_DLL int botan_privkey_export_encrypted(botan_privkey_t key, * Export a private key, running PBKDF for specified amount of time * @param key the private key to export */ -BOTAN_DLL int botan_privkey_export_encrypted_pbkdf_msec(botan_privkey_t key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_export_encrypted_pbkdf_msec(botan_privkey_t key, uint8_t out[], size_t* out_len, botan_rng_t rng, const char* passphrase, @@ -754,7 +754,7 @@ BOTAN_DLL int botan_privkey_export_encrypted_pbkdf_msec(botan_privkey_t key, /* * Export a private key using the specified number of iterations. */ -BOTAN_DLL int botan_privkey_export_encrypted_pbkdf_iter(botan_privkey_t key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_export_encrypted_pbkdf_iter(botan_privkey_t key, uint8_t out[], size_t* out_len, botan_rng_t rng, const char* passphrase, @@ -765,79 +765,79 @@ BOTAN_DLL int botan_privkey_export_encrypted_pbkdf_iter(botan_privkey_t key, typedef struct botan_pubkey_struct* botan_pubkey_t; -BOTAN_DLL int botan_pubkey_load(botan_pubkey_t* key, const uint8_t bits[], size_t len); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_load(botan_pubkey_t* key, const uint8_t bits[], size_t len); -BOTAN_DLL int botan_privkey_export_pubkey(botan_pubkey_t* out, botan_privkey_t in); +BOTAN_PUBLIC_API(2,0) int botan_privkey_export_pubkey(botan_pubkey_t* out, botan_privkey_t in); -BOTAN_DLL int botan_pubkey_export(botan_pubkey_t key, uint8_t out[], size_t* out_len, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_export(botan_pubkey_t key, uint8_t out[], size_t* out_len, uint32_t flags); -BOTAN_DLL int botan_pubkey_algo_name(botan_pubkey_t key, char out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_algo_name(botan_pubkey_t key, char out[], size_t* out_len); /** * Returns 0 if key is valid, negative if invalid key or some other error */ -BOTAN_DLL int botan_pubkey_check_key(botan_pubkey_t key, botan_rng_t rng, uint32_t flags); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_check_key(botan_pubkey_t key, botan_rng_t rng, uint32_t flags); -BOTAN_DLL int botan_pubkey_estimated_strength(botan_pubkey_t key, size_t* estimate); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_estimated_strength(botan_pubkey_t key, size_t* estimate); -BOTAN_DLL int botan_pubkey_fingerprint(botan_pubkey_t key, const char* hash, +BOTAN_PUBLIC_API(2,0) int botan_pubkey_fingerprint(botan_pubkey_t key, const char* hash, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_pubkey_destroy(botan_pubkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_destroy(botan_pubkey_t key); /* * Get arbitrary named fields from public or privat keys */ -BOTAN_DLL int botan_pubkey_get_field(botan_mp_t output, +BOTAN_PUBLIC_API(2,0) int botan_pubkey_get_field(botan_mp_t output, botan_pubkey_t key, const char* field_name); -BOTAN_DLL int botan_privkey_get_field(botan_mp_t output, +BOTAN_PUBLIC_API(2,0) int botan_privkey_get_field(botan_mp_t output, botan_privkey_t key, const char* field_name); /* * Algorithm specific key operations: RSA */ -BOTAN_DLL int botan_privkey_load_rsa(botan_privkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_load_rsa(botan_privkey_t* key, botan_mp_t p, botan_mp_t q, botan_mp_t e); -BOTAN_DLL int botan_privkey_rsa_get_p(botan_mp_t p, botan_privkey_t rsa_key); -BOTAN_DLL int botan_privkey_rsa_get_q(botan_mp_t q, botan_privkey_t rsa_key); -BOTAN_DLL int botan_privkey_rsa_get_d(botan_mp_t d, botan_privkey_t rsa_key); -BOTAN_DLL int botan_privkey_rsa_get_n(botan_mp_t n, botan_privkey_t rsa_key); -BOTAN_DLL int botan_privkey_rsa_get_e(botan_mp_t e, botan_privkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_rsa_get_p(botan_mp_t p, botan_privkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_rsa_get_q(botan_mp_t q, botan_privkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_rsa_get_d(botan_mp_t d, botan_privkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_rsa_get_n(botan_mp_t n, botan_privkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_rsa_get_e(botan_mp_t e, botan_privkey_t rsa_key); -BOTAN_DLL int botan_pubkey_load_rsa(botan_pubkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_pubkey_load_rsa(botan_pubkey_t* key, botan_mp_t n, botan_mp_t e); -BOTAN_DLL int botan_pubkey_rsa_get_e(botan_mp_t e, botan_pubkey_t rsa_key); -BOTAN_DLL int botan_pubkey_rsa_get_n(botan_mp_t n, botan_pubkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_rsa_get_e(botan_mp_t e, botan_pubkey_t rsa_key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_rsa_get_n(botan_mp_t n, botan_pubkey_t rsa_key); /* * Algorithm specific key operations: DSA */ -BOTAN_DLL int botan_privkey_load_dsa(botan_privkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_load_dsa(botan_privkey_t* key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t x); -BOTAN_DLL int botan_pubkey_load_dsa(botan_pubkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_pubkey_load_dsa(botan_pubkey_t* key, botan_mp_t p, botan_mp_t q, botan_mp_t g, botan_mp_t y); -BOTAN_DLL int botan_privkey_dsa_get_x(botan_mp_t n, botan_privkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_privkey_dsa_get_x(botan_mp_t n, botan_privkey_t key); -BOTAN_DLL int botan_pubkey_dsa_get_p(botan_mp_t p, botan_pubkey_t key); -BOTAN_DLL int botan_pubkey_dsa_get_q(botan_mp_t q, botan_pubkey_t key); -BOTAN_DLL int botan_pubkey_dsa_get_g(botan_mp_t d, botan_pubkey_t key); -BOTAN_DLL int botan_pubkey_dsa_get_y(botan_mp_t y, botan_pubkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_dsa_get_p(botan_mp_t p, botan_pubkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_dsa_get_q(botan_mp_t q, botan_pubkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_dsa_get_g(botan_mp_t d, botan_pubkey_t key); +BOTAN_PUBLIC_API(2,0) int botan_pubkey_dsa_get_y(botan_mp_t y, botan_pubkey_t key); /* * Loads Diffie Hellman private key @@ -852,7 +852,7 @@ BOTAN_DLL int botan_pubkey_dsa_get_y(botan_mp_t y, botan_pubkey_t key); * * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_privkey_load_dh(botan_privkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_load_dh(botan_privkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t x); @@ -869,7 +869,7 @@ BOTAN_DLL int botan_privkey_load_dh(botan_privkey_t* key, * * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_pubkey_load_dh(botan_pubkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_pubkey_load_dh(botan_pubkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t y); @@ -890,7 +890,7 @@ BOTAN_DLL int botan_pubkey_load_dh(botan_pubkey_t* key, * * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_pubkey_load_elgamal(botan_pubkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_pubkey_load_elgamal(botan_pubkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t y); @@ -908,7 +908,7 @@ BOTAN_DLL int botan_pubkey_load_elgamal(botan_pubkey_t* key, * * @return 0 on success, a negative value on failure */ -BOTAN_DLL int botan_privkey_load_elgamal(botan_privkey_t* key, +BOTAN_PUBLIC_API(2,0) int botan_privkey_load_elgamal(botan_privkey_t* key, botan_mp_t p, botan_mp_t g, botan_mp_t x); @@ -917,76 +917,85 @@ BOTAN_DLL int botan_privkey_load_elgamal(botan_privkey_t* key, * Algorithm specific key operations: Ed25519 */ -BOTAN_DLL int botan_privkey_load_ed25519(botan_privkey_t* key, +BOTAN_PUBLIC_API(2,2) int botan_privkey_load_ed25519(botan_privkey_t* key, const uint8_t privkey[32]); -BOTAN_DLL int botan_pubkey_load_ed25519(botan_pubkey_t* key, +BOTAN_PUBLIC_API(2,2) int botan_pubkey_load_ed25519(botan_pubkey_t* key, const uint8_t pubkey[32]); -BOTAN_DLL int botan_privkey_ed25519_get_privkey(botan_privkey_t key, +BOTAN_PUBLIC_API(2,2) int botan_privkey_ed25519_get_privkey(botan_privkey_t key, uint8_t output[64]); -BOTAN_DLL int botan_pubkey_ed25519_get_pubkey(botan_pubkey_t key, +BOTAN_PUBLIC_API(2,2) int botan_pubkey_ed25519_get_pubkey(botan_pubkey_t key, uint8_t pubkey[32]); /* * Algorithm specific key operations: ECDSA and ECDH */ -BOTAN_DLL int botan_privkey_load_ecdsa(botan_privkey_t* key, - const botan_mp_t scalar, - const char* curve_name); - -BOTAN_DLL int botan_pubkey_load_ecdsa(botan_pubkey_t* key, - const botan_mp_t public_x, - const botan_mp_t public_y, - const char* curve_name); - -BOTAN_DLL int botan_pubkey_load_ecdh(botan_pubkey_t* key, - const botan_mp_t public_x, - const botan_mp_t public_y, - const char* curve_name); - -BOTAN_DLL int botan_privkey_load_ecdh(botan_privkey_t* key, - const botan_mp_t scalar, - const char* curve_name); - -BOTAN_DLL int botan_pubkey_load_sm2(botan_pubkey_t* key, - const botan_mp_t public_x, - const botan_mp_t public_y, - const char* curve_name); - -BOTAN_DLL int botan_privkey_load_sm2(botan_privkey_t* key, - const botan_mp_t scalar, - const char* curve_name); - -BOTAN_DLL int botan_pubkey_load_sm2_enc(botan_pubkey_t* key, - const botan_mp_t public_x, - const botan_mp_t public_y, - const char* curve_name); - -BOTAN_DLL int botan_privkey_load_sm2_enc(botan_privkey_t* key, - const botan_mp_t scalar, - const char* curve_name); - -BOTAN_DLL int botan_pubkey_sm2_compute_za(uint8_t out[], - size_t* out_len, - const char* ident, - const char* hash_algo, - const botan_pubkey_t key); +BOTAN_PUBLIC_API(2,2) +int botan_privkey_load_ecdsa(botan_privkey_t* key, + const botan_mp_t scalar, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_pubkey_load_ecdsa(botan_pubkey_t* key, + const botan_mp_t public_x, + const botan_mp_t public_y, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_pubkey_load_ecdh(botan_pubkey_t* key, + const botan_mp_t public_x, + const botan_mp_t public_y, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_privkey_load_ecdh(botan_privkey_t* key, + const botan_mp_t scalar, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_pubkey_load_sm2(botan_pubkey_t* key, + const botan_mp_t public_x, + const botan_mp_t public_y, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_privkey_load_sm2(botan_privkey_t* key, + const botan_mp_t scalar, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_pubkey_load_sm2_enc(botan_pubkey_t* key, + const botan_mp_t public_x, + const botan_mp_t public_y, + const char* curve_name); + +BOTAN_PUBLIC_API(2,2) +int botan_privkey_load_sm2_enc(botan_privkey_t* key, + const botan_mp_t scalar, + const char* curve_name); + +BOTAN_PUBLIC_API(2,3) +int botan_pubkey_sm2_compute_za(uint8_t out[], + size_t* out_len, + const char* ident, + const char* hash_algo, + const botan_pubkey_t key); /* * Public Key Encryption */ typedef struct botan_pk_op_encrypt_struct* botan_pk_op_encrypt_t; -BOTAN_DLL int botan_pk_op_encrypt_create(botan_pk_op_encrypt_t* op, +BOTAN_PUBLIC_API(2,0) int botan_pk_op_encrypt_create(botan_pk_op_encrypt_t* op, botan_pubkey_t key, const char* padding, uint32_t flags); -BOTAN_DLL int botan_pk_op_encrypt_destroy(botan_pk_op_encrypt_t op); +BOTAN_PUBLIC_API(2,0) int botan_pk_op_encrypt_destroy(botan_pk_op_encrypt_t op); -BOTAN_DLL int botan_pk_op_encrypt(botan_pk_op_encrypt_t op, +BOTAN_PUBLIC_API(2,0) int botan_pk_op_encrypt(botan_pk_op_encrypt_t op, botan_rng_t rng, uint8_t out[], size_t* out_len, const uint8_t plaintext[], size_t plaintext_len); @@ -996,13 +1005,13 @@ BOTAN_DLL int botan_pk_op_encrypt(botan_pk_op_encrypt_t op, */ typedef struct botan_pk_op_decrypt_struct* botan_pk_op_decrypt_t; -BOTAN_DLL int botan_pk_op_decrypt_create(botan_pk_op_decrypt_t* op, +BOTAN_PUBLIC_API(2,0) int botan_pk_op_decrypt_create(botan_pk_op_decrypt_t* op, botan_privkey_t key, const char* padding, uint32_t flags); -BOTAN_DLL int botan_pk_op_decrypt_destroy(botan_pk_op_decrypt_t op); +BOTAN_PUBLIC_API(2,0) int botan_pk_op_decrypt_destroy(botan_pk_op_decrypt_t op); -BOTAN_DLL int botan_pk_op_decrypt(botan_pk_op_decrypt_t op, +BOTAN_PUBLIC_API(2,0) int botan_pk_op_decrypt(botan_pk_op_decrypt_t op, uint8_t out[], size_t* out_len, const uint8_t ciphertext[], size_t ciphertext_len); @@ -1011,50 +1020,59 @@ BOTAN_DLL int botan_pk_op_decrypt(botan_pk_op_decrypt_t op, */ typedef struct botan_pk_op_sign_struct* botan_pk_op_sign_t; -BOTAN_DLL int botan_pk_op_sign_create(botan_pk_op_sign_t* op, - botan_privkey_t key, - const char* hash_and_padding, - uint32_t flags); -BOTAN_DLL int botan_pk_op_sign_destroy(botan_pk_op_sign_t op); +BOTAN_PUBLIC_API(2,0) +int botan_pk_op_sign_create(botan_pk_op_sign_t* op, + botan_privkey_t key, + const char* hash_and_padding, + uint32_t flags); + +BOTAN_PUBLIC_API(2,0) int botan_pk_op_sign_destroy(botan_pk_op_sign_t op); -BOTAN_DLL int botan_pk_op_sign_update(botan_pk_op_sign_t op, const uint8_t in[], size_t in_len); -BOTAN_DLL int botan_pk_op_sign_finish(botan_pk_op_sign_t op, botan_rng_t rng, - uint8_t sig[], size_t* sig_len); +BOTAN_PUBLIC_API(2,0) int botan_pk_op_sign_update(botan_pk_op_sign_t op, const uint8_t in[], size_t in_len); + +BOTAN_PUBLIC_API(2,0) +int botan_pk_op_sign_finish(botan_pk_op_sign_t op, botan_rng_t rng, + uint8_t sig[], size_t* sig_len); /* * Signature Verification */ typedef struct botan_pk_op_verify_struct* botan_pk_op_verify_t; -BOTAN_DLL int botan_pk_op_verify_create(botan_pk_op_verify_t* op, - botan_pubkey_t key, - const char* hash_and_padding, - uint32_t flags); -BOTAN_DLL int botan_pk_op_verify_destroy(botan_pk_op_verify_t op); +BOTAN_PUBLIC_API(2,0) +int botan_pk_op_verify_create(botan_pk_op_verify_t* op, + botan_pubkey_t key, + const char* hash_and_padding, + uint32_t flags); + +BOTAN_PUBLIC_API(2,0) int botan_pk_op_verify_destroy(botan_pk_op_verify_t op); -BOTAN_DLL int botan_pk_op_verify_update(botan_pk_op_verify_t op, const uint8_t in[], size_t in_len); -BOTAN_DLL int botan_pk_op_verify_finish(botan_pk_op_verify_t op, const uint8_t sig[], size_t sig_len); +BOTAN_PUBLIC_API(2,0) int botan_pk_op_verify_update(botan_pk_op_verify_t op, const uint8_t in[], size_t in_len); +BOTAN_PUBLIC_API(2,0) int botan_pk_op_verify_finish(botan_pk_op_verify_t op, const uint8_t sig[], size_t sig_len); /* * Key Agreement */ typedef struct botan_pk_op_ka_struct* botan_pk_op_ka_t; -BOTAN_DLL int botan_pk_op_key_agreement_create(botan_pk_op_ka_t* op, - botan_privkey_t key, - const char* kdf, - uint32_t flags); -BOTAN_DLL int botan_pk_op_key_agreement_destroy(botan_pk_op_ka_t op); +BOTAN_PUBLIC_API(2,0) +int botan_pk_op_key_agreement_create(botan_pk_op_ka_t* op, + botan_privkey_t key, + const char* kdf, + uint32_t flags); + +BOTAN_PUBLIC_API(2,0) int botan_pk_op_key_agreement_destroy(botan_pk_op_ka_t op); -BOTAN_DLL int botan_pk_op_key_agreement_export_public(botan_privkey_t key, +BOTAN_PUBLIC_API(2,0) int botan_pk_op_key_agreement_export_public(botan_privkey_t key, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_pk_op_key_agreement(botan_pk_op_ka_t op, - uint8_t out[], size_t* out_len, - const uint8_t other_key[], size_t other_key_len, - const uint8_t salt[], size_t salt_len); +BOTAN_PUBLIC_API(2,0) +int botan_pk_op_key_agreement(botan_pk_op_ka_t op, + uint8_t out[], size_t* out_len, + const uint8_t other_key[], size_t other_key_len, + const uint8_t salt[], size_t salt_len); -BOTAN_DLL int botan_pkcs_hash_id(const char* hash_name, uint8_t pkcs_id[], size_t* pkcs_id_len); +BOTAN_PUBLIC_API(2,0) int botan_pkcs_hash_id(const char* hash_name, uint8_t pkcs_id[], size_t* pkcs_id_len); /* @@ -1062,56 +1080,59 @@ BOTAN_DLL int botan_pkcs_hash_id(const char* hash_name, uint8_t pkcs_id[], size_ * @param mce_key must be a McEliece key * ct_len should be pt_len + n/8 + a few? */ -BOTAN_DLL int botan_mceies_encrypt(botan_pubkey_t mce_key, - botan_rng_t rng, - const char* aead, - const uint8_t pt[], size_t pt_len, - const uint8_t ad[], size_t ad_len, - uint8_t ct[], size_t* ct_len); - -BOTAN_DLL int botan_mceies_decrypt(botan_privkey_t mce_key, - const char* aead, - const uint8_t ct[], size_t ct_len, - const uint8_t ad[], size_t ad_len, - uint8_t pt[], size_t* pt_len); - - +BOTAN_PUBLIC_API(2,0) +int botan_mceies_encrypt(botan_pubkey_t mce_key, + botan_rng_t rng, + const char* aead, + const uint8_t pt[], size_t pt_len, + const uint8_t ad[], size_t ad_len, + uint8_t ct[], size_t* ct_len); + +BOTAN_PUBLIC_API(2,0) +int botan_mceies_decrypt(botan_privkey_t mce_key, + const char* aead, + const uint8_t ct[], size_t ct_len, + const uint8_t ad[], size_t ad_len, + uint8_t pt[], size_t* pt_len); typedef struct botan_x509_cert_struct* botan_x509_cert_t; -BOTAN_DLL int botan_x509_cert_load(botan_x509_cert_t* cert_obj, const uint8_t cert[], size_t cert_len); -BOTAN_DLL int botan_x509_cert_load_file(botan_x509_cert_t* cert_obj, const char* filename); -BOTAN_DLL int botan_x509_cert_destroy(botan_x509_cert_t cert); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_load(botan_x509_cert_t* cert_obj, const uint8_t cert[], size_t cert_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_load_file(botan_x509_cert_t* cert_obj, const char* filename); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_destroy(botan_x509_cert_t cert); -BOTAN_DLL int botan_x509_cert_gen_selfsigned(botan_x509_cert_t* cert, - botan_privkey_t key, - botan_rng_t rng, - const char* common_name, - const char* org_name); +BOTAN_PUBLIC_API(2,0) +int botan_x509_cert_gen_selfsigned(botan_x509_cert_t* cert, + botan_privkey_t key, + botan_rng_t rng, + const char* common_name, + const char* org_name); // TODO: return botan_time_struct instead -BOTAN_DLL int botan_x509_cert_get_time_starts(botan_x509_cert_t cert, char out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_time_expires(botan_x509_cert_t cert, char out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_time_starts(botan_x509_cert_t cert, char out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_time_expires(botan_x509_cert_t cert, char out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_fingerprint(botan_x509_cert_t cert, const char* hash, uint8_t out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_fingerprint(botan_x509_cert_t cert, const char* hash, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_serial_number(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_authority_key_id(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_subject_key_id(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_serial_number(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_authority_key_id(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_subject_key_id(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_public_key_bits(botan_x509_cert_t cert, +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_public_key_bits(botan_x509_cert_t cert, uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_public_key(botan_x509_cert_t cert, botan_pubkey_t* key); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_get_public_key(botan_x509_cert_t cert, botan_pubkey_t* key); -BOTAN_DLL int botan_x509_cert_get_issuer_dn(botan_x509_cert_t cert, - const char* key, size_t index, - uint8_t out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) +int botan_x509_cert_get_issuer_dn(botan_x509_cert_t cert, + const char* key, size_t index, + uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_get_subject_dn(botan_x509_cert_t cert, - const char* key, size_t index, - uint8_t out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) +int botan_x509_cert_get_subject_dn(botan_x509_cert_t cert, + const char* key, size_t index, + uint8_t out[], size_t* out_len); -BOTAN_DLL int botan_x509_cert_to_string(botan_x509_cert_t cert, char out[], size_t* out_len); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_to_string(botan_x509_cert_t cert, char out[], size_t* out_len); // Must match values of Key_Constraints in key_constraints.h enum botan_x509_cert_key_constraints { @@ -1127,18 +1148,20 @@ enum botan_x509_cert_key_constraints { DECIPHER_ONLY = 128 }; -BOTAN_DLL int botan_x509_cert_allowed_usage(botan_x509_cert_t cert, unsigned int key_usage); +BOTAN_PUBLIC_API(2,0) int botan_x509_cert_allowed_usage(botan_x509_cert_t cert, unsigned int key_usage); /** * Key wrapping as per RFC 3394 */ -BOTAN_DLL int botan_key_wrap3394(const uint8_t key[], size_t key_len, - const uint8_t kek[], size_t kek_len, - uint8_t wrapped_key[], size_t *wrapped_key_len); +BOTAN_PUBLIC_API(2,2) +int botan_key_wrap3394(const uint8_t key[], size_t key_len, + const uint8_t kek[], size_t kek_len, + uint8_t wrapped_key[], size_t *wrapped_key_len); -BOTAN_DLL int botan_key_unwrap3394(const uint8_t wrapped_key[], size_t wrapped_key_len, - const uint8_t kek[], size_t kek_len, - uint8_t key[], size_t *key_len); +BOTAN_PUBLIC_API(2,2) +int botan_key_unwrap3394(const uint8_t wrapped_key[], size_t wrapped_key_len, + const uint8_t kek[], size_t kek_len, + uint8_t key[], size_t *key_len); /* * TLS (WIP) @@ -1147,15 +1170,15 @@ BOTAN_DLL int botan_key_unwrap3394(const uint8_t wrapped_key[], size_t wrapped_k typedef struct botan_tls_session_struct* botan_tls_session_t; -BOTAN_DLL int botan_tls_session_decrypt(botan_tls_session_t* session, +BOTAN_TEST_API int botan_tls_session_decrypt(botan_tls_session_t* session, const uint8_t key[], size_t key_len, const uint8_t blob[], size_t blob_len); -BOTAN_DLL int botan_tls_session_get_version(botan_tls_session_t session, uint16_t* tls_version); -BOTAN_DLL int botan_tls_session_get_ciphersuite(botan_tls_session_t session, uint16_t* ciphersuite); -BOTAN_DLL int botan_tls_session_encrypt(botan_tls_session_t session, botan_rng_t rng, uint8_t key[], size_t* key_len); +BOTAN_TEST_API int botan_tls_session_get_version(botan_tls_session_t session, uint16_t* tls_version); +BOTAN_TEST_API int botan_tls_session_get_ciphersuite(botan_tls_session_t session, uint16_t* ciphersuite); +BOTAN_TEST_API int botan_tls_session_encrypt(botan_tls_session_t session, botan_rng_t rng, uint8_t key[], size_t* key_len); -BOTAN_DLL int botan_tls_session_get_peer_certs(botan_tls_session_t session, botan_x509_cert_t certs[], size_t* cert_len); +BOTAN_TEST_API int botan_tls_session_get_peer_certs(botan_tls_session_t session, botan_x509_cert_t certs[], size_t* cert_len); // TODO: peer certs, validation, ... @@ -1171,33 +1194,33 @@ typedef void (*botan_tls_channel_session_established)(void* application_data, botan_tls_channel_t channel, botan_tls_session_t session); -BOTAN_DLL int botan_tls_channel_init_client(botan_tls_channel_t* channel, +BOTAN_TEST_API int botan_tls_channel_init_client(botan_tls_channel_t* channel, botan_tls_channel_output_fn output_fn, botan_tls_channel_data_cb data_cb, botan_tls_channel_alert_cb alert_cb, botan_tls_channel_session_established session_cb, const char* server_name); -BOTAN_DLL int botan_tls_channel_init_server(botan_tls_channel_t* channel, +BOTAN_TEST_API int botan_tls_channel_init_server(botan_tls_channel_t* channel, botan_tls_channel_output_fn output_fn, botan_tls_channel_data_cb data_cb, botan_tls_channel_alert_cb alert_cb, botan_tls_channel_session_established session_cb); -BOTAN_DLL int botan_tls_channel_received_data(botan_tls_channel_t chan, +BOTAN_TEST_API int botan_tls_channel_received_data(botan_tls_channel_t chan, const uint8_t input[], size_t len); /** * Returns 0 for client, 1 for server, negative for error */ -BOTAN_DLL int botan_tls_channel_type(botan_tls_channel_t chan); +BOTAN_TEST_API int botan_tls_channel_type(botan_tls_channel_t chan); -BOTAN_DLL int botan_tls_channel_send(botan_tls_channel_t chan, +BOTAN_TEST_API int botan_tls_channel_send(botan_tls_channel_t chan, const uint8_t input[], size_t len); -BOTAN_DLL int botan_tls_channel_close(botan_tls_channel_t chan); +BOTAN_TEST_API int botan_tls_channel_close(botan_tls_channel_t chan); -BOTAN_DLL int botan_tls_channel_destroy(botan_tls_channel_t chan); +BOTAN_TEST_API int botan_tls_channel_destroy(botan_tls_channel_t chan); #endif #ifdef __cplusplus diff --git a/src/lib/hash/sm3/sm3.h b/src/lib/hash/sm3/sm3.h index dd76ab4d0..f065637a3 100644 --- a/src/lib/hash/sm3/sm3.h +++ b/src/lib/hash/sm3/sm3.h @@ -20,7 +20,7 @@ enum { /** * SM3 */ -class BOTAN_DLL SM3 final : public MDx_HashFunction +class BOTAN_PUBLIC_API(2,2) SM3 final : public MDx_HashFunction { public: std::string name() const override { return "SM3"; } diff --git a/src/lib/hash/streebog/streebog.h b/src/lib/hash/streebog/streebog.h index 5451dfbfe..1bc2cd9db 100644 --- a/src/lib/hash/streebog/streebog.h +++ b/src/lib/hash/streebog/streebog.h @@ -16,7 +16,7 @@ namespace Botan { * Streebog (GOST R 34.11-2012) * RFC 6986 */ -class BOTAN_DLL Streebog: public HashFunction +class BOTAN_PUBLIC_API(2,2) Streebog: public HashFunction { public: size_t output_length() const override { return m_output_bits / 8; } @@ -48,7 +48,7 @@ class BOTAN_DLL Streebog: public HashFunction /** * Streebog-256 */ -class BOTAN_DLL Streebog_256 final : public Streebog +class BOTAN_PUBLIC_API(2,2) Streebog_256 final : public Streebog { public: Streebog_256() : Streebog(256) {} @@ -57,7 +57,7 @@ class BOTAN_DLL Streebog_256 final : public Streebog /** * Streebog-512 */ -class BOTAN_DLL Streebog_512 final : public Streebog +class BOTAN_PUBLIC_API(2,2) Streebog_512 final : public Streebog { public: Streebog_512() : Streebog(512) {} diff --git a/src/lib/prov/openssl/openssl_mode.cpp b/src/lib/prov/openssl/openssl_mode.cpp index bbb193feb..e056dda16 100644 --- a/src/lib/prov/openssl/openssl_mode.cpp +++ b/src/lib/prov/openssl/openssl_mode.cpp @@ -15,7 +15,7 @@ namespace Botan { namespace { -class BOTAN_DLL OpenSSL_Cipher_Mode : public Cipher_Mode +class OpenSSL_Cipher_Mode : public Cipher_Mode { public: OpenSSL_Cipher_Mode(const std::string& name, diff --git a/src/lib/rng/chacha_rng/chacha_rng.h b/src/lib/rng/chacha_rng/chacha_rng.h index 7deaa2d89..f61be1e8b 100644 --- a/src/lib/rng/chacha_rng/chacha_rng.h +++ b/src/lib/rng/chacha_rng/chacha_rng.h @@ -37,7 +37,7 @@ class Entropy_Sources; * The primary reason to use it is in cases where the other RNGs are * not fast enough. */ -class BOTAN_DLL ChaCha_RNG final : public Stateful_RNG +class BOTAN_PUBLIC_API(2,3) ChaCha_RNG final : public Stateful_RNG { public: /** diff --git a/src/lib/tls/tls_messages.h b/src/lib/tls/tls_messages.h index 892104888..aa31fce8d 100644 --- a/src/lib/tls/tls_messages.h +++ b/src/lib/tls/tls_messages.h @@ -320,7 +320,7 @@ class BOTAN_UNSTABLE_API Server_Hello final : public Handshake_Message /** * Client Key Exchange Message */ -class BOTAN_DLL Client_Key_Exchange final : public Handshake_Message +class BOTAN_UNSTABLE_API Client_Key_Exchange final : public Handshake_Message { public: Handshake_Type type() const override { return CLIENT_KEX; } @@ -354,7 +354,7 @@ class BOTAN_DLL Client_Key_Exchange final : public Handshake_Message /** * Certificate Message */ -class BOTAN_DLL Certificate final : public Handshake_Message +class BOTAN_UNSTABLE_API Certificate final : public Handshake_Message { public: Handshake_Type type() const override { return CERTIFICATE; } @@ -377,7 +377,7 @@ class BOTAN_DLL Certificate final : public Handshake_Message /** * Certificate Status (RFC 6066) */ -class BOTAN_DLL Certificate_Status final : public Handshake_Message +class BOTAN_UNSTABLE_API Certificate_Status final : public Handshake_Message { public: Handshake_Type type() const override { return CERTIFICATE_STATUS; } @@ -398,7 +398,7 @@ class BOTAN_DLL Certificate_Status final : public Handshake_Message /** * Certificate Request Message */ -class BOTAN_DLL Certificate_Req final : public Handshake_Message +class BOTAN_UNSTABLE_API Certificate_Req final : public Handshake_Message { public: Handshake_Type type() const override { return CERTIFICATE_REQUEST; } @@ -465,7 +465,7 @@ class BOTAN_UNSTABLE_API Certificate_Verify final : public Handshake_Message /** * Finished Message */ -class BOTAN_DLL Finished final : public Handshake_Message +class BOTAN_UNSTABLE_API Finished final : public Handshake_Message { public: Handshake_Type type() const override { return FINISHED; } @@ -504,7 +504,7 @@ class BOTAN_UNSTABLE_API Hello_Request final : public Handshake_Message /** * Server Key Exchange Message */ -class BOTAN_DLL Server_Key_Exchange final : public Handshake_Message +class BOTAN_UNSTABLE_API Server_Key_Exchange final : public Handshake_Message { public: Handshake_Type type() const override { return SERVER_KEX; } @@ -572,7 +572,7 @@ class BOTAN_DLL Server_Key_Exchange final : public Handshake_Message /** * Server Hello Done Message */ -class BOTAN_DLL Server_Hello_Done final : public Handshake_Message +class BOTAN_UNSTABLE_API Server_Hello_Done final : public Handshake_Message { public: Handshake_Type type() const override { return SERVER_HELLO_DONE; } @@ -613,7 +613,7 @@ class BOTAN_UNSTABLE_API New_Session_Ticket final : public Handshake_Message /** * Change Cipher Spec */ -class BOTAN_DLL Change_Cipher_Spec final : public Handshake_Message +class BOTAN_UNSTABLE_API Change_Cipher_Spec final : public Handshake_Message { public: Handshake_Type type() const override { return HANDSHAKE_CCS; } diff --git a/src/lib/tls/tls_policy.h b/src/lib/tls/tls_policy.h index 62638ab10..65112c771 100644 --- a/src/lib/tls/tls_policy.h +++ b/src/lib/tls/tls_policy.h @@ -342,7 +342,7 @@ class BOTAN_PUBLIC_API(2,0) NSA_Suite_B_128 : public Policy /** * BSI TR-02102-2 Policy */ -class BOTAN_DLL BSI_TR_02102_2 : public Policy +class BOTAN_PUBLIC_API(2,0) BSI_TR_02102_2 : public Policy { public: std::vector<std::string> allowed_ciphers() const override diff --git a/src/lib/utils/cpuid/cpuid.h b/src/lib/utils/cpuid/cpuid.h index b32d040ea..061e2d124 100644 --- a/src/lib/utils/cpuid/cpuid.h +++ b/src/lib/utils/cpuid/cpuid.h @@ -33,7 +33,7 @@ namespace Botan { * thread-unsafe mechanism involving executing probe functions which * catching SIGILL signal is used. */ -class BOTAN_DLL CPUID +class BOTAN_PUBLIC_API(2,1) CPUID { public: /** diff --git a/src/lib/utils/os_utils.h b/src/lib/utils/os_utils.h index 2146e11b3..107a6904f 100644 --- a/src/lib/utils/os_utils.h +++ b/src/lib/utils/os_utils.h @@ -18,7 +18,7 @@ namespace OS { /* * This header is internal (not installed) and these functions are not * intended to be called by applications. However they are given public -* visibility (using BOTAN_DLL macro) for the tests. This also probably +* visibility (using BOTAN_TEST_API macro) for the tests. This also probably * allows them to be overridden by the application on ELF systems, but * this hasn't been tested. */ @@ -27,7 +27,7 @@ namespace OS { /** * A wrapper around a simple blocking TCP socket */ -class BOTAN_DLL Socket +class BOTAN_TEST_API Socket { public: /** @@ -53,7 +53,7 @@ class BOTAN_DLL Socket * not available on this platform. */ std::unique_ptr<Socket> -BOTAN_DLL open_socket(const std::string& hostname, +BOTAN_TEST_API open_socket(const std::string& hostname, const std::string& service); /** @@ -62,7 +62,7 @@ BOTAN_DLL open_socket(const std::string& hostname, * On IncludeOS it returns 0 since there is no process ID to speak of * in a unikernel. */ -uint32_t BOTAN_DLL get_process_id(); +uint32_t BOTAN_TEST_API get_process_id(); /** * @return CPU processor clock, if available @@ -73,7 +73,7 @@ uint32_t BOTAN_DLL get_process_id(); * Currently supported processors are x86, PPC, Alpha, SPARC, IA-64, S/390x, and HP-PA. * If no CPU cycle counter is available on this system, returns zero. */ -uint64_t BOTAN_DLL get_processor_timestamp(); +uint64_t BOTAN_TEST_API get_processor_timestamp(); /* * @return best resolution timestamp available @@ -85,13 +85,13 @@ uint64_t BOTAN_DLL get_processor_timestamp(); * On POSIX platforms clock_gettime is used with a monotonic timer * As a final fallback std::chrono::high_resolution_clock is used. */ -uint64_t BOTAN_DLL get_high_resolution_clock(); +uint64_t BOTAN_TEST_API get_high_resolution_clock(); /** * @return system clock (reflecting wall clock) with best resolution * available, normalized to nanoseconds resolution. */ -uint64_t BOTAN_DLL get_system_timestamp_ns(); +uint64_t BOTAN_TEST_API get_system_timestamp_ns(); /** * @return maximum amount of memory (in bytes) Botan could/should @@ -136,7 +136,7 @@ void free_locked_pages(void* ptr, size_t length); * Return codes: * -1 illegal instruction detected */ -int BOTAN_DLL run_cpu_instruction_probe(std::function<int ()> probe_fn); +int BOTAN_TEST_API run_cpu_instruction_probe(std::function<int ()> probe_fn); } |