forked from lthn/blockchain
boost serialization for crypto::scalar_vec_t and scalar_mat_t
This commit is contained in:
parent
9dc293ec04
commit
60423e71b8
1 changed files with 8 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue