latest.ipv8.attestation.wallet.primitives.ec

Ported from “The Weil Pairing on Elliptic Curves and Its Cryptographic Applications” - Appendix D by Alex Edward Aftuk.

Module Contents

Functions

esum(...)

Perform Elliptic Curve addition of points P and Q over Fp^2.

H(...)

Perform the h_{T,T} function for the Miller calculation with divisors P and Q for coordinate (x,y).

millercalc(...)

Perform the Miller calculation for message M point P and coordinates given by R.

weilpairing(...)

Create a Weil pairing for message m, points P and Q and DH secret S.

latest.ipv8.attestation.wallet.primitives.ec.esum(mod: int, p: str | tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value], q: str | tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value]) str | tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value]

Perform Elliptic Curve addition of points P and Q over Fp^2.

latest.ipv8.attestation.wallet.primitives.ec.H(mod: int, p: str | tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value], q: str | tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value], x: latest.ipv8.attestation.wallet.primitives.value.FP2Value, y: latest.ipv8.attestation.wallet.primitives.value.FP2Value) latest.ipv8.attestation.wallet.primitives.value.FP2Value

Perform the h_{T,T} function for the Miller calculation with divisors P and Q for coordinate (x,y).

latest.ipv8.attestation.wallet.primitives.ec.millercalc(mod: int, M: int, p: tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value], R: tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value]) latest.ipv8.attestation.wallet.primitives.value.FP2Value

Perform the Miller calculation for message M point P and coordinates given by R.

latest.ipv8.attestation.wallet.primitives.ec.weilpairing(mod: int, m: int, P: tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value], Q: tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value], S: tuple[latest.ipv8.attestation.wallet.primitives.value.FP2Value, latest.ipv8.attestation.wallet.primitives.value.FP2Value]) latest.ipv8.attestation.wallet.primitives.value.FP2Value

Create a Weil pairing for message m, points P and Q and DH secret S.