1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Compile-time executable function, helps you in generating lookup tables, so that you can perform NEON, AVX2 and SSSE3
//! optimized SIMD vector x single-scalar multiplication over GF(2^8), during RLNC erasure-coding. These table generation
//! logic is from <https://github.com/ceph/gf-complete/blob/a6862d10c9db467148f20eef2c6445ac9afd94d8/src/gf_w8.c#L1100-L1105>.
//!
//! If you invoke `generate_gf256_simd_mul_low_table()`, it should generate `htd->low` part, described in above link.
//! Plain Rust code which should regenerate same table is as follows.
//!
//! ```rust,ignore
//! const GF256_ORDER: usize = 256;
//! const GF256_BIT_WIDTH: usize = u8::BITS as usize;
//! const GF256_HALF_ORDER: usize = 1usize << (GF256_BIT_WIDTH / 2);
//!
//! let _ = (0..=((GF256_ORDER - 1) as u8))
//! .map(|a| {
//! (0..(GF256_HALF_ORDER as u8))
//! .map(move |b| Gf256::mul_const(a, b))
//! .collect::<Vec<u8>>()
//! })
//! .collect::<Vec<Vec<u8>>>();
//! ```
//!
//! If you invoke `generate_gf256_simd_mul_high_table()`, it should generate `htd->high` part, described in above link.
//! Plain Rust code which should regenerate same table is as follows.
//!
//! ```rust,ignore
//! let _ = (0..=((GF256_ORDER - 1) as u8))
//! .map(|a| {
//! (0..(GF256_HALF_ORDER as u8))
//! .map(move |b| Gf256::mul_const(a, b << 4))
//! .collect::<Vec<u8>>()
//! })
//! .collect::<Vec<Vec<u8>>>();
//! ```
use ;
const
const
/// AVX2, SSSE3 and NEON optimized SIMD multiplication over GF(2^8) uses this lookup table, which is generated following
/// <https://github.com/ceph/gf-complete/blob/a6862d10c9db467148f20eef2c6445ac9afd94d8/src/gf_w8.c#L1100-L1105>.
/// This table holds `htd->low` part, described in above link.
pub const GF256_SIMD_MUL_TABLE_LOW: = generate_gf256_simd_mul_low_table;
/// AVX2, SSSE3 and NEON optimized SIMD multiplication over GF(2^8) uses this lookup table, which is generated following
/// <https://github.com/ceph/gf-complete/blob/a6862d10c9db467148f20eef2c6445ac9afd94d8/src/gf_w8.c#L1100-L1105>.
/// This table holds `htd->high` part, described in above link.
pub const GF256_SIMD_MUL_TABLE_HIGH: = generate_gf256_simd_mul_high_table;