pub trait Engine: Clonewhere
Self: Sized,{
// Required methods
fn fft(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
skew_delta: usize,
);
fn fwht(data: &mut [GfElement; 65536], truncated_size: usize);
fn ifft(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
skew_delta: usize,
);
fn mul(&self, x: &mut [u8], log_m: GfElement);
fn xor(x: &mut [u8], y: &[u8]);
// Provided methods
fn eval_poly(erasures: &mut [GfElement; 65536], truncated_size: usize) { ... }
fn fft_skew_end(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
) { ... }
fn formal_derivative(data: &mut ShardsRefMut<'_>) { ... }
fn ifft_skew_end(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
) { ... }
fn xor_within(data: &mut ShardsRefMut<'_>, x: usize, y: usize, count: usize) { ... }
}
Expand description
Required Methods§
Sourcefn fft(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
skew_delta: usize,
)
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 be2^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 only0u8
:s and garbage otherwise.
Sourcefn fwht(data: &mut [GfElement; 65536], truncated_size: usize)
fn fwht(data: &mut [GfElement; 65536], truncated_size: usize)
In-place FWHT (fast Walsh-Hadamard transform).
- This is used only in
Engine::eval_poly
, both directly and indirectly viainitialize_log_walsh
. truncated_size
must be handled so thatEngine::eval_poly
returns correct result.
Sourcefn ifft(
&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, )
In-place decimation-in-time IFFT (inverse fast Fourier transform).
- IFFT is done on chunk
data[pos .. pos + size]
size
must be2^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 only0u8
:s and garbage otherwise.
Provided Methods§
Sourcefn fft_skew_end(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
)
fn fft_skew_end( &self, data: &mut ShardsRefMut<'_>, pos: usize, size: usize, truncated_size: usize, )
FFT with skew_delta = pos + size
.
Sourcefn formal_derivative(data: &mut ShardsRefMut<'_>)
fn formal_derivative(data: &mut ShardsRefMut<'_>)
Formal derivative.
Sourcefn ifft_skew_end(
&self,
data: &mut ShardsRefMut<'_>,
pos: usize,
size: usize,
truncated_size: usize,
)
fn ifft_skew_end( &self, data: &mut ShardsRefMut<'_>, pos: usize, size: usize, truncated_size: usize, )
IFFT with skew_delta = pos + size
.
Sourcefn xor_within(data: &mut ShardsRefMut<'_>, x: usize, y: usize, count: usize)
fn xor_within(data: &mut ShardsRefMut<'_>, x: usize, y: usize, count: usize)
data[x .. x + count] ^= data[y .. y + count]
Ranges must not overlap.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.