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§
sourcefn encode_extension_inplace<PE>(
&self,
code: &mut [PE]
) -> Result<(), Self::EncodeError>
fn encode_extension_inplace<PE>( &self, code: &mut [PE] ) -> Result<(), Self::EncodeError>
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§
sourcefn encode_extension<PE>(
&self,
msg: Vec<PE>
) -> Result<Vec<PE>, Self::EncodeError>
fn encode_extension<PE>( &self, msg: Vec<PE> ) -> Result<Vec<PE>, Self::EncodeError>
Encode a message of extension field elements provided as a vector of packed field elements.
Object Safety§
This trait is not object safe.