diff --git a/repertory/librepertory/include/utils/encryption.hpp b/repertory/librepertory/include/utils/encryption.hpp index fa7a14dd..1b186668 100644 --- a/repertory/librepertory/include/utils/encryption.hpp +++ b/repertory/librepertory/include/utils/encryption.hpp @@ -68,7 +68,9 @@ decrypt_data(const key_type &key, const unsigned char *buffer, template [[nodiscard]] inline auto decrypt_data(const key_type &key, const buffer &buf, result &res) -> bool { - return decrypt_data(key, buf.data(), buf.size(), res); + return decrypt_data( + key, reinterpret_cast(buf.data()), buf.size(), + res); } template @@ -134,13 +136,15 @@ inline void encrypt_data(std::string_view encryption_token, template inline void encrypt_data(std::string_view encryption_token, const buffer &buf, result &res) { - encrypt_data(generate_key(encryption_token), buf.data(), buf.size(), - res); + encrypt_data(generate_key(encryption_token), + reinterpret_cast(buf.data()), + buf.size(), res); } template inline void encrypt_data(const key_type &key, const buffer &buf, result &res) { - encrypt_data(key, buf.data(), buf.size(), res); + encrypt_data(key, reinterpret_cast(buf.data()), + buf.size(), res); } template @@ -148,7 +152,9 @@ inline void encrypt_data(const std::array &iv, const key_type &key, const buffer &buf, result &res) { - encrypt_data(iv, key, buf.data(), buf.size(), res); + encrypt_data(iv, key, + reinterpret_cast(buf.data()), + buf.size(), res); } } // namespace repertory::utils::encryption diff --git a/repertory/repertory_test/src/encrypting_reader_test.cpp b/repertory/repertory_test/src/encrypting_reader_test.cpp index 65aa33fd..e5273adb 100644 --- a/repertory/repertory_test/src/encrypting_reader_test.cpp +++ b/repertory/repertory_test/src/encrypting_reader_test.cpp @@ -189,8 +189,9 @@ TEST(encrypting_reader, file_data_as_stream) { for (std::uint8_t j = 0U; j < 2U; j++) { EXPECT_FALSE( io_stream - ->read(&buffer[(buffer.size() / 2U) * j], - static_cast(buffer.size()) / 2U) + ->read( + reinterpret_cast(&buffer[(buffer.size() / 2U) * j]), + static_cast(buffer.size()) / 2U) .fail()); EXPECT_TRUE(io_stream->good()); }