diff --git a/include/omath/containers/encrypted_variable.hpp b/include/omath/containers/encrypted_variable.hpp index dbd7fcf..5956a53 100644 --- a/include/omath/containers/encrypted_variable.hpp +++ b/include/omath/containers/encrypted_variable.hpp @@ -123,6 +123,8 @@ namespace omath } OMATH_FORCEINLINE constexpr void decrypt() { + if (m_is_encrypted) + return; std::span bytes{reinterpret_cast(&m_data), sizeof(m_data)}; for (size_t i = 0; i < bytes.size(); ++i) @@ -131,6 +133,8 @@ namespace omath } OMATH_FORCEINLINE constexpr void encrypt() { + if (!m_is_encrypted) + return; std::span bytes{reinterpret_cast(&m_data), sizeof(m_data)}; for (size_t i = 0; i < bytes.size(); ++i)