Skip to main content

Module packed_extension

Module packed_extension 

Source
Expand description

Reading a packed extension field element as a packing of its subfield.

A packed extension field element and its subfield packing are the same bytes. They differ only in how wide a scalar those bytes are cut into. So every cast here is a reinterpretation rather than a conversion, and compiles to nothing.

The subfield scalars come out in ExtensionField basis order:

cast_bases_mut(exts)  ==  exts.iter().flat_map(|ext| ext.iter_bases())

The bare names do not say what is being cast, so call sites read best qualified by the module:

packed_extension::cast_base::<B1, _>(elem)

Functions§

cast_base
Reads a packed extension field element as a packed subfield element.
cast_base_mut
Reads a packed extension field element in place as a packed subfield element.
cast_bases_mut
Reads a slice of packed extension field elements in place as packed subfield elements.
cast_ext
Reads a packed subfield element as a packed extension field element.

Type Aliases§

PackedSubfield
The packing of FSub covering the same bits as the packed extension field type P.