Module serialization

Source
Expand description

This adds a few utility functions for serializing and deserializing arkworks types that implement [CanonicalSerialize] and [CanonicalDeserialize].

Modules§

ser
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§

SerdeAs
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
SerdeAsUnchecked
Same as SerdeAs but using unchecked and uncompressed (de)serialization.

Functions§

test_generic_serialization_regression_canonical
A generic regression serialization test for serialization via CanonicalSerialize and CanonicalDeserialize.
test_generic_serialization_regression_serde
A generic regression serialization test for serialization via serde.