3.0.ipv8.attestation.wallet.primitives.structs ============================================== .. py:module:: 3.0.ipv8.attestation.wallet.primitives.structs Classes ------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey 3.0.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey Functions --------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.primitives.structs.ipack 3.0.ipv8.attestation.wallet.primitives.structs.iunpack 3.0.ipv8.attestation.wallet.primitives.structs.pack_pair 3.0.ipv8.attestation.wallet.primitives.structs.unpack_pair Module Contents --------------- .. py:function:: ipack(num: int) -> bytes Serialize an integer. .. py:function:: iunpack(s: bytes) -> tuple[int, bytes] Unserialize an integer from a str. .. py:function:: pack_pair(a: int, b: int) -> bytes Serialize a pair of two integers. .. py:function:: unpack_pair(s: bytes) -> tuple[int, int, bytes] Unserialize a pair of two integers. .. py:class:: BonehPublicKey(p: int, g: 3.0.ipv8.attestation.wallet.primitives.value.FP2Value, h: 3.0.ipv8.attestation.wallet.primitives.value.FP2Value) A public key for Boneh et al.'s cryptosystem. .. py:attribute:: FIELDS :value: 5 .. py:attribute:: p .. py:attribute:: g .. py:attribute:: h .. py:method:: serialize() -> bytes Convert this key to a bytes instance. .. py:method:: unserialize(s: bytes) -> typing_extensions.Self | None :classmethod: Convert the given bytes to a BonehPublicKey. .. py:class:: BonehPrivateKey(p: int, g: 3.0.ipv8.attestation.wallet.primitives.value.FP2Value, h: 3.0.ipv8.attestation.wallet.primitives.value.FP2Value, n: int, t1: int) Bases: :py:obj:`BonehPublicKey` A private key for Boneh et al.'s cryptosystem. .. py:attribute:: FIELDS :value: 7 .. py:attribute:: n .. py:attribute:: t1 .. py:method:: serialize() -> bytes Add the private n and t1 values to the binary format. .. py:method:: public_key() -> BonehPublicKey Strip out the private information.