[Libre-soc-bugs] [Bug 782] add galois field bitmanip instructions

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Mar 7 19:37:24 GMT 2022


https://bugs.libre-soc.org/show_bug.cgi?id=782

--- Comment #31 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Jacob Lifshay from comment #30)
> since GF(2^n) is a field, invert should be `gfdiv(1, v)` (since 1 is the
> multiplicative identity) for all GF(2^n) values `v`.
> 
> the gcd algorithm is used for gf(p) for prime p, but there the mul, div, etc
> are all integer div, mul, etc, not GF(n) operations. afaict you confused it
> again.

ahh, gf(2^n) gfdiv can be implemented a gfmul combined with the gcd algorithm
where the div and mul and add ops in the gcd algorithm are *not* GF(2^n) ops,
they are instead operating on polynomials of GF(2).

you can also use gfmul to compute gfdiv(a, b) in gf(2^n) is gfmul(a, gfpow(b,
2^n - 1)), where gfpow can be implemented using the standard squaring
algorithm, giving runtime O(n * gfmul_time).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list