ExQR.GaloisField (ex_qr v0.1.0)

Copy Markdown View Source

GF(256) arithmetic for QR Code Reed-Solomon error correction.

Uses the primitive polynomial x^8 + x^4 + x^3 + x^2 + 1 (0x11D) with generator α = 2. Exp and log tables are precomputed at compile time.

Summary

Functions

Returns α^n in GF(256).

Generate a Reed-Solomon generator polynomial of given degree.

Returns log_α(n) in GF(256). n must be > 0.

Multiply two values in GF(256).

Multiply two polynomials over GF(256).

Functions

exp(n)

Returns α^n in GF(256).

generator_polynomial(degree)

Generate a Reed-Solomon generator polynomial of given degree.

log(n)

Returns log_α(n) in GF(256). n must be > 0.

multiply(a, b)

Multiply two values in GF(256).

multiply_polynomials(p1, p2)

Multiply two polynomials over GF(256).