1
0
Fork 0
forked from lthn/blockchain

boost serialization for crypto::scalar_vec_t and scalar_mat_t

This commit is contained in:
sowle 2024-10-20 01:57:30 +02:00
parent 9dc293ec04
commit 60423e71b8
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -313,15 +313,17 @@ namespace boost
{
a & reinterpret_cast<char (&)[sizeof(crypto::eth_signature)]>(x);
}
//TODO: @sowle please add serialization here
#ifndef _DEBUG
static_assert(false, "todo")
#endif
template <class Archive>
inline void serialize(Archive& a, crypto::scalar_vec_t& x, const boost::serialization::version_type ver)
{
static_assert(sizeof(std::vector<crypto::scalar_t>) == sizeof(crypto::scalar_vec_t));
a & static_cast<std::vector<crypto::scalar_t>&>(x);
}
template <class Archive, size_t N>
inline void serialize(Archive& a, crypto::scalar_mat_t<N>& x, const boost::serialization::version_type ver)
{
static_assert(sizeof(std::vector<crypto::scalar_t>) == sizeof(crypto::scalar_mat_t<N>));
a & static_cast<std::vector<crypto::scalar_t>&>(x);
}
} // namespace serialization