HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__/common.cpython-38.pyc
U


W[}�@s�dZddlmZmZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
dd	d
ddgZd
d�Zddd	�Zdd
�Zddd�Zdd�Zdd�Zee
dddd��dd��ZdS)z@
Common functions for the SSH classes.

Maintainer: Paul Swartz
�)�absolute_import�divisionN)�int_from_bytes�int_to_bytes)�unicode)�
deprecated)�Version�NS�getNS�MP�getMP�ffscCs(t|t�r|�d�}t�dt|��|S)z
    net string
    zutf-8�!L)�
isinstancer�encode�struct�pack�len)�t�r�:/usr/lib/python3/dist-packages/twisted/conch/ssh/common.pyr	s

�cCspg}d}t|�D]H}t�d|||d��\}|�||dd||��|d|7}qt|�||d�fS)z
    get net string
    rr�N)�ranger�unpack�append�tuple)�s�count�ns�c�i�lrrrr
#scCsP|dkrdS|dkst�t|�}t|dd��d@r<d|}t�dt|��|S)Nrsr���>L)�AssertionErrorr�ordrrr)ZnumberZbnrrrr1scCsvg}d}t|�D]N}t�d|||d��\}|�t||d|d|�d��|d|7}qt|�||d�fS)a=
    Get multiple precision integer out of the string.  A multiple precision
    integer is stored as a 4-byte length followed by length bytes of the
    integer.  If count is specified, get count integers out of the string.
    The return value is a tuple of count integers followed by the rest of
    the data.
    rr%rZbigN)rrrrrr)�datarZmpr r!Zlengthrrrr<s$cCstt|||��S)z3
    Return the MP version of C{(x ** y) % z}.
    )r�pow)�x�y�zrrr�_MPpowNsr-cCs|D]}||kr|SqdS)zs
    first from second
    goes through the first list, looking for items in the second, returns the first one
    Nr)r rr!rrrr
VsZTwisted��cCsdS)Nrrrrr�installasr0)r)r)�__doc__Z
__future__rrrZcryptography.utilsrrZtwisted.python.compatrZtwisted.python.deprecaterZtwisted.python.versionsr�__all__r	r
rrr-r
r0rrrr�<module>s