py_ecc.fields package
Submodules
py_ecc.fields.field_elements module
- class py_ecc.fields.field_elements.FQ(val: int | FQ)
Bases:
objectA class for field elements in FQ. Wrap a number in this class, and it becomes a field element.
- classmethod one() T_FQ
- classmethod zero() T_FQ
- class py_ecc.fields.field_elements.FQ12(coeffs: Sequence[int | FQ])
Bases:
FQPThe 12th-degree extension field
- FQ12_MODULUS_COEFFS: FQ12_modulus_coeffs_type
py_ecc.fields.field_properties module
py_ecc.fields.optimized_field_elements module
- class py_ecc.fields.optimized_field_elements.FQ(val: int | FQ)
Bases:
objectA class for field elements in FQ. Wrap a number in this class, and it becomes a field element.
- classmethod one() T_FQ
- property sgn0: int
Calculates the sign of a value. sgn0(x) = 1 when x is ‘negative’; otherwise, sg0(x) = 0
Note this is an optimized variant for m = 1
Defined here: https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09#section-4.1
- classmethod zero() T_FQ
- class py_ecc.fields.optimized_field_elements.FQ12(coeffs: Sequence[int | FQ])
Bases:
FQPThe 12th-degree extension field
- FQ12_MODULUS_COEFFS: FQ12_modulus_coeffs_type
- class py_ecc.fields.optimized_field_elements.FQ2(coeffs: Sequence[int | FQ])
Bases:
FQPThe quadratic extension field
- FQ2_MODULUS_COEFFS: FQ2_modulus_coeffs_type
- property sgn0: int
Calculates the sign of a value. sgn0(x) = 1 when x is ‘negative’; otherwise, sg0(x) = 0
Note this is an optimized variant for m = 2
Defined here: https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09#section-4.1
- class py_ecc.fields.optimized_field_elements.FQP(coeffs: Sequence[int | FQ], modulus_coeffs: Sequence[int | FQ] = ())
Bases:
objectA class for elements in polynomial extension fields
- inv() T_FQP
- classmethod one() T_FQP
- property sgn0: int
Calculates the sign of a value. sgn0(x) = 1 when x is ‘negative’; otherwise, sg0(x) = 0
Defined here: https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09#section-4.1
- classmethod zero() T_FQP
Module contents
- class py_ecc.fields.bls12_381_FQ12(coeffs: Sequence[int | FQ])
Bases:
FQ12,bls12_381_FQP- FQ12_MODULUS_COEFFS: FQ12_modulus_coeffs_type = (2, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0)
- class py_ecc.fields.bls12_381_FQ2(coeffs: Sequence[int | FQ])
Bases:
FQ2,bls12_381_FQP- FQ2_MODULUS_COEFFS: FQ2_modulus_coeffs_type = (1, 0)
- class py_ecc.fields.bls12_381_FQP(coeffs: Sequence[int | FQ], modulus_coeffs: Sequence[int | FQ] = ())
Bases:
FQP
- class py_ecc.fields.bn128_FQ12(coeffs: Sequence[int | FQ])
-
- FQ12_MODULUS_COEFFS: FQ12_modulus_coeffs_type = (82, 0, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0)
- class py_ecc.fields.bn128_FQ2(coeffs: Sequence[int | FQ])
-
- FQ2_MODULUS_COEFFS: FQ2_modulus_coeffs_type = (1, 0)
- class py_ecc.fields.bn128_FQP(coeffs: Sequence[int | FQ], modulus_coeffs: Sequence[int | FQ] = ())
Bases:
FQP
- class py_ecc.fields.optimized_bls12_381_FQ12(coeffs: Sequence[int | FQ])
Bases:
FQ12,optimized_bls12_381_FQP- FQ12_MODULUS_COEFFS: FQ12_modulus_coeffs_type = (2, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0)
- class py_ecc.fields.optimized_bls12_381_FQ2(coeffs: Sequence[int | FQ])
Bases:
FQ2,optimized_bls12_381_FQP- FQ2_MODULUS_COEFFS: FQ2_modulus_coeffs_type = (1, 0)
- class py_ecc.fields.optimized_bls12_381_FQP(coeffs: Sequence[int | FQ], modulus_coeffs: Sequence[int | FQ] = ())
Bases:
FQP
- class py_ecc.fields.optimized_bn128_FQ12(coeffs: Sequence[int | FQ])
Bases:
FQ12,optimized_bn128_FQP- FQ12_MODULUS_COEFFS: FQ12_modulus_coeffs_type = (82, 0, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0)