diff options
author | Jack Lloyd <[email protected]> | 2016-12-27 15:48:00 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-19 22:30:41 -0400 |
commit | 12c4dfec24e999ab80ff3a45e0b837976d4c390c (patch) | |
tree | 7de91a2b86aec055800b8e046729fcc10a31d6d8 /src/lib/math/numbertheory/numthry.h | |
parent | 0c6c4e058109791a9f17971ca782dc10af3eb9bc (diff) |
Add API stability annotations.
Defined in build.h, all equal to BOTAN_DLL so ties into existing
system for exporting symbols.
Diffstat (limited to 'src/lib/math/numbertheory/numthry.h')
-rw-r--r-- | src/lib/math/numbertheory/numthry.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/lib/math/numbertheory/numthry.h b/src/lib/math/numbertheory/numthry.h index e788caec1..25110e309 100644 --- a/src/lib/math/numbertheory/numthry.h +++ b/src/lib/math/numbertheory/numthry.h @@ -21,7 +21,7 @@ namespace Botan { * @param c an integer * @return (a*b)+c */ -BigInt BOTAN_DLL mul_add(const BigInt& a, +BigInt BOTAN_PUBLIC_API(2,0) mul_add(const BigInt& a, const BigInt& b, const BigInt& c); @@ -32,7 +32,7 @@ BigInt BOTAN_DLL mul_add(const BigInt& a, * @param c an integer * @return (a-b)*c */ -BigInt BOTAN_DLL sub_mul(const BigInt& a, +BigInt BOTAN_PUBLIC_API(2,0) sub_mul(const BigInt& a, const BigInt& b, const BigInt& c); @@ -43,7 +43,7 @@ BigInt BOTAN_DLL sub_mul(const BigInt& a, * @param c an integer * @return (a*b)-c */ -BigInt BOTAN_DLL mul_sub(const BigInt& a, +BigInt BOTAN_PUBLIC_API(2,0) mul_sub(const BigInt& a, const BigInt& b, const BigInt& c); @@ -60,7 +60,7 @@ inline BigInt abs(const BigInt& n) { return n.abs(); } * @param y a positive integer * @return gcd(x,y) */ -BigInt BOTAN_DLL gcd(const BigInt& x, const BigInt& y); +BigInt BOTAN_PUBLIC_API(2,0) gcd(const BigInt& x, const BigInt& y); /** * Least common multiple @@ -68,13 +68,13 @@ BigInt BOTAN_DLL gcd(const BigInt& x, const BigInt& y); * @param y a positive integer * @return z, smallest integer such that z % x == 0 and z % y == 0 */ -BigInt BOTAN_DLL lcm(const BigInt& x, const BigInt& y); +BigInt BOTAN_PUBLIC_API(2,0) lcm(const BigInt& x, const BigInt& y); /** * @param x an integer * @return (x*x) */ -BigInt BOTAN_DLL square(const BigInt& x); +BigInt BOTAN_PUBLIC_API(2,0) square(const BigInt& x); /** * Modular inversion @@ -83,28 +83,28 @@ BigInt BOTAN_DLL square(const BigInt& x); * @return y st (x*y) % modulus == 1 or 0 if no such value * Not const time */ -BigInt BOTAN_DLL inverse_mod(const BigInt& x, +BigInt BOTAN_PUBLIC_API(2,0) inverse_mod(const BigInt& x, const BigInt& modulus); /** * Const time modular inversion * Requires the modulus be odd */ -BigInt BOTAN_DLL ct_inverse_mod_odd_modulus(const BigInt& n, const BigInt& mod); +BigInt BOTAN_PUBLIC_API(2,0) ct_inverse_mod_odd_modulus(const BigInt& n, const BigInt& mod); /** * Return a^-1 * 2^k mod b * Returns k, between n and 2n * Not const time */ -size_t BOTAN_DLL almost_montgomery_inverse(BigInt& result, +size_t BOTAN_PUBLIC_API(2,0) almost_montgomery_inverse(BigInt& result, const BigInt& a, const BigInt& b); /** * Call almost_montgomery_inverse and correct the result to a^-1 mod b */ -BigInt BOTAN_DLL normalized_montgomery_inverse(const BigInt& a, const BigInt& b); +BigInt BOTAN_PUBLIC_API(2,0) normalized_montgomery_inverse(const BigInt& a, const BigInt& b); /** @@ -116,7 +116,7 @@ BigInt BOTAN_DLL normalized_montgomery_inverse(const BigInt& a, const BigInt& b) * @param n is an odd integer > 1 * @return (n / m) */ -int32_t BOTAN_DLL jacobi(const BigInt& a, +int32_t BOTAN_PUBLIC_API(2,0) jacobi(const BigInt& a, const BigInt& n); /** @@ -126,7 +126,7 @@ int32_t BOTAN_DLL jacobi(const BigInt& a, * @param m a positive modulus * @return (b^x) % m */ -BigInt BOTAN_DLL power_mod(const BigInt& b, +BigInt BOTAN_PUBLIC_API(2,0) power_mod(const BigInt& b, const BigInt& x, const BigInt& m); @@ -138,14 +138,14 @@ BigInt BOTAN_DLL power_mod(const BigInt& b, * @param p the prime * @return y such that (y*y)%p == x, or -1 if no such integer */ -BigInt BOTAN_DLL ressol(const BigInt& x, const BigInt& p); +BigInt BOTAN_PUBLIC_API(2,0) ressol(const BigInt& x, const BigInt& p); /* * Compute -input^-1 mod 2^MP_WORD_BITS. Returns zero if input * is even. If input is odd, input and 2^n are relatively prime * and an inverse exists. */ -word BOTAN_DLL monty_inverse(word input); +word BOTAN_PUBLIC_API(2,0) monty_inverse(word input); /** * @param x a positive integer @@ -153,7 +153,7 @@ word BOTAN_DLL monty_inverse(word input); * value of n such that 2^n divides x evenly. Returns zero if * n is less than or equal to zero. */ -size_t BOTAN_DLL low_zero_bits(const BigInt& x); +size_t BOTAN_PUBLIC_API(2,0) low_zero_bits(const BigInt& x); /** * Check for primality @@ -163,7 +163,7 @@ size_t BOTAN_DLL low_zero_bits(const BigInt& x); * @param is_random true if n was randomly chosen by us * @return true if all primality tests passed, otherwise false */ -bool BOTAN_DLL is_prime(const BigInt& n, +bool BOTAN_PUBLIC_API(2,0) is_prime(const BigInt& n, RandomNumberGenerator& rng, size_t prob = 56, bool is_random = false); @@ -188,7 +188,7 @@ inline bool verify_prime(const BigInt& n, RandomNumberGenerator& rng) * @param equiv_mod the modulus equiv should be checked against * @return random prime with the specified criteria */ -BigInt BOTAN_DLL random_prime(RandomNumberGenerator& rng, +BigInt BOTAN_PUBLIC_API(2,0) random_prime(RandomNumberGenerator& rng, size_t bits, const BigInt& coprime = 1, size_t equiv = 1, size_t equiv_mod = 2); @@ -198,7 +198,7 @@ BigInt BOTAN_DLL random_prime(RandomNumberGenerator& rng, * @param bits is how long the resulting prime should be * @return prime randomly chosen from safe primes of length bits */ -BigInt BOTAN_DLL random_safe_prime(RandomNumberGenerator& rng, +BigInt BOTAN_PUBLIC_API(2,0) random_safe_prime(RandomNumberGenerator& rng, size_t bits); /** @@ -210,7 +210,7 @@ BigInt BOTAN_DLL random_safe_prime(RandomNumberGenerator& rng, * @param qbits how long q will be in bits * @return random seed used to generate this parameter set */ -std::vector<uint8_t> BOTAN_DLL +std::vector<uint8_t> BOTAN_PUBLIC_API(2,0) generate_dsa_primes(RandomNumberGenerator& rng, BigInt& p_out, BigInt& q_out, size_t pbits, size_t qbits); @@ -227,7 +227,7 @@ generate_dsa_primes(RandomNumberGenerator& rng, * @return true if seed generated a valid DSA parameter set, otherwise false. p_out and q_out are only valid if true was returned. */ -bool BOTAN_DLL +bool BOTAN_PUBLIC_API(2,0) generate_dsa_primes(RandomNumberGenerator& rng, BigInt& p_out, BigInt& q_out, size_t pbits, size_t qbits, @@ -242,7 +242,7 @@ const size_t PRIME_TABLE_SIZE = 6541; /** * A const array of all primes less than 65535 */ -extern const uint16_t BOTAN_DLL PRIMES[]; +extern const uint16_t BOTAN_PUBLIC_API(2,0) PRIMES[]; } |