3.0.ipv8.attestation.wallet.primitives.cryptography_wrapper =========================================================== .. py:module:: 3.0.ipv8.attestation.wallet.primitives.cryptography_wrapper Functions --------- .. autoapisummary:: 3.0.ipv8.attestation.wallet.primitives.cryptography_wrapper.generate_safe_prime 3.0.ipv8.attestation.wallet.primitives.cryptography_wrapper.is_prime Module Contents --------------- .. py:function:: generate_safe_prime(bit_length: int, backend: cryptography.hazmat.backends.openssl.backend.Backend = default_backend()) -> int Generate a 'safe' prime p ((p-1)/2 is also prime). :param bit_length: the length of the generated prime in bits :type bit_length: int :param backend: the cryptography backend to use :type backend: Backend :return: the generated prime :rtype: int .. py:function:: is_prime(number: int, backend: cryptography.hazmat.backends.openssl.backend.Backend = default_backend()) -> bool Check a number for primality. :param number: the number to check for primality :type number: int :param backend: the cryptography backend to use :type backend: Backend :return: True is the n is expected to be prime, False otherwise :rtype: bool