ok
Direktori : /opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Random/__pycache__/ |
Current File : //opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Random/__pycache__/random.cpython-311.pyc |
� f��fr � �� � g d �Z ddlmZ ddlmZ G d� de� � Z e� � Zej Zej Z ej Z ej Zej Zej Z ddlmZmZmZmZ dS ))�StrongRandom�getrandbits� randrange�randint�choice�shuffle�sample� )�Random)� is_native_intc �: � e Zd Zd d�Zd� Zd� Zd� Zd� Zd� Zd� Z dS ) r Nc �x � |�|� d | _ d S |�|� || _ d S |�|�|j | _ d S t d� � �)Nz(Cannot specify both 'rng' and 'randfunc')� _randfunc�read� ValueError)�self�rng�randfuncs �v/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Random/random.py�__init__zStrongRandom.__init__ sR � �����!�D�N�N�N� � !�c�k�%�D�N�N�N� � �#�/� �X�D�N�N�N��G�H�H�H� c � � | j �t j � � j | _ d|z dz }|t | � t |d� � � � � � z S )z%Return an integer with k random bits.N� � )r r �newr � bytes_to_long�ceil_div)r �k�masks r r zStrongRandom.getrandbits* sP � � �>�!�#�Z�\�\�.�D�N��Q��!�|���m�D�N�N�8�A�q�>�>�$B�$B�C�C�C�Cr c �j � t |� � dk r|\ }}}nWt |� � dk r|\ }}d}n<t |� � dk r |\ }d}d}n t dt |� � fz � � �t |� � rt |� � rt |� � st d� � �|dk rt d� � �t ||z |� � }|dk rd}|dk rt d|�d |�d |�d �� � �|}||k r(| � t |� � � � }||k �(|||z z S )zkrandrange([start,] stop[, step]): Return a randomly-selected element from range(start, stop, step).� � r r z.randrange expected at most 3 arguments, got %dz$randrange requires integer argumentsz(randrange step argument must not be zerozempty range for randrange(z, �))�len� TypeErrorr r r r �size)r �args�start�stop�step�num_choices�rs r r zStrongRandom.randrange2 sv � � �t�9�9��>�>�"&��U�D�$�$� ��Y�Y�!�^�^� �M�U�D��D�D� ��Y�Y�!�^�^��G�T��E��D�D��L�PS�TX�PY�PY�|�[�\�\�\��e�$�$� D�M�$�,?�,?� D��d�#�#� D��B�C�C�C��1�9�9��G�H�H�H��t�e�|�T�2�2����?�?��K���?�?��*����t�t�t�UY�UY�UY�Z�[�[�[� ���;���� � ��k�!2�!2�3�3�A� �;��� ��q��!�!r c � � t |� � rt |� � st d� � �| � ||dz � � }||cxk r|k sn J �|S )z0Return a random integer N such that a <= N <= b.z"randint requires integer argumentsr )r r$ r )r �a�b�Ns r r zStrongRandom.randintS si � ��Q��� B�}�Q�'7�'7� B��@�A�A�A��N�N�1�a��c�"�"���A�{�{�{�{��{�{�{�{�{�{��r c � � t |� � dk rt d� � �|| � t |� � � � S )zrReturn a random element from a (non-empty) sequence. If the seqence is empty, raises IndexError. r zempty sequence)r# � IndexErrorr )r �seqs r r zStrongRandom.choice[ s? � � �s�8�8�q�=�=��-�.�.�.��4�>�>�#�c�(�(�+�+�,�,r c � � t t |� � dz dd� � D ]2}| � d|dz � � }|| || c||<