Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/sage/group_prover.sage
Show All 36 Lines | |||||
# factors is contained in the set of nonzero assumptions' factors. | # factors is contained in the set of nonzero assumptions' factors. | ||||
# This test is not exact, so various combinations of original and | # This test is not exact, so various combinations of original and | ||||
# reduced expressions' factors are tried. | # reduced expressions' factors are tried. | ||||
# - If we succeed, we print out the assumptions from assumeFormula that | # - If we succeed, we print out the assumptions from assumeFormula that | ||||
# weren't implied by assumeLaw already. Those from assumeBranch are skipped, | # weren't implied by assumeLaw already. Those from assumeBranch are skipped, | ||||
# as we assume that all constraints in it are complementary with each other. | # as we assume that all constraints in it are complementary with each other. | ||||
# | # | ||||
# Based on the sage verification scripts used in the Explicit-Formulas Database | # Based on the sage verification scripts used in the Explicit-Formulas Database | ||||
# by Tanja Lange and others, see http://hyperelliptic.org/EFD | # by Tanja Lange and others, see https://hyperelliptic.org/EFD | ||||
class fastfrac: | class fastfrac: | ||||
"""Fractions over rings.""" | """Fractions over rings.""" | ||||
def __init__(self,R,top,bot=1): | def __init__(self,R,top,bot=1): | ||||
"""Construct a fractional, given a ring, a numerator, and denominator.""" | """Construct a fractional, given a ring, a numerator, and denominator.""" | ||||
self.R = R | self.R = R | ||||
if parent(top) == ZZ or parent(top) == R: | if parent(top) == ZZ or parent(top) == R: | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |