This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to work with latest
ark-ff
(#95)
Co-authored-by: Sun <[email protected]>
- Loading branch information
1 parent
d0dc200
commit 1551d6d
Showing
231 changed files
with
2,826 additions
and
4,339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
modulus = 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177 | ||
|
||
assert(modulus.is_prime()) | ||
|
||
Fp = GF(modulus) | ||
|
||
generator = Fp(0); | ||
for i in range(0, 20): | ||
i = Fp(i); | ||
neg_i = Fp(-i) | ||
if not(i.is_primitive_root() or neg_i.is_primitive_root()): | ||
continue | ||
elif i.is_primitive_root(): | ||
assert(i.is_primitive_root()); | ||
print("Generator: %d" % i) | ||
generator = i | ||
break | ||
else: | ||
assert(neg_i.is_primitive_root()); | ||
print("Generator: %d" % neg_i) | ||
generator = neg_i | ||
break | ||
|
||
|
||
two_adicity = valuation(modulus - 1, 2); | ||
trace = (modulus - 1) / 2**two_adicity; | ||
two_adic_root_of_unity = generator^trace | ||
print("2-adic Root of Unity: %d " % two_adic_root_of_unity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
modulus = 8444461749428370424248824938781546531375899335154063827935233455917409239041 | ||
|
||
assert(modulus.is_prime()) | ||
|
||
Fp = GF(modulus) | ||
|
||
generator = Fp(0); | ||
for i in range(0, 30): | ||
i = Fp(i); | ||
neg_i = Fp(-i) | ||
if not(i.is_primitive_root() or neg_i.is_primitive_root()): | ||
continue | ||
elif i.is_primitive_root(): | ||
assert(i.is_primitive_root()); | ||
print("Generator: %d" % i) | ||
generator = i | ||
break | ||
else: | ||
assert(neg_i.is_primitive_root()); | ||
print("Generator: %d" % neg_i) | ||
generator = neg_i | ||
break | ||
|
||
|
||
two_adicity = valuation(modulus - 1, 2); | ||
trace = (modulus - 1) / 2**two_adicity; | ||
two_adic_root_of_unity = generator^trace | ||
print("2-adic Root of Unity: %d " % two_adic_root_of_unity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.