Skip to content

Instantly share code, notes, and snippets.

@vhxs
Created March 20, 2022 22:11
Show Gist options
  • Select an option

  • Save vhxs/9e6aeacf351ac65c3cbba61333aebdba to your computer and use it in GitHub Desktop.

Select an option

Save vhxs/9e6aeacf351ac65c3cbba61333aebdba to your computer and use it in GitHub Desktop.
Find an RLWE ring that's not a field
for i, p in enumerate(Primes()):
for n in range(1, i+1):
S = PolynomialRing(GF(p), 'x')
f = cyclotomic_polynomial(n)
R = QuotientRing(S, f)
if not R.is_field():
print(f"GF({p}) / ({f}) is not a field!!")
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment