pub trait LinearCodeWithExtensionEncoding: LinearCode {
    // Required method
    fn encode_extension_inplace<PE>(
        &self,
        code: &mut [PE]
    ) -> Result<(), Self::EncodeError>
       where PE: RepackedExtension<Self::P>,
             PE::Scalar: ExtensionField<<Self::P as PackedField>::Scalar>;

    // Provided method
    fn encode_extension<PE>(
        &self,
        msg: Vec<PE>
    ) -> Result<Vec<PE>, Self::EncodeError>
       where PE: RepackedExtension<Self::P>,
             PE::Scalar: ExtensionField<<Self::P as PackedField>::Scalar> { ... }
}
Expand description

A linear code the with additional ability to encode packed extension field elements.

A linear code can be naturally extended to a code over extension fields by encoding each dimension of the extension as a vector-space separately. However, a naive encoding procedure would not be able to access elements in the most memory-efficient manner, hence the separate trait.

Required Methods§

source

fn encode_extension_inplace<PE>( &self, code: &mut [PE] ) -> Result<(), Self::EncodeError>
where PE: RepackedExtension<Self::P>, PE::Scalar: ExtensionField<<Self::P as PackedField>::Scalar>,

Encode a message of extension field elements in-place in a provided buffer.

Returns an error if the code buffer does not have capacity for len() field elements.

Provided Methods§

source

fn encode_extension<PE>( &self, msg: Vec<PE> ) -> Result<Vec<PE>, Self::EncodeError>
where PE: RepackedExtension<Self::P>, PE::Scalar: ExtensionField<<Self::P as PackedField>::Scalar>,

Encode a message of extension field elements provided as a vector of packed field elements.

Object Safety§

This trait is not object safe.

Implementors§