Skip to main content

GaloisField

Trait GaloisField 

Source
pub trait GaloisField {
    // Required methods
    fn size() -> usize;
    fn valid_codeword(bits: u8) -> bool;
    fn codeword(pow: usize) -> u8;
    fn power(codeword: usize) -> usize;

    // Provided method
    fn codeword_modded(pow: usize) -> u8 { ... }
}
Expand description

A GF(2r) Galois field.

Required Methods§

Source

fn size() -> usize

Number of unique codewords in the field: 2r - 1.

Source

fn valid_codeword(bits: u8) -> bool

Check if the given bit pattern is a valid codeword in the field.

Source

fn codeword(pow: usize) -> u8

Map the given power i to codeword αi.

Source

fn power(codeword: usize) -> usize

Map the given codeword ai to its power i.

Provided Methods§

Source

fn codeword_modded(pow: usize) -> u8

Map the given power i to codeword αm ≡ αi (modulo the size of the field.)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§