File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Math/__pycache__/_IntegerGMP.cpython-310.pyc
Back
o ;j�l � @ s d dl Z d dlZd dlmZ d dlmZmZmZmZm Z ddl mZ dZe j dkr-ed��ed e�Zd ed �Zeed�r@ed��G d d� de�Ze� Zed dkrnd dlmZmZmZmZ G dd� de�Zdd� Zeej_n d dlmZ dd� Zde�d� Z G dd� de�Z!dS )� N)� is_native_int)�backend�load_lib�c_ulong�c_size_t�c_uint8_ptr� )�IntegerBasea� 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); size_t __gmpz_size (const mpz_t op); UNIX_ULONG __gmpz_getlimbn (const mpz_t op, size_t n); �win32zNot using GMP on WindowsZgmp)�library�apiZ__mpir_versionzMPIR library detectedc @ s e Zd Zdd� ZdS )�_GMPc C s^ |� d�rd|dd � }n|� d�rd|dd � }ntd| ��tt|�}t| ||� |S )NZmpz_Z__gmpz_� Zgmp_Z__gmp_zAttribute %s is invalid)� startswith�AttributeError�getattr�lib�setattr)�self�nameZ func_name�func� r �O/opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Math/_IntegerGMP.py�__getattr__p s z_GMP.__getattr__N)�__name__� __module__�__qualname__r r r r r r n s r r �ctypes)� Structure�c_int�c_void_p�byrefc @ s"