Trait LcEncoding

Source
pub trait LcEncoding:
    Clone
    + Debug
    + Sync {
    type F: Field + FieldHash + Debug + Clone;
    type Err: Debug + Error + Send;

    const LABEL_DT: &'static [u8];
    const LABEL_PR: &'static [u8];
    const LABEL_PE: &'static [u8];
    const LABEL_CO: &'static [u8];

    // Required methods
    fn encode<T: AsMut<[Self::F]>>(&self, inp: T) -> Result<(), Self::Err>;
    fn get_dims(&self, len: usize) -> (usize, usize, usize);
    fn dims_ok(&self, n_per_row: usize, n_cols: usize) -> bool;
    fn get_n_col_opens(&self) -> usize;
    fn get_n_degree_tests(&self) -> usize;
}
Expand description

Trait for a linear encoding used by the polycommit

Required Associated Constants§

Source

const LABEL_DT: &'static [u8]

Domain separation label - degree test (see def_labels!())

Source

const LABEL_PR: &'static [u8]

Domain separation label - random lin combs (see def_labels!())

Source

const LABEL_PE: &'static [u8]

Domain separation label - eval comb (see def_labels!())

Source

const LABEL_CO: &'static [u8]

Domain separation label - column openings (see def_labels!())

Required Associated Types§

Source

type F: Field + FieldHash + Debug + Clone

Field over which coefficients are defined

Source

type Err: Debug + Error + Send

Error type for encoding

Required Methods§

Source

fn encode<T: AsMut<[Self::F]>>(&self, inp: T) -> Result<(), Self::Err>

Encoding function

Source

fn get_dims(&self, len: usize) -> (usize, usize, usize)

Get dimensions for this encoding instance on an input vector of length len

Source

fn dims_ok(&self, n_per_row: usize, n_cols: usize) -> bool

Check that supplied dimensions are compatible with this encoding

Source

fn get_n_col_opens(&self) -> usize

Get the number of column openings required for this encoding

Source

fn get_n_degree_tests(&self) -> usize

Get the number of degree tests required for this encoding

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§