reed_solomon_simd::engine

Trait Engine

Source
pub trait Engine {
    // Required methods
    fn fft(
        &self,
        data: &mut ShardsRefMut<'_>,
        pos: usize,
        size: usize,
        truncated_size: usize,
        skew_delta: usize,
    );
    fn ifft(
        &self,
        data: &mut ShardsRefMut<'_>,
        pos: usize,
        size: usize,
        truncated_size: usize,
        skew_delta: usize,
    );
    fn mul(&self, x: &mut [[u8; 64]], log_m: GfElement);

    // Provided method
    fn eval_poly(erasures: &mut [GfElement; 65536], truncated_size: usize)
       where Self: Sized { ... }
}
Expand description

Trait for compute-intensive low-level algorithms needed for Reed-Solomon encoding/decoding.

This is the trait you would implement to provide SIMD support for a CPU architecture not already provided.

Naive engine is provided for those who want to study the source code to understand Engine.

Required Methods§

Source

fn fft( &self, data: &mut ShardsRefMut<'_>, pos: usize, size: usize, truncated_size: usize, skew_delta: usize, )

In-place decimation-in-time FFT (fast Fourier transform).

  • FFT is done on chunk data[pos .. pos + size]
  • size must be 2^n
  • Before function call data[pos .. pos + size] must be valid.
  • After function call
    • data[pos .. pos + truncated_size] contains valid FFT result.
    • data[pos + truncated_size .. pos + size] contains valid FFT result if this contained only 0u8:s and garbage otherwise.
Source

fn ifft( &self, data: &mut ShardsRefMut<'_>, pos: usize, size: usize, truncated_size: usize, skew_delta: usize, )

In-place decimation-in-time IFFT (inverse fast Fourier transform).

  • IFFT is done on chunk data[pos .. pos + size]
  • size must be 2^n
  • Before function call data[pos .. pos + size] must be valid.
  • After function call
    • data[pos .. pos + truncated_size] contains valid IFFT result.
    • data[pos + truncated_size .. pos + size] contains valid IFFT result if this contained only 0u8:s and garbage otherwise.
Source

fn mul(&self, x: &mut [[u8; 64]], log_m: GfElement)

x[] *= log_m

Provided Methods§

Source

fn eval_poly(erasures: &mut [GfElement; 65536], truncated_size: usize)
where Self: Sized,

Evaluate polynomial.

Implementors§