HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/paramiko/__pycache__/primes.cpython-310.pyc
o

�h��@sJdZddlZddlmZddlmZddlmZdd�ZGdd	�d	�Z	dS)
z,
Utility functions for dealing with primes.
�N)�util)�	byte_mask)�SSHExceptioncCsvt�|d�}|dd}td|d�d}	t�|�}|dkr-t|d|�|dd�}t�|d�}||kr:	|Sq)z returns a random # from 0 to N-1����TrN)r�
bit_length�pow�os�urandomr�inflate_long)�n�bits�
byte_count�
hbyte_mask�x�num�r�E/usr/local/CyberPanel/lib/python3.10/site-packages/paramiko/primes.py�_roll_randoms
�rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ModulusPackzx
    convenience object for holding the contents of the /etc/ssh/moduli file,
    on systems that have such a file.
    cCsi|_g|_dS)N)�pack�	discarded)�selfrrr�__init__:s
zModulusPack.__init__c
Cs�|��\}}}}}}}t|�}t|�}t|�}t|�}t|�}t|d�}|dks8|dks8|d@rB|dkrB|dkrB|j�|df�dS|dkrHd}t�|�}	|	|krd|	|dkrd|j�|d	�|�f�dS|	|jvrng|j|	<|j|	�||f�dS)
N�r�r�dz does not meet basic requirementsrrz"incorrectly reported bit length {})�split�intr�appendrr	�formatr)
r�line�	timestamp�mod_type�tests�tries�size�	generator�modulus�blrrr�_parse_modulus?sF	�
��
�

zModulusPack._parse_moduluscCszi|_t|d��+}|D]}|��}t|�dks|ddkrqz|�|�WqYqWd�dS1s6wYdS)zM
        :raises IOError: passed from any file operations that fail.
        �rr�#N)r�open�strip�lenr,)r�filename�fr#rrr�	read_filems�"�zModulusPack.read_filecCs�t|j���}t|�dkrtd��d}|D]}||kr)||kr)||ks'|dkr)|}q|dkrA|D]}||kr@||kr@||kr@|}q0|dkrQ|d}||krQ|d}tt|j|��}|j||S)Nrzno moduli available���)�sortedr�keysr1rr)r�min�prefer�max�bitsizes�good�brrrr�get_modulus|s& ��zModulusPack.get_modulusN)�__name__�
__module__�__qualname__�__doc__rr,r4r>rrrrr4s.r)
rBr�paramikor�paramiko.commonr�paramiko.ssh_exceptionrrrrrrr�<module>s