From 60423e71b8bc232538b5b28ad8cddfb26b03e8ec Mon Sep 17 00:00:00 2001 From: sowle Date: Sun, 20 Oct 2024 01:57:30 +0200 Subject: [PATCH] boost serialization for crypto::scalar_vec_t and scalar_mat_t --- src/common/crypto_serialization.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/crypto_serialization.h b/src/common/crypto_serialization.h index 99b49354..21845ae9 100644 --- a/src/common/crypto_serialization.h +++ b/src/common/crypto_serialization.h @@ -313,15 +313,17 @@ namespace boost { a & reinterpret_cast(x); } - - //TODO: @sowle please add serialization here -#ifndef _DEBUG - static_assert(false, "todo") -#endif template inline void serialize(Archive& a, crypto::scalar_vec_t& x, const boost::serialization::version_type ver) { - + static_assert(sizeof(std::vector) == sizeof(crypto::scalar_vec_t)); + a & static_cast&>(x); + } + template + inline void serialize(Archive& a, crypto::scalar_mat_t& x, const boost::serialization::version_type ver) + { + static_assert(sizeof(std::vector) == sizeof(crypto::scalar_mat_t)); + a & static_cast&>(x); } } // namespace serialization