pub trait NargSerialize {
// Required method
fn serialize_into_narg(&self, dst: &mut Vec<u8>);
// Provided method
fn serialize_into_new_narg(&self) -> impl AsRef<[u8]> { ... }
}Expand description
Trait for serialization of an object as a NARG string.
§Semantics
When using a byte-oriented hash function, the serialized object is the same as what’s absorbed by the DuplexSpongeInterface.
When serializing integers modulo N, serialization is expected to follow the I2OSP conversion procedure from RFC8017, including for prime-order finite fields. Serialization of elements in a field extensions must serialize each base field element.
Required Methods§
Sourcefn serialize_into_narg(&self, dst: &mut Vec<u8>)
fn serialize_into_narg(&self, dst: &mut Vec<u8>)
Serializes self into dst by extending the vector.
§Safety
This procedure must compute an injective map.
Provided Methods§
Sourcefn serialize_into_new_narg(&self) -> impl AsRef<[u8]>
fn serialize_into_new_narg(&self) -> impl AsRef<[u8]>
Shorthand for NargSerialize::serialize_into_narg for an empty byte array.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".