latest.ipv8.attestation.wallet.primitives.value
Module Contents
Classes
Defines a rational value (a + bx + cx^2)/(aC + bCx + cCx^2)(mod 1 + x + x^2, mod p). |
Functions
|
Formats a polynomial cx^2 + bx + a into non-zero/non-one form. |
- latest.ipv8.attestation.wallet.primitives.value.format_polynomial(a: int, b: int, c: int) str
Formats a polynomial cx^2 + bx + a into non-zero/non-one form.
Ex. ‘0x^2 + 1x + 2’ becomes ‘x + 2’
- Parameters:
a – x^0 coefficient
b – x^1 coefficient
c – x^2 coefficient
- Returns:
pretty format of polynomial
- class latest.ipv8.attestation.wallet.primitives.value.FP2Value(mod: int, a: int = 0, b: int = 0, c: int = 0, aC: int = 1, bC: int = 0, cC: int = 0)
Defines a rational value (a + bx + cx^2)/(aC + bCx + cCx^2)(mod 1 + x + x^2, mod p).
- __sub__(other: FP2Value) FP2Value
Subtract another value from this value and return a new FP2Value.
- __mul__(other: FP2Value) FP2Value
Multiply this value with another value and return a new FP2Value.
- __floordiv__(other: FP2Value) FP2Value
Divide this value by another value and return a new FP2Value.
- intpow(power: int) FP2Value
Raise this value by a given power (int).
- Parameters:
power (int) – the power to raise this value by