File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ def test_ec_add_symbolic_cost():
418418 # toffoli cost for Kaliski Mod Inverse, n extra toffolis in ModNeg, 2n extra toffolis to do n
419419 # 3-controlled toffolis in step 2. The expression is written with rationals because sympy
420420 # comparison fails with floats.
421- assert total_toff == sympy .Rational (253 , 2 ) * n ** 2 + sympy .Rational (391 , 2 ) * n - 31
421+ assert total_toff == sympy .Rational (253 , 2 ) * n ** 2 + sympy .Rational (407 , 2 ) * n - 31
422422
423423
424424def test_ec_add (bloq_autotester ):
Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ def test_kaliski_symbolic_cost():
8686 # construction this is just $n-1$ (BitwiseNot -> Add(p+1)).
8787 # - The cost of an iteration in Litinski $13n$ since they ignore constants.
8888 # Our construction is exactly the same but we also count the constants
89- # which amout to $3$. for a total cost of $13n + 3 $.
89+ # which amout to $3$. for a total cost of $13n + 4 $.
9090 # For example the cost of ModDbl is 2n+1. In their figure 8, they report
9191 # it as just $2n$. ModDbl gets executed within the 2n loop so its contribution
9292 # to the overal cost should be 4n^2 + 2n instead of just 4n^2.
93- assert total_toff == 26 * n ** 2 + 7 * n - 1
93+ assert total_toff == 26 * n ** 2 + 9 * n - 1
9494
9595
9696def test_kaliskimodinverse_example (bloq_autotester ):
You can’t perform that action at this time.
0 commit comments