Skip to main content

Decoding

Trait Decoding 

Source
pub trait Decoding<T = [u8]>
where T: ?Sized,
{ type Repr: Default + AsMut<T>; // Required method fn decode(buf: Self::Repr) -> Self; }
Expand description

The interface for all types that can be turned into verifier messages.

Required Associated Types§

Source

type Repr: Default + AsMut<T>

The output type (and length) expected by the duplex sponge.

§Example
let repr: ByteArray<4> = Default::default();
assert_eq!(repr.as_ref(), &[0u8; 4]);

Required Methods§

Source

fn decode(buf: Self::Repr) -> Self

The distribution-preserving map, that re-maps a squeezed output Decoding::Repr into a verifier message.

This map is not exactly a decoding function (e.g., it can be onto). What is demanded from this function is that it preserves the uniform distribution: if Decoding::Repr is distributed uniformly at random, the also the output of decode is so.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Decoding for u8

Source§

type Repr = ByteArray<spongefish::::codecs::{impl#13}::Repr::{constant#0}>

Source§

fn decode(buf: <u8 as Decoding>::Repr) -> u8

Source§

impl Decoding for u16

Source§

type Repr = ByteArray<spongefish::::codecs::{impl#15}::Repr::{constant#0}>

Source§

fn decode(buf: <u16 as Decoding>::Repr) -> u16

Source§

impl Decoding for u32

Source§

type Repr = ByteArray<spongefish::::codecs::{impl#17}::Repr::{constant#0}>

Source§

fn decode(buf: <u32 as Decoding>::Repr) -> u32

Source§

impl Decoding for u64

Source§

type Repr = ByteArray<spongefish::::codecs::{impl#19}::Repr::{constant#0}>

Source§

fn decode(buf: <u64 as Decoding>::Repr) -> u64

Source§

impl Decoding for u128

Source§

type Repr = ByteArray<spongefish::::codecs::{impl#21}::Repr::{constant#0}>

Source§

fn decode(buf: <u128 as Decoding>::Repr) -> u128

Source§

impl<C, const N: usize> Decoding for Fp<C, N>
where C: FpConfig<N>,

Source§

type Repr = DecodingFieldBuffer<Fp<C, N>>

Source§

fn decode(repr: <Fp<C, N> as Decoding>::Repr) -> Fp<C, N>

Source§

impl<C> Decoding for CubicExtField<Fp3ConfigWrapper<C>>
where C: Fp3Config,

Source§

impl<C> Decoding for CubicExtField<Fp6ConfigWrapper<C>>
where C: Fp6Config,

Source§

impl<C> Decoding for QuadExtField<Fp2ConfigWrapper<C>>
where C: Fp2Config,

Source§

impl<C> Decoding for QuadExtField<Fp4ConfigWrapper<C>>
where C: Fp4Config,

Source§

impl<C> Decoding for QuadExtField<Fp12ConfigWrapper<C>>
where C: Fp12Config,

Source§

impl<const N: usize> Decoding for [u8; N]

Source§

type Repr = ByteArray<N>

Source§

fn decode(buf: <[u8; N] as Decoding>::Repr) -> [u8; N]

Implementors§