2.12.ipv8.attestation.wallet.pengbaorange.boudot
Implementation of proofs for checking commitment equality and if a commitment is a square (“Efficient Proofs that a Committed NumberLies in an Interval” by F. Boudot).
Modified for use with range proofs (“An efficient range proof scheme.” by K. Peng and F. Bao).
Module Contents
Classes
Functions
- 2.12.ipv8.attestation.wallet.pengbaorange.boudot.secure_randint(nmin: int, nmax: int) int
Generate a secure random integer.
- 2.12.ipv8.attestation.wallet.pengbaorange.boudot._sipack(*n: int) bytes
Pack a list of up to 8 ints to a bytes string, prepended with a byte for which each bit specifies if the packed int was negative.
- 2.12.ipv8.attestation.wallet.pengbaorange.boudot._siunpack(buf: bytes, amount: int) tuple[Iterator[int], bytes]
Unpack a given number of integer values from a buffer, packed with
_sipack()
.
- class 2.12.ipv8.attestation.wallet.pengbaorange.boudot.EL(c: int, D: int, D1: int, D2: int)
Proof that two commitments hide the same secret.
- classmethod create(x: int, r1: int, r2: int, g1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, h1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, g2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, h2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, b: int, bitspace: int, t: int = 80, l: int = 40) EL
Create a new commitment that allows one to prove knowledge of secret integers x, r1 and r2.
- check(g1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, h1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, g2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, h2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, y1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, y2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value) bool
Check for equality with another commitment.
- class 2.12.ipv8.attestation.wallet.pengbaorange.boudot.SQR(F: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, el: EL)
Proof that a committed number is a square.
- classmethod create(x: int, r1: int, g: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, h: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, b: int, bitspace: int) SQR
Create a new commitment that allows one to prove that the committed integer x is a square.
- check(g: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, h: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, y: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value) bool
Check for a committed square.