Skip to content

Instantly share code, notes, and snippets.

@onurinanc
Created September 12, 2024 09:45
Show Gist options
  • Save onurinanc/ccb37ae5dde012dc8bb67617a0f89376 to your computer and use it in GitHub Desktop.
Save onurinanc/ccb37ae5dde012dc8bb67617a0f89376 to your computer and use it in GitHub Desktop.
BabyBear = 2^27 * 15 + 1
M31 = 2^31 - 1
BN254 = 21888242871839275222246405745257275088548364400416034343698204186575808495617
GL = 0xffffffff00000001
fields = [BabyBear, M31, BN254, GL]
def check_irreducibility(field):
F = GF(field)
R.<x> = PolynomialRing(F)
f = x^2 - 11
return f"Field: {field}\nIs irreducible: {f.is_irreducible()}"
print("\n".join(map(check_irreducibility, fields)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment