Module engine

Source
Expand description

Low-level building blocks for Reed-Solomon encoding/decoding.

This is an advanced module which is not needed for simple usage or basic usage.

This module is relevant if you want to

  • use rate module and need an Engine to use with it.
  • create your own Engine.
  • understand/benchmark/test at low level.

§Engines

An Engine is an implementation of basic low-level algorithms needed for Reed-Solomon encoding/decoding.

  • Naive
    • Simple reference implementation.
  • NoSimd
    • Basic optimized engine without SIMD so that it works on all CPUs.
  • DefaultEngine
    • Default engine which is used when no specific engine is given.
    • Currently just alias to NoSimd.

§Benchmarks

  • These benchmarks are from cargo bench engine with 3.4 GHz i5-3570K (Ivy Bridge, 3rd gen.).
  • Shards are 1024 bytes.
BenchmarkShardsns Naivens NoSimd
xor1 * 26032
mul11 260860
xor_within128 * 25 8705 780
formal_derivative12821 30015 800
FFT128764 000545 000
IFFT128780 000546 000
FWHT-898 000622 000

Modules§

tables
Lookup-tables used by Engine:s.

Structs§

Naive
Simple reference implementation of Engine.
NoSimd
Optimized Engine without SIMD.
ShardsRefMut
Mutable reference to shard array implemented as flat byte array.

Constants§

CANTOR_BASIS
TODO
GF_BITS
Size of Galois field element GfElement in bits.
GF_MODULUS
GF_ORDER - 1
GF_ORDER
Galois field order, i.e. number of elements.
GF_POLYNOMIAL
Galois field polynomial.

Traits§

Engine
Implementation of basic low-level algorithms needed for Reed-Solomon encoding/decoding.

Functions§

add_mod
Some kind of addition.
checked_next_multiple_of
Returns smallest value that is greater than or equal to a and multiple of b, or None if b is zero or operation would overflow.
sub_mod
Some kind of subtraction.

Type Aliases§

DefaultEngine
Default Engine, currently just alias to NoSimd.
GfElement
Galois field element.