diff options
-rw-r--r-- | src/lib/base/init.cpp | 23 | ||||
-rw-r--r-- | src/lib/base/init.h | 11 | ||||
-rw-r--r-- | src/lib/mac/cmac/cmac.cpp | 2 | ||||
-rw-r--r-- | src/lib/math/ec_gfp/curve_nistp.cpp | 4 | ||||
-rw-r--r-- | src/lib/modes/xts/xts.cpp | 4 | ||||
-rw-r--r-- | src/lib/pubkey/curve25519/donna.cpp | 2 |
6 files changed, 36 insertions, 10 deletions
diff --git a/src/lib/base/init.cpp b/src/lib/base/init.cpp new file mode 100644 index 000000000..1befc34d2 --- /dev/null +++ b/src/lib/base/init.cpp @@ -0,0 +1,23 @@ +/* +* (C) 2015 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#include <botan/init.h> + +namespace Botan { + +//static +void LibraryInitializer::initialize(const std::string&) + { + // none needed currently + } + +//static +void LibraryInitializer::deinitialize() + { + // none needed currently + } + +} diff --git a/src/lib/base/init.h b/src/lib/base/init.h index dce564b46..b73355628 100644 --- a/src/lib/base/init.h +++ b/src/lib/base/init.h @@ -19,13 +19,14 @@ namespace Botan { * case, and this class is no longer needed and kept only for backwards * compatability. */ -class LibraryInitializer +class BOTAN_DLL LibraryInitializer { public: - LibraryInitializer(const std::string& = "") {} - ~LibraryInitializer() {} - static void initialize(const std::string& = "") {} - static void deinitialize() {} + LibraryInitializer(const std::string& s = "") { initialize(s); } + ~LibraryInitializer() { deinitialize(); } + + static void initialize(const std::string& = ""); + static void deinitialize(); }; } diff --git a/src/lib/mac/cmac/cmac.cpp b/src/lib/mac/cmac/cmac.cpp index 0b867af8f..e56aa145b 100644 --- a/src/lib/mac/cmac/cmac.cpp +++ b/src/lib/mac/cmac/cmac.cpp @@ -27,7 +27,7 @@ BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, "CMAC", CMAC, CMAC::make); */ secure_vector<byte> CMAC::poly_double(const secure_vector<byte>& in) { - const bool top_carry = (in[0] & 0x80); + const bool top_carry = static_cast<bool>(in[0] & 0x80); secure_vector<byte> out = in; diff --git a/src/lib/math/ec_gfp/curve_nistp.cpp b/src/lib/math/ec_gfp/curve_nistp.cpp index 4f99b54f0..f3ac39aa1 100644 --- a/src/lib/math/ec_gfp/curve_nistp.cpp +++ b/src/lib/math/ec_gfp/curve_nistp.cpp @@ -113,8 +113,10 @@ inline u32bit get_u32bit(const BigInt& x, size_t i) * Treating this MPI as a sequence of 32-bit words in big-endian * order, set word i to the value x */ -inline void set_u32bit(BigInt& x, size_t i, u32bit v) +template<typename T> +inline void set_u32bit(BigInt& x, size_t i, T v_in) { + const u32bit v = static_cast<u32bit>(v_in); #if (BOTAN_MP_WORD_BITS == 32) x.set_word_at(i, v); #elif (BOTAN_MP_WORD_BITS == 64) diff --git a/src/lib/modes/xts/xts.cpp b/src/lib/modes/xts/xts.cpp index a4095580c..440d76ec2 100644 --- a/src/lib/modes/xts/xts.cpp +++ b/src/lib/modes/xts/xts.cpp @@ -19,7 +19,7 @@ void poly_double_128(byte out[], const byte in[]) u64bit X0 = load_le<u64bit>(in, 0); u64bit X1 = load_le<u64bit>(in, 1); - const bool carry = (X1 >> 63); + const bool carry = static_cast<bool>(X1 >> 63); X1 = (X1 << 1) | (X0 >> 63); X0 = (X0 << 1); @@ -33,7 +33,7 @@ void poly_double_128(byte out[], const byte in[]) void poly_double_64(byte out[], const byte in[]) { u64bit X = load_le<u64bit>(in, 0); - const bool carry = (X >> 63); + const bool carry = static_cast<bool>(X >> 63); X <<= 1; if(carry) X ^= 0x1B; diff --git a/src/lib/pubkey/curve25519/donna.cpp b/src/lib/pubkey/curve25519/donna.cpp index 83d68ff6b..4fab78cb8 100644 --- a/src/lib/pubkey/curve25519/donna.cpp +++ b/src/lib/pubkey/curve25519/donna.cpp @@ -322,7 +322,7 @@ fmonty(limb *x2, limb *z2, /* output 2Q */ static void swap_conditional(limb a[5], limb b[5], limb iswap) { unsigned i; - const limb swap = -iswap; + const limb swap = static_cast<limb>(-iswap); for (i = 0; i < 5; ++i) { const limb x = swap & (a[i] ^ b[i]); |