Skip to content

Commit ebb1bee

Browse files
sage: Ensure that constraints are always fastfracs
Even if they are constants created in the formula functions. We now lift integer constants to fastfracs.
1 parent d8d5485 commit ebb1bee

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

sage/group_prover.sage

+3
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ class constraints:
164164
def negate(self):
165165
return constraints(zero=self.nonzero, nonzero=self.zero)
166166

167+
def map(self, fun):
168+
return constraints(zero={fun(k): v for k, v in self.zero.items()}, nonzero={fun(k): v for k, v in self.nonzero.items()})
169+
167170
def __add__(self, other):
168171
zero = self.zero.copy()
169172
zero.update(other.zero)

sage/weierstrass_prover.sage

+2
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ def check_symbolic_jacobian_weierstrass(name, A, B, branches, formula):
251251
ret = True
252252
for branch in range(branches):
253253
assumeFormula, assumeBranch, pC = formula(branch, pA, pB)
254+
assumeBranch = assumeBranch.map(lift)
255+
assumeFormula = assumeFormula.map(lift)
254256
pC.X = lift(pC.X)
255257
pC.Y = lift(pC.Y)
256258
pC.Z = lift(pC.Z)

0 commit comments

Comments
 (0)