관리-도구
편집 파일: _IntegerGMP.cpython-311.pyc
� O�Dgwh � � � d dl Z d dlmZmZ d dlmZmZmZmZm Z m Z mZmZm Z ddlmZ dZe j dk r ed� � � ed e� � Zd ed �Z eed� � r ed� � �ed dk rd dlmZmZmZmZ G d� de� � Zd� Zn d dlmZ d� Z G d� de� � Z e� � Z G d� de� � Z!dS )� N)�tobytes� is_native_int) �backend�load_lib�get_raw_buffer�get_c_string�null_pointer�create_string_buffer�c_ulong�c_size_t�c_uint8_ptr� )�IntegerBaseaY typedef unsigned long UNIX_ULONG; typedef struct { int a; int b; void *c; } MPZ; typedef MPZ mpz_t[1]; typedef UNIX_ULONG mp_bitcnt_t; void __gmpz_init (mpz_t x); void __gmpz_init_set (mpz_t rop, const mpz_t op); void __gmpz_init_set_ui (mpz_t rop, UNIX_ULONG op); UNIX_ULONG __gmpz_get_ui (const mpz_t op); void __gmpz_set (mpz_t rop, const mpz_t op); void __gmpz_set_ui (mpz_t rop, UNIX_ULONG op); void __gmpz_add (mpz_t rop, const mpz_t op1, const mpz_t op2); void __gmpz_add_ui (mpz_t rop, const mpz_t op1, UNIX_ULONG op2); void __gmpz_sub_ui (mpz_t rop, const mpz_t op1, UNIX_ULONG op2); void __gmpz_addmul (mpz_t rop, const mpz_t op1, const mpz_t op2); void __gmpz_addmul_ui (mpz_t rop, const mpz_t op1, UNIX_ULONG op2); void __gmpz_submul_ui (mpz_t rop, const mpz_t op1, UNIX_ULONG op2); void __gmpz_import (mpz_t rop, size_t count, int order, size_t size, int endian, size_t nails, const void *op); void * __gmpz_export (void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, const mpz_t op); size_t __gmpz_sizeinbase (const mpz_t op, int base); void __gmpz_sub (mpz_t rop, const mpz_t op1, const mpz_t op2); void __gmpz_mul (mpz_t rop, const mpz_t op1, const mpz_t op2); void __gmpz_mul_ui (mpz_t rop, const mpz_t op1, UNIX_ULONG op2); int __gmpz_cmp (const mpz_t op1, const mpz_t op2); void __gmpz_powm (mpz_t rop, const mpz_t base, const mpz_t exp, const mpz_t mod); void __gmpz_powm_ui (mpz_t rop, const mpz_t base, UNIX_ULONG exp, const mpz_t mod); void __gmpz_pow_ui (mpz_t rop, const mpz_t base, UNIX_ULONG exp); void __gmpz_sqrt(mpz_t rop, const mpz_t op); void __gmpz_mod (mpz_t r, const mpz_t n, const mpz_t d); void __gmpz_neg (mpz_t rop, const mpz_t op); void __gmpz_abs (mpz_t rop, const mpz_t op); void __gmpz_and (mpz_t rop, const mpz_t op1, const mpz_t op2); void __gmpz_ior (mpz_t rop, const mpz_t op1, const mpz_t op2); void __gmpz_clear (mpz_t x); void __gmpz_tdiv_q_2exp (mpz_t q, const mpz_t n, mp_bitcnt_t b); void __gmpz_fdiv_q (mpz_t q, const mpz_t n, const mpz_t d); void __gmpz_mul_2exp (mpz_t rop, const mpz_t op1, mp_bitcnt_t op2); int __gmpz_tstbit (const mpz_t op, mp_bitcnt_t bit_index); int __gmpz_perfect_square_p (const mpz_t op); int __gmpz_jacobi (const mpz_t a, const mpz_t b); void __gmpz_gcd (mpz_t rop, const mpz_t op1, const mpz_t op2); UNIX_ULONG __gmpz_gcd_ui (mpz_t rop, const mpz_t op1, UNIX_ULONG op2); void __gmpz_lcm (mpz_t rop, const mpz_t op1, const mpz_t op2); int __gmpz_invert (mpz_t rop, const mpz_t op1, const mpz_t op2); int __gmpz_divisible_p (const mpz_t n, const mpz_t d); int __gmpz_divisible_ui_p (const mpz_t n, UNIX_ULONG d); �win32zNot using GMP on Windows�gmp)�library�api�__mpir_versionzMPIR library detectedr �ctypes)� Structure�c_int�c_void_p�byrefc �$ � e Zd ZdefdefdefgZdS )�_MPZ� _mp_alloc�_mp_size�_mp_dN)�__name__� __module__�__qualname__r r �_fields_� � �y/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Math/_IntegerGMP.pyr r p s- � � � � � � �%�(���'��h�'�)���r$ r c �8 � t t � � � � S �N)r r r# r$ r% �new_mpzr( u s � ��T�V�V�}�}�r$ )�ffic �* � t j d� � S )NzMPZ*)r) �newr# r$ r% r( r( | s � ��w�v���r$ c � � e Zd Zd� ZdS )�_GMPc � � |� d� � rd|dd � z }n5|� d� � rd|dd � z }nt d|z � � �t t |� � }t | ||� � |S )N�mpz_�__gmpz_� �gmp_�__gmp_zAttribute %s is invalid)� startswith�AttributeError�getattr�lib�setattr)�self�name� func_name�funcs r% �__getattr__z_GMP.__getattr__� s� � ��?�?�6�"�"� C�!�D����H�,�I�I� �_�_�V� $� $� C� �4����8�+�I�I� �!:�T�!A�B�B�B��s�I�&�&����d�D�!�!�!��r$ N)r r r! r= r# r$ r% r- r- � s# � � � � � � � � � � r$ r- c �� � e Zd ZdZ e� � Ze� e ed� � � � d� Z d� Z d� Zd� Zd� Z d� Zd8d �Zed9d�� � Zd� Zd � Zd� Zd� Zd� Zd� Zd� Zd� ZeZd� Zd� Zd� Zd� Zd� Zd� Z d:d�Z!d:d�Z"d� Z#d:d�Z$d� Z%d � Z&d!� Z'd"� Z(d#� Z)d$� Z*d%� Z+d&� Z,d'� Z-d(� Z.d)� Z/d*� Z0d+� Z1d,� Z2d-� Z3d.� Z4d/� Z5d0� Z6d1� Z7d2� Z8d3� Z9d4� Z:d5� Z;ed6� � � Z<d7� Z=dS );� IntegerGMPz#A fast, arbitrary precision integerr c �6 � t � � | _ d| _ t |t � � rt d� � �t |� � �r�t � | j � � d| _ |dk rdS t � � }t � |� � |dk }t |� � }|� � � dz dz dz }|dk r�|dz }t � |t d||dz z z � � � � t � ||t |dz � � � � t � | j | j |� � |dk ��t � |� � n# t � |� � w xY w|s't � | j | j � � dS dS t |t"