Trait prio::codec::ParameterizedDecode

source ·
pub trait ParameterizedDecode<P>: Sized {
    // Required method
    fn decode_with_param(
        decoding_parameter: &P,
        bytes: &mut Cursor<&[u8]>
    ) -> Result<Self, CodecError>;

    // Provided method
    fn get_decoded_with_param(
        decoding_parameter: &P,
        bytes: &[u8]
    ) -> Result<Self, CodecError> { ... }
}
Expand description

Describes how to decode an object from a byte sequence and a decoding parameter that provides additional context.

Required Methods§

source

fn decode_with_param( decoding_parameter: &P, bytes: &mut Cursor<&[u8]> ) -> Result<Self, CodecError>

Read and decode an encoded object from bytes. decoding_parameter provides details of the wire encoding such as lengths of different portions of the message. On success, the decoded value is returned and bytes is advanced by the encoded size of the value. On failure, an error is returned and no further attempt to read from bytes should be made.

Provided Methods§

source

fn get_decoded_with_param( decoding_parameter: &P, bytes: &[u8] ) -> Result<Self, CodecError>

Convenience method to get a decoded value. Returns an error if Self::decode_with_param fails, or if there are any bytes left in bytes after decoding a value.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ParameterizedDecode<Poplar1PrepareState> for Poplar1FieldVec

Available on crate features crypto-dependencies and experimental only.
source§

impl ParameterizedDecode<Poplar1PrepareState> for Poplar1PrepareMessage

Available on crate features crypto-dependencies and experimental only.
source§

impl ParameterizedDecode<Prio2PrepareState> for Prio2PrepareShare

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a> ParameterizedDecode<(&'a Prio2, usize)> for Share<FieldPrio2, 32>

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a> ParameterizedDecode<(&'a Prio2, usize)> for Prio2PrepareState

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a, F> ParameterizedDecode<(&'a Prio2, &'a ())> for AggregateShare<F>
where F: FieldElement,

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a, F> ParameterizedDecode<(&'a Prio2, &'a ())> for OutputShare<F>
where F: FieldElement,

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a, F, T, P, const SEED_SIZE: usize> ParameterizedDecode<(&'a Prio3<T, P, SEED_SIZE>, &'a ())> for AggregateShare<F>
where F: FieldElement, T: Type, P: Xof<SEED_SIZE>,

source§

impl<'a, F, T, P, const SEED_SIZE: usize> ParameterizedDecode<(&'a Prio3<T, P, SEED_SIZE>, &'a ())> for OutputShare<F>
where F: FieldElement, T: Type, P: Xof<SEED_SIZE>,

source§

impl<'a, P, const SEED_SIZE: usize> ParameterizedDecode<(&'a Poplar1<P, SEED_SIZE>, usize)> for Poplar1InputShare<SEED_SIZE>

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a, P, const SEED_SIZE: usize> ParameterizedDecode<(&'a Poplar1<P, SEED_SIZE>, usize)> for Poplar1PrepareState

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a, P: Xof<SEED_SIZE>, const SEED_SIZE: usize> ParameterizedDecode<(&'a Poplar1<P, SEED_SIZE>, &'a Poplar1AggregationParam)> for Poplar1FieldVec

Available on crate features crypto-dependencies and experimental only.
source§

impl<'a, T, P, const SEED_SIZE: usize> ParameterizedDecode<(&'a Prio3<T, P, SEED_SIZE>, usize)> for Prio3InputShare<T::Field, SEED_SIZE>
where T: Type, P: Xof<SEED_SIZE>,

source§

impl<'a, T, P, const SEED_SIZE: usize> ParameterizedDecode<(&'a Prio3<T, P, SEED_SIZE>, usize)> for Prio3PrepareState<T::Field, SEED_SIZE>
where T: Type, P: Xof<SEED_SIZE>,

source§

impl<D: Decode + ?Sized, T> ParameterizedDecode<T> for D

Provide a blanket implementation so that any Decode can be used as a ParameterizedDecode<T> for any T.

source§

impl<F: FftFriendlyFieldElement, const SEED_SIZE: usize> ParameterizedDecode<Prio3PrepareState<F, SEED_SIZE>> for Prio3PrepareMessage<SEED_SIZE>

source§

impl<F: FftFriendlyFieldElement, const SEED_SIZE: usize> ParameterizedDecode<Prio3PrepareState<F, SEED_SIZE>> for Prio3PrepareShare<F, SEED_SIZE>

source§

impl<F: FieldElement> ParameterizedDecode<<VidpfWeight<F> as IdpfValue>::ValueParameter> for VidpfWeight<F>

Available on crate features crypto-dependencies and experimental only.
source§

impl<P, const SEED_SIZE: usize> ParameterizedDecode<Poplar1<P, SEED_SIZE>> for Poplar1PublicShare

Available on crate features crypto-dependencies and experimental only.
source§

impl<T, P, const SEED_SIZE: usize> ParameterizedDecode<Prio3<T, P, SEED_SIZE>> for Prio3PublicShare<SEED_SIZE>
where T: Type, P: Xof<SEED_SIZE>,

source§

impl<VI, VL> ParameterizedDecode<usize> for IdpfPublicShare<VI, VL>
where VI: Decode, VL: Decode,

Available on crate features crypto-dependencies and experimental only.
source§

impl<const VERIFY_KEY_SIZE: usize, const NONCE_SIZE: usize, A, PrepareStateDecode> ParameterizedDecode<PrepareStateDecode> for PingPongTransition<VERIFY_KEY_SIZE, NONCE_SIZE, A>
where A: Aggregator<VERIFY_KEY_SIZE, NONCE_SIZE>, A::PrepareState: ParameterizedDecode<PrepareStateDecode> + PartialEq, A::PrepareMessage: PartialEq,