diff --git a/arithmetics/README.md b/arithmetics/README.md index c613ffc..f0133ce 100644 --- a/arithmetics/README.md +++ b/arithmetics/README.md @@ -80,7 +80,7 @@ TODO There are many many implementations out there, but here is one for Circom: -```cs +```cpp template Num2Bits(n) { assert(n < 254); // due to BN128 signal input in; diff --git a/elliptic-curves/README.md b/elliptic-curves/README.md index f91dfd1..094c20b 100644 --- a/elliptic-curves/README.md +++ b/elliptic-curves/README.md @@ -392,6 +392,12 @@ TODO TODO +## Exercise 82 + +> Consider the small prime factor 2 of the TinyJubJub curve. Compute the full 2-torsion group of $TJJ_{13}$ and then compute the groups $\mathbb{G}_1[2]$ and $\mathbb{G}_2[2]$ + +TODO + ## Exercise 83 > Consider `alt_bn128` curve and and it's curve extension. Write a Sage program that computes a generator for each of the torsion group $\mathbb{G}_1[p]$ and $\mathbb{G}_2[p]$. diff --git a/elliptic-curves/full-torsion-groups.sage b/elliptic-curves/full-torsion-groups.sage index 5510251..5562868 100644 --- a/elliptic-curves/full-torsion-groups.sage +++ b/elliptic-curves/full-torsion-groups.sage @@ -34,7 +34,7 @@ def example_91(): # generate extension FPt. = FP[] # type: ignore - P_MOD_M = FPt(t^k + 2) + P_MOD_M = FPt(t^k + 2) # type: ignore assert(P_MOD_M.is_irreducible()) FP_M = GF(p^k, name='t', modulus=P_MOD_M) diff --git a/statements/qap.sage b/statements/qap.sage index 80b2c1c..24b6266 100644 --- a/statements/qap.sage +++ b/statements/qap.sage @@ -23,7 +23,7 @@ def qap(r1cs, p: int): # pick k random elements, unique & invertible elems = [] - for _ in range(k): + while len(elems) < k: rand_elem = Fp.random_element() if rand_elem not in elems: elems.append(rand_elem)