latest.ipv8.attestation.wallet.primitives.structs

Module Contents

Classes

BonehPublicKey

A public key for Boneh et al.'s cryptosystem.

BonehPrivateKey

A private key for Boneh et al.'s cryptosystem.

Functions

ipack(→ bytes)

Serialize an integer.

iunpack(→ tuple[int, bytes])

Unserialize an integer from a str.

pack_pair(→ bytes)

Serialize a pair of two integers.

unpack_pair(→ tuple[int, int, bytes])

Unserialize a pair of two integers.

latest.ipv8.attestation.wallet.primitives.structs.ipack(num: int) bytes

Serialize an integer.

latest.ipv8.attestation.wallet.primitives.structs.iunpack(s: bytes) tuple[int, bytes]

Unserialize an integer from a str.

latest.ipv8.attestation.wallet.primitives.structs.pack_pair(a: int, b: int) bytes

Serialize a pair of two integers.

latest.ipv8.attestation.wallet.primitives.structs.unpack_pair(s: bytes) tuple[int, int, bytes]

Unserialize a pair of two integers.

class latest.ipv8.attestation.wallet.primitives.structs.BonehPublicKey(p: int, g: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h: latest.ipv8.attestation.wallet.primitives.value.FP2Value)

A public key for Boneh et al.’s cryptosystem.

FIELDS = 5
serialize() bytes

Convert this key to a bytes instance.

classmethod unserialize(s: bytes) typing_extensions.Self | None

Convert the given bytes to a BonehPublicKey.

class latest.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey(p: int, g: latest.ipv8.attestation.wallet.primitives.value.FP2Value, h: latest.ipv8.attestation.wallet.primitives.value.FP2Value, n: int, t1: int)

Bases: BonehPublicKey

A private key for Boneh et al.’s cryptosystem.

FIELDS = 7
serialize() bytes

Add the private n and t1 values to the binary format.

public_key() BonehPublicKey

Strip out the private information.