aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-11-06 09:53:12 -0500
committerJack Lloyd <[email protected]>2020-11-06 09:53:12 -0500
commit332c2c088465f3e0e5fe498ba08dcc31a3e9cbd8 (patch)
tree3a048ec36c8d5b5251ec02b6878a8d7a44165a4b /src/lib
parent1d8bc7a741a2d0fa9be1cb03537a2a9fb966d188 (diff)
parenta8ebbafdf34fb33817cbb1c5bbafa1668befd65c (diff)
Merge GH #2455 Switch to C++17 mode and prune CI configurations
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/block/aes/aes_power8/aes_power8.cpp6
-rw-r--r--src/lib/block/aes/aes_vperm/aes_vperm.cpp6
-rw-r--r--src/lib/prov/openssl/openssl_rsa.cpp2
-rw-r--r--src/lib/utils/dyn_load/dyn_load.cpp4
-rw-r--r--src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp8
5 files changed, 14 insertions, 12 deletions
diff --git a/src/lib/block/aes/aes_power8/aes_power8.cpp b/src/lib/block/aes/aes_power8/aes_power8.cpp
index 18bc85933..8ab784a50 100644
--- a/src/lib/block/aes/aes_power8/aes_power8.cpp
+++ b/src/lib/block/aes/aes_power8/aes_power8.cpp
@@ -40,17 +40,17 @@ inline Altivec8x16 reverse_vec(Altivec8x16 src)
inline Altivec64x2 load_key(const uint32_t key[])
{
- return (Altivec64x2)reverse_vec((Altivec8x16)vec_vsx_ld(0, key));;
+ return reinterpret_cast<Altivec64x2>(reverse_vec(reinterpret_cast<Altivec8x16>(vec_vsx_ld(0, key))));
}
inline Altivec64x2 load_block(const uint8_t src[])
{
- return (Altivec64x2)reverse_vec(vec_vsx_ld(0, src));
+ return reinterpret_cast<Altivec64x2>(reverse_vec(vec_vsx_ld(0, src)));
}
inline void store_block(Altivec64x2 src, uint8_t dest[])
{
- vec_vsx_st(reverse_vec((Altivec8x16)src), 0, dest);
+ vec_vsx_st(reverse_vec(reinterpret_cast<Altivec8x16>(src)), 0, dest);
}
inline void store_blocks(Altivec64x2 B0, Altivec64x2 B1,
diff --git a/src/lib/block/aes/aes_vperm/aes_vperm.cpp b/src/lib/block/aes/aes_vperm/aes_vperm.cpp
index 4ae6bb223..3c71421b6 100644
--- a/src/lib/block/aes/aes_vperm/aes_vperm.cpp
+++ b/src/lib/block/aes/aes_vperm/aes_vperm.cpp
@@ -44,9 +44,9 @@ inline SIMD_4x32 BOTAN_FUNC_ISA(BOTAN_VPERM_ISA) shuffle(SIMD_4x32 a, SIMD_4x32
#elif defined(BOTAN_SIMD_USE_ALTIVEC)
const auto zero = vec_splat_s8(0x00);
- const auto mask = vec_cmplt((__vector signed char)b.raw(), zero);
- const auto r = vec_perm((__vector signed char)a.raw(), (__vector signed char)a.raw(), (__vector unsigned char)b.raw());
- return SIMD_4x32((__vector unsigned int)vec_sel(r, zero, mask));
+ const auto mask = vec_cmplt(reinterpret_cast<__vector signed char>(b.raw()), zero);
+ const auto r = vec_perm(reinterpret_cast<__vector signed char>(a.raw()), reinterpret_cast<__vector signed char>(a.raw()), reinterpret_cast<__vector unsigned char>(b.raw()));
+ return SIMD_4x32(reinterpret_cast<__vector unsigned int>(vec_sel(r, zero, mask)));
#else
#error "No shuffle implementation available"
diff --git a/src/lib/prov/openssl/openssl_rsa.cpp b/src/lib/prov/openssl/openssl_rsa.cpp
index 6744b35b2..8fbfa6b5d 100644
--- a/src/lib/prov/openssl/openssl_rsa.cpp
+++ b/src/lib/prov/openssl/openssl_rsa.cpp
@@ -59,7 +59,7 @@ class OpenSSL_RSA_Encryption_Operation final : public PK_Ops::Encryption
size_t ciphertext_length(size_t) const override { return ::RSA_size(m_openssl_rsa.get()); }
- size_t max_input_bits() const override { return m_bits; };
+ size_t max_input_bits() const override { return m_bits; }
secure_vector<uint8_t> encrypt(const uint8_t msg[], size_t msg_len,
RandomNumberGenerator&) override
diff --git a/src/lib/utils/dyn_load/dyn_load.cpp b/src/lib/utils/dyn_load/dyn_load.cpp
index b32fe4b3a..c9f455b3a 100644
--- a/src/lib/utils/dyn_load/dyn_load.cpp
+++ b/src/lib/utils/dyn_load/dyn_load.cpp
@@ -58,7 +58,7 @@ Dynamically_Loaded_Library::~Dynamically_Loaded_Library()
#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
::dlclose(m_lib);
#elif defined(BOTAN_TARGET_OS_HAS_WIN32)
- ::FreeLibrary((HMODULE)m_lib);
+ ::FreeLibrary(reinterpret_cast<HMODULE>(m_lib));
#endif
}
@@ -69,7 +69,7 @@ void* Dynamically_Loaded_Library::resolve_symbol(const std::string& symbol)
#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
addr = ::dlsym(m_lib, symbol.c_str());
#elif defined(BOTAN_TARGET_OS_HAS_WIN32)
- addr = reinterpret_cast<void*>(::GetProcAddress((HMODULE)m_lib, symbol.c_str()));
+ addr = reinterpret_cast<void*>(::GetProcAddress(reinterpret_cast<HMODULE>(m_lib), symbol.c_str()));
#endif
if(!addr)
diff --git a/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp b/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp
index b1feb98f0..8d9342b57 100644
--- a/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp
+++ b/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp
@@ -68,9 +68,11 @@ BOTAN_FORCE_INLINE SIMD_4x32 BOTAN_FUNC_ISA(BOTAN_CLMUL_ISA) clmul(const SIMD_4x
i2 = mask_lo.andc(i2);
}
- return SIMD_4x32((__vector unsigned int)__builtin_crypto_vpmsumd(
- (__vector unsigned long)i1.raw(),
- (__vector unsigned long)i2.raw())
+ return SIMD_4x32(
+ reinterpret_cast<__vector unsigned int>(
+ __builtin_crypto_vpmsumd(
+ reinterpret_cast<__vector unsigned long>(i1.raw()),
+ reinterpret_cast<__vector unsigned long>(i2.raw())))
);
#endif
}