From 3f940c8e35b20bec7b779eff081f2e5f6f72e0be Mon Sep 17 00:00:00 2001 From: Orange Date: Sun, 4 Jan 2026 22:46:09 +0300 Subject: [PATCH] removed 128 bit int --- include/omath/containers/encrypted_variable.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/omath/containers/encrypted_variable.hpp b/include/omath/containers/encrypted_variable.hpp index 711a80d..158fb21 100644 --- a/include/omath/containers/encrypted_variable.hpp +++ b/include/omath/containers/encrypted_variable.hpp @@ -59,13 +59,10 @@ namespace omath::detail return splitmix64(base_seed() + 0xD1B54A32D192ED03ull * (Stream + 1)); } - // Unbiased bounded uniform using Lemire's method (uses 128-bit multiply) [[nodiscard]] consteval std::uint64_t bounded_u64(const std::uint64_t x, const std::uint64_t bound) { - // bound must be > 0 - __uint128_t m = static_cast<__uint128_t>(x) * static_cast<__uint128_t>(bound); - return static_cast(m >> 64); + return (x * bound) >> 64; } template @@ -97,7 +94,7 @@ namespace omath::detail } template - [[nodiscard]] + [[nodiscard]] consteval std::array make_array() { return make_array_impl(std::make_index_sequence{}); @@ -122,6 +119,7 @@ namespace omath bytes[i] ^= static_cast(key[i % key.size()] + (i * key_size)); m_is_encrypted = true; } + public: OMATH_FORCEINLINE constexpr explicit EncryptedVariable(const T& data): m_is_encrypted(false), m_data(data) {