Server IP : 192.158.238.246 / Your IP : 18.191.89.16 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Math/__pycache__/ |
Upload File : |
� �� hk, � � � d Z ddlmZ ddlmZ ddlmZ dZdZdd�Z d� Z dd lmZ ee dd � � � Zdd�Zd� Zd � ZdS )zHFunctions to create and test prime numbers. :undocumented: __package__ � )�Random)�Integer)� iter_range� Nc � � t | t � � st | � � } | dv rt S | � � � rt S t d� � }t | dz � � }|�t j � � j }t |� � }d}|� � � r|dz }|dz }|� � � �t |� � D ]�}d}|||fv r4t j d| dz |�� � }d|cxk r | dz k sn J �|||fv �4t ||| � � } | ||fv r�Vt d|� � D ],} t | d| � � } | |k r n| |k rt c c S �-t c S ��t S )a: Perform a Miller-Rabin primality test on an integer. The test is specified in Section C.3.1 of `FIPS PUB 186-4`__. :Parameters: candidate : integer The number to test for primality. iterations : integer The maximum number of iterations to perform before declaring a candidate a probable prime. randfunc : callable An RNG function where bases are taken from. :Returns: ``Primality.COMPOSITE`` or ``Primality.PROBABLY_PRIME``. .. __: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf �r � � � r Nr r )� min_inclusive� max_inclusive�randfunc)� isinstancer �PROBABLY_PRIME�is_even� COMPOSITEr �new�readr �random_range�pow)� candidate� iterationsr �one� minus_one�m�a�i�base�z�js �w/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Math/Primality.py�miller_rabin_testr"