Is there a good finite field library?

183 views
Skip to first unread message

awaw...@gmail.com

unread,
Aug 11, 2026, 9:14:17 AM (5 days ago) Aug 11
to golang-nuts
I would like to compute the square root of elements from a general finite field GF(p^k), where p is a prime number, and k an integer k>=1.

From what I can find, https://pkg.go.dev/github.com/ReneBoedker/alg...@v0.2.1/finitefield/ff#Field seems to be the only one that supports finite fields of arbitrary order p^k.
However, it lacks the square root operation that is for example provided in the Python libnum library.
The library I am looking for need not be super fast, but I'd like to have it in pure Go.

I wonder does anyone have any recommendations? Thanks.

Keith Randall

unread,
Aug 11, 2026, 5:49:06 PM (5 days ago) Aug 11
to golang-nuts

Jason E. Aten

unread,
Aug 11, 2026, 6:25:29 PM (5 days ago) Aug 11
to golang-nuts
I made you one:


while doing so, I found a bug in ReneBoedker/algobra (filed, see issue 2), so ffsqrt is based on my fork with a fix for now.

awaw...@gmail.com

unread,
Aug 13, 2026, 4:25:05 AM (4 days ago) Aug 13
to golang-nuts
Thanks Keith and Jason for these impressive implementations.
I am truly impressed by the quality therein, and am happy to leverage them to continue my work.

I always have a strong belief that our Gopher community is not only supremely excellent in systems and networking software, but actually also in basic scientific research, although this fact is sadly less known.
These finite field libraries have made my above strong belief much stronger.
Reply all
Reply to author
Forward
0 new messages