3.0.ipv8.attestation.wallet.bonehexact.algorithm ================================================ .. py:module:: 3.0.ipv8.attestation.wallet.bonehexact.algorithm Classes ------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.bonehexact.algorithm.BonehAttestation 3.0.ipv8.attestation.wallet.bonehexact.algorithm.BonehExactAlgorithm Module Contents --------------- .. py:class:: BonehAttestation(PK: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey, bitpairs: list[BitPairAttestation], id_format: str | None = None) Bases: :py:obj:`3.0.ipv8.attestation.identity_formats.Attestation` An attestation for a public key of a value consisting of multiple bitpairs. .. py:attribute:: bitpairs .. py:attribute:: PK .. py:attribute:: id_format .. py:method:: serialize() -> bytes Serialize this attestation to bytes. .. py:method:: serialize_private(PK: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey) -> bytes Serialize the private part of this attestation. .. py:method:: unserialize(s: bytes, id_format: str | None = None) -> typing_extensions.Self :classmethod: Unserialize the public format of this attestation. .. py:method:: unserialize_private(sk: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey, s: bytes, id_format: str | None = None) -> typing_extensions.Self :classmethod: Unserialize the private format of this attestation. .. py:class:: BonehExactAlgorithm(id_format: str, formats: dict[str, dict[str, Any]]) Bases: :py:obj:`3.0.ipv8.attestation.identity_formats.IdentityAlgorithm` IPv8 wrapper around ZKP using Boneh partially-homom. crypto scheme. .. py:attribute:: honesty_check :value: True .. py:attribute:: key_size .. py:method:: generate_secret_key() -> 3.0.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey Generate a secret key. :return: the secret key .. py:method:: load_secret_key(serialized: bytes) -> 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey | None Unserialize a secret key from the key material. :param serialized: the string of the private key :return: the private key .. py:method:: load_public_key(serialized: bytes) -> 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey | None Unserialize a public key from the key material. :param serialized: the string of the public key :return: the public key .. py:method:: get_attestation_class() -> type[3.0.ipv8.attestation.wallet.bonehexact.structs.BonehAttestation] Return the Attestation (sub)class for serialization. :return: the Attestation object :rtype: BonehAttestation .. py:method:: attest(PK: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey, value: bytes) -> bytes Attest to a value for a certain public key. :param PK: the public key of the party we are attesting for :type PK: BonehPublicKey :param value: the value we are attesting to :type value: str :return: the attestation string :rtype: str .. py:method:: certainty(value: bytes, aggregate: dict) -> float The current certainty of the aggregate object representing a certain value. :param value: the value to match to :type value: str :param aggregate: the aggregate object :type aggregate: dict :return: the matching factor [0.0-1.0] :rtype: float .. py:method:: create_challenges(PK: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey, attestation: 3.0.ipv8.attestation.wallet.bonehexact.structs.BonehAttestation) -> list[bytes] Create challenges for a certain counterparty. :param PK: the public key of the party we are challenging :type PK: BonehPublicKey :param attestation: the attestation information :type attestation: BonehAttestation :return: the challenges to send :rtype: [str] .. py:method:: create_challenge_response(SK: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPrivateKey, attestation: 3.0.ipv8.attestation.wallet.bonehexact.structs.BonehAttestation, challenge: bytes) -> bytes Create an honest response to a challenge of our value. :param SK: our secret key :type SK: BonehPrivateKey :param attestation: the attestation information :type attestation: Attestation :param challenge: the challenge to respond to :return: the response to a challenge :rtype: str .. py:method:: create_certainty_aggregate(attestation: 3.0.ipv8.attestation.wallet.bonehexact.structs.BonehAttestation | None) -> dict Create an empty aggregate object, for matching to values. :param attestation: the attestation information :type attestation: Attestation :return: the aggregate object :rtype: dict .. py:method:: create_honesty_challenge(PK: 3.0.ipv8.attestation.wallet.primitives.structs.BonehPublicKey, value: int) -> bytes Use a known value to check for honesty. :param PK: the public key of the party we are challenging :type PK: BonehPublicKey :param value: the value to use :type value: str :return: the challenge to send :rtype: str .. py:method:: process_honesty_challenge(value: int, response: bytes) -> bool Given a response, check if it matches the expected value. :param value: the expected value :type value: int :param response: the returned response :type response: str :return: if the value matches the response :rtype: bool .. py:method:: process_challenge_response(aggregate: dict, challenge: bytes, response: bytes) -> dict Given a response, update the current aggregate. :param aggregate: the aggregate object :type aggregate: dict :param challenge: the sent challenge :type challenge: str :param response: the response to introduce :type response: str :return: the new aggregate :rtype: dict .. py:method:: import_blob(blob: bytes) -> tuple[bytes, 3.0.ipv8.attestation.wallet.database.SecretKeyProtocol] :abstractmethod: Not supported.