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():
418
418
# toffoli cost for Kaliski Mod Inverse, n extra toffolis in ModNeg, 2n extra toffolis to do n
419
419
# 3-controlled toffolis in step 2. The expression is written with rationals because sympy
420
420
# 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
422
422
423
423
424
424
def test_ec_add (bloq_autotester ):
Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ def test_kaliski_symbolic_cost():
86
86
# construction this is just $n-1$ (BitwiseNot -> Add(p+1)).
87
87
# - The cost of an iteration in Litinski $13n$ since they ignore constants.
88
88
# 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 $.
90
90
# For example the cost of ModDbl is 2n+1. In their figure 8, they report
91
91
# it as just $2n$. ModDbl gets executed within the 2n loop so its contribution
92
92
# 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
94
94
95
95
96
96
def test_kaliskimodinverse_example (bloq_autotester ):
You can’t perform that action at this time.
0 commit comments