Trait binius_core::linear_code::LinearCode
source · pub trait LinearCode {
type P: PackedField;
type EncodeError: Error + Send + Sync + 'static;
// Required methods
fn dim_bits(&self) -> usize;
fn min_dist(&self) -> usize;
fn inv_rate(&self) -> usize;
fn encode_batch_inplace(
&self,
code: &mut [Self::P],
log_batch_size: usize
) -> Result<(), Self::EncodeError>;
// Provided methods
fn len(&self) -> usize { ... }
fn dim(&self) -> usize { ... }
fn encode_inplace(
&self,
code: &mut [Self::P]
) -> Result<(), Self::EncodeError> { ... }
fn encode(
&self,
msg: Vec<Self::P>
) -> Result<Vec<Self::P>, Self::EncodeError> { ... }
}
Expand description
An encodable linear error-correcting code intended for use in a Brakedown-style polynomial commitment scheme.
This trait represents linear codes with a dimension that is a power of 2, as that property is required for the Brakedown polynomial commitment scheme.
Requirements:
len()
is a multiple ofdim()
dim()
is a power of 2dim()
is a multiple ofP::WIDTH
Required Associated Types§
type P: PackedField
type EncodeError: Error + Send + Sync + 'static
Required Methods§
sourcefn encode_batch_inplace(
&self,
code: &mut [Self::P],
log_batch_size: usize
) -> Result<(), Self::EncodeError>
fn encode_batch_inplace( &self, code: &mut [Self::P], log_batch_size: usize ) -> Result<(), Self::EncodeError>
Encode a message in-place in a provided buffer.
Returns an error if the code
buffer does not have capacity for len()
field elements.
Provided Methods§
sourcefn encode_inplace(&self, code: &mut [Self::P]) -> Result<(), Self::EncodeError>
fn encode_inplace(&self, code: &mut [Self::P]) -> Result<(), Self::EncodeError>
Encode a message in-place in a provided buffer.
Returns an error if the code
buffer does not have capacity for len()
field elements.