5 #ifndef __ZETH_SERIALIZATION_STREAM_UTILS_HPP__
6 #define __ZETH_SERIALIZATION_STREAM_UTILS_HPP__
11 #include <type_traits>
18 template<
typename CollectionT>
20 typename std::decay<decltype((*(CollectionT *)
nullptr)[0])>
::type;
29 typename std::enable_if<std::is_fundamental<T>::value,
void>
::type read_bytes(
30 T &val, std::istream &in_s);
35 const T &val, std::ostream &out_s);
43 const CollectionT &collection,
const size_t n, std::ostream &out_s);
51 CollectionT &collection,
const size_t n, std::istream &in_s);
67 template<
typename T,
void(ReaderFn)(T &, std::istream &)>
69 libsnark::sparse_vector<T> &sparse_vector, std::istream &in_s);
71 template<
typename T,
void(WriterFn)(const T &, std::ostream &)>
73 const libsnark::sparse_vector<T> &sparse_vector, std::ostream &out_s);
75 template<
typename T,
void(ReaderFn)(T &, std::istream &)>
77 libsnark::accumulation_vector<T> &acc_vector, std::istream &in_s);
79 template<
typename T,
void(WriterFn)(const T &, std::ostream &)>
81 const libsnark::accumulation_vector<T> &acc_vector, std::ostream &out_s);
83 template<
typename kcT>
85 kcT &knowledge_commitment, std::istream &in_s);
87 template<
typename kcT>
89 const kcT &knowledge_commitment, std::ostream &out_s);
91 template<
typename kcvectorT>
93 kcvectorT &knowledge_commitment, std::istream &in_s);
95 template<
typename kcvectorT>
97 const kcvectorT &knowledge_commitment, std::ostream &out_s);
103 #endif // __ZETH_SERIALIZATION_STREAM_UTILS_HPP__