latest.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
Proof that two commitments hide the same secret. |
|
Proof that a committed number is a square. |
Functions
|
Generate a secure random integer. |
|
Pack a list of up to 8 ints to a bytes string, prepended with a byte for which each bit specifies if the packed |
|
Unpack a given number of integer values from a buffer, packed with |
- latest.ipv8.attestation.wallet.pengbaorange.boudot.secure_randint(nmin: int, nmax: int) int
Generate a secure random integer.
- latest.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.
- latest.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 latest.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: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h1: latest.ipv8.attestation.wallet.primitives.value.FP2Value, g2: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h2: latest.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: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h1: latest.ipv8.attestation.wallet.primitives.value.FP2Value, g2: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h2: latest.ipv8.attestation.wallet.primitives.value.FP2Value, y1: latest.ipv8.attestation.wallet.primitives.value.FP2Value, y2: latest.ipv8.attestation.wallet.primitives.value.FP2Value) bool
Check for equality with another commitment.
- class latest.ipv8.attestation.wallet.pengbaorange.boudot.SQR(F: latest.ipv8.attestation.wallet.primitives.value.FP2Value, el: EL)
Proof that a committed number is a square.
- classmethod create(x: int, r1: int, g: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h: latest.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: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h: latest.ipv8.attestation.wallet.primitives.value.FP2Value, y: latest.ipv8.attestation.wallet.primitives.value.FP2Value) bool
Check for a committed square.