Module o1_utils::serialization
source · Expand description
This adds a few utility functions for serializing and deserializing arkworks types that implement [CanonicalSerialize] and [CanonicalDeserialize].
Modules
- You can use this module for serialization and deserializing arkworks types with serde. Simply use the following attribute on your field:
#[serde(with = "o1_utils::serialization::ser") attribute"]
Structs
- You can use SerdeAs with serde_with in order to serialize and deserialize types that implement [CanonicalSerialize] and [CanonicalDeserialize], or containers of types that implement these traits (Vec, arrays, etc.) Simply add annotations like
#[serde_as(as = "o1_utils::serialization::SerdeAs")]
See https://docs.rs/serde_with/1.10.0/serde_with/guide/serde_as/index.html#switching-from-serdes-with-to-serde_as - Same as
SerdeAs
but using unchecked and uncompressed (de)serialization.
Functions
- A generic regression serialization test for serialization via
CanonicalSerialize
andCanonicalDeserialize
. - A generic regression serialization test for serialization via
serde
.