2.12.ipv8.attestation.wallet.pengbaorange.structs
Module Contents
Classes
Functions
- 2.12.ipv8.attestation.wallet.pengbaorange.structs._serialize_fp2value(value: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value) bytes
Convert an FP2Value to bytes.
- 2.12.ipv8.attestation.wallet.pengbaorange.structs._unserialize_fp2value(mod: int, value: bytes) tuple[2.12.ipv8.attestation.wallet.primitives.value.FP2Value, bytes]
Decode serialized bytes back into an FP2Value of the given modulus.
- class 2.12.ipv8.attestation.wallet.pengbaorange.structs.PengBaoCommitment(c: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, c1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, c2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, ca: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, ca1: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, ca2: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, ca3: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value, caa: 2.12.ipv8.attestation.wallet.primitives.value.FP2Value)
The proof structure that a commitment hides a value within a certain range.
- classmethod unserialize(s: bytes) tuple[PengBaoCommitment, bytes]
Convert bytes to a commitment.
- class 2.12.ipv8.attestation.wallet.pengbaorange.structs.PengBaoCommitmentPrivate(m1: int, m2: int, m3: int, r1: int, r2: int, r3: int)
Private part of the PengBaoCommitment.
- generate_response(s: int, t: int) tuple[int, int, int, int]
Given s and t and our private information, generate the appropriate response.
The calling function should make sure s and t are large integers (at least larger than 0).
- classmethod unserialize(s: bytes) tuple[PengBaoCommitmentPrivate, bytes]
Convert bytes to a commitment.
- encode(PK: 2.12.ipv8.attestation.wallet.primitives.structs.BonehPublicKey) bytes
Serialize and encode using a given public key.
- classmethod decode(SK: 2.12.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey, s: bytes) PengBaoCommitmentPrivate
Decode an encoded PengBaoCommitmentPrivate using a secret key.
- class 2.12.ipv8.attestation.wallet.pengbaorange.structs.PengBaoPublicData(PK: 2.12.ipv8.attestation.wallet.primitives.structs.BonehPublicKey, bitspace: int, commitment: PengBaoCommitment, el: 2.12.ipv8.attestation.wallet.pengbaorange.boudot.EL, sqr1: 2.12.ipv8.attestation.wallet.pengbaorange.boudot.SQR, sqr2: 2.12.ipv8.attestation.wallet.pengbaorange.boudot.SQR)
Public data required to verify a Peng Bao proof.
- check(a: int, b: int, s: int, t: int, x: int, y: int, u: int, v: int) bool
Check whether the given range is correct.
- serialize() bytes
Serialize this Attestation to a string.
- Returns:
the serialized form of this attestation
- Return type:
- class 2.12.ipv8.attestation.wallet.pengbaorange.structs.PengBaoAttestation(publicdata: PengBaoPublicData, privatedata: PengBaoCommitmentPrivate | None, id_format: str | None = None)
Bases:
2.12.ipv8.attestation.identity_formats.Attestation
An attestation for a Peng Bao range proof.
- serialize() bytes
Serialize this Attestation to a string.
- Returns:
the serialized form of this attestation
- Return type:
- serialize_private(PK: 2.12.ipv8.attestation.wallet.primitives.structs.BonehPublicKey) bytes
Serialize this Attestation to a string, include shared secrets (not to be published!).
- Parameters:
PK – the public key to encode for
- Returns:
the serialized form of this attestation
- Return type:
- classmethod unserialize(s: bytes, id_format: str | None = None) PengBaoAttestation
Given a string, create an Attestation object.
- Parameters:
- Returns:
the attestation object
- Return type:
- classmethod unserialize_private(SK: 2.12.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey, s: bytes, id_format: str | None = None) PengBaoAttestation
Given a string, create an Attestation object. The input contains shared secrets not to be published.
- Parameters:
- Returns:
the attestation object
- Return type: