|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| uint8_t | gf256_mul (uint8_t a, uint8_t b) |
| Multiply two elements in GF(2^8) with polynomial 0x11D. | |
| uint8_t | gf256_div (uint8_t a, uint8_t b) |
| Divide two elements in GF(2^8). | |
| uint8_t | gf256_inv (uint8_t a) |
| Compute multiplicative inverse in GF(2^8). | |
| void | gf256_mul_region (uint8_t *dst, const uint8_t *src, uint8_t coeff, size_t len) |
| Multiply-accumulate a region: dst[i] ^= GF_mul(src[i], coeff) for all i. | |
| void | gf256_xor_region (uint8_t *dst, const uint8_t *src, size_t len) |
| XOR a region: dst[i] ^= src[i] for all i. | |
| uint8_t gf256_div | ( | uint8_t | a, |
| uint8_t | b ) |
Divide two elements in GF(2^8).
| a | Dividend. |
| b | Divisor (must be non-zero). |
Definition at line 84 of file gf256.c.
References gf256_div(), gf256_exp_table, gf256_init_tables(), and gf256_log_table.
Referenced by gf256_div().
| uint8_t gf256_inv | ( | uint8_t | a | ) |
Compute multiplicative inverse in GF(2^8).
| a | Element (must be non-zero). |
Definition at line 92 of file gf256.c.
References gf256_exp_table, gf256_init_tables(), gf256_inv(), and gf256_log_table.
Referenced by gf256_inv(), and invert_matrix().
| uint8_t gf256_mul | ( | uint8_t | a, |
| uint8_t | b ) |
Multiply two elements in GF(2^8) with polynomial 0x11D.
| a | First operand. |
| b | Second operand. |
Definition at line 77 of file gf256.c.
References gf256_exp_table, gf256_init_tables(), gf256_log_table, and gf256_mul().
Referenced by build_vandermonde(), gf256_build_mul_tables(), gf256_mul(), invert_matrix(), rs_create(), and rs_decode().
| void gf256_mul_region | ( | uint8_t * | dst, |
| const uint8_t * | src, | ||
| uint8_t | coeff, | ||
| size_t | len ) |
Multiply-accumulate a region: dst[i] ^= GF_mul(src[i], coeff) for all i.
Uses SIMD acceleration when available (AVX2 > SSSE3 > NEON > scalar). If coeff is 0, this is a no-op. If coeff is 1, this is XOR.
| dst | Destination buffer (read-modify-write). |
| src | Source buffer (read-only). |
| coeff | GF(2^8) coefficient. |
| len | Number of bytes to process. |
Definition at line 350 of file gf256.c.
References gf256_init_tables(), gf256_mul_region(), gf256_mul_region_scalar(), and gf256_xor_region().
Referenced by gf256_mul_region(), rs_decode(), and rs_encode_incremental().
| void gf256_xor_region | ( | uint8_t * | dst, |
| const uint8_t * | src, | ||
| size_t | len ) |
XOR a region: dst[i] ^= src[i] for all i.
Uses SIMD acceleration when available.
| dst | Destination buffer (read-modify-write). |
| src | Source buffer (read-only). |
| len | Number of bytes to process. |
Definition at line 370 of file gf256.c.
References gf256_xor_region(), and gf256_xor_region_scalar().
Referenced by gf256_mul_region(), and gf256_xor_region().