관리-도구
편집 파일: _IntegerBase.cpython-311.pyc
� O�Dg) � �N � d dl Z d dlmZmZmZmZ d dlmZ G d� de� � ZdS )� N)� iter_range�bord�bchr�ABC)�Randomc �> � e Zd Zej d� � � Zej d� � � Zej d� � � Zej d5d�� � Ze ej d6d�� � � � Z ej d� � � Zej d � � � Zej d � � � Z ej d� � � Zej d� � � Zej d � � � Zej d� � � ZeZej d� � � Zej d� � � Zej d� � � Zej d� � � Zej d� � � Zej d� � � Zej d7d�� � Zej d7d�� � Zej d� � � Zej d7d�� � Zej d� � � Zej d� � � Zej d� � � Zej d� � � Z ej d� � � Z!ej d� � � Z"ej d � � � Z#ej d!� � � Z$ej d"� � � Z%ej d#� � � Z&ej d$� � � Z'ej d%� � � Z(ej d&� � � Z)ej d'� � � Z*ej d(� � � Z+ej d)� � � Z,ej d*� � � Z-ej d+� � � Z.ej d,� � � Z/ej d-� � � Z0ej d.� � � Z1ej d/� � � Z2ej d0� � � Z3e ej d1� � � � � Z4e d2� � � Z5e6d3� � � Z7e6d4� � � Z8dS )8�IntegerBasec � � d S �N� ��selfs �z/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Math/_IntegerBase.py�__int__zIntegerBase.__int__) � � ��� c � � d S r r r s r �__str__zIntegerBase.__str__- r r c � � d S r r r s r �__repr__zIntegerBase.__repr__1 r r r �bigc � � d S r r )r � block_size� byteorders r �to_byteszIntegerBase.to_bytes5 r r c � � d S r r )�byte_stringr s r � from_byteszIntegerBase.from_bytes9 � � � �r c � � d S r r �r �terms r �__eq__zIntegerBase.__eq__? r r c � � d S r r r! s r �__ne__zIntegerBase.__ne__C r r c � � d S r r r! s r �__lt__zIntegerBase.__lt__G r r c � � d S r r r! s r �__le__zIntegerBase.__le__K r r c � � d S r r r! s r �__gt__zIntegerBase.__gt__O r r c � � d S r r r! s r �__ge__zIntegerBase.__ge__S r r c � � d S r r r s r �__nonzero__zIntegerBase.__nonzero__W r r c � � d S r r r s r �is_negativezIntegerBase.is_negative\ r r c � � d S r r r! s r �__add__zIntegerBase.__add__a r r c � � d S r r r! s r �__sub__zIntegerBase.__sub__e r r c � � d S r r )r �factors r �__mul__zIntegerBase.__mul__i r r c � � d S r r �r �divisors r �__floordiv__zIntegerBase.__floordiv__m r r c � � d S r r r: s r �__mod__zIntegerBase.__mod__q r r Nc � � d S r r �r �exponent�moduluss r �inplace_powzIntegerBase.inplace_powu r r c � � d S r r r@ s r �__pow__zIntegerBase.__pow__y r r c � � d S r r r s r �__abs__zIntegerBase.__abs__} r r c � � d S r r �r rB s r �sqrtzIntegerBase.sqrt� r r c � � d S r r r! s r �__iadd__zIntegerBase.__iadd__� r r c � � d S r r r! s r �__isub__zIntegerBase.__isub__� r r c � � d S r r r! s r �__imul__zIntegerBase.__imul__� r r c � � d S r r r! s r �__imod__zIntegerBase.__imod__� r r c � � d S r r r! s r �__and__zIntegerBase.__and__� r r c � � d S r r r! s r �__or__zIntegerBase.__or__� r r c � � d S r r �r �poss r � __rshift__zIntegerBase.__rshift__� r r c � � d S r r rX s r �__irshift__zIntegerBase.__irshift__� r r c � � d S r r rX s r � __lshift__zIntegerBase.__lshift__� r r c � � d S r r rX s r �__ilshift__zIntegerBase.__ilshift__� r r c � � d S r r )r �ns r �get_bitzIntegerBase.get_bit� r r c � � d S r r r s r �is_oddzIntegerBase.is_odd� r r c � � d S r r r s r �is_evenzIntegerBase.is_even� r r c � � d S r r r s r �size_in_bitszIntegerBase.size_in_bits� r r c � � d S r r r s r � size_in_byteszIntegerBase.size_in_bytes� r r c � � d S r r r s r �is_perfect_squarezIntegerBase.is_perfect_square� r r c � � d S r r )r �small_primes r �fail_if_divisible_byz IntegerBase.fail_if_divisible_by� r r c � � d S r r )r �a�bs r �multiply_accumulatezIntegerBase.multiply_accumulate� r r c � � d S r r )r �sources r �setzIntegerBase.set� r r c � � d S r r rI s r �inplace_inversezIntegerBase.inplace_inverse� r r c � � d S r r rI s r �inversezIntegerBase.inverse� r r c � � d S r r r! s r �gcdzIntegerBase.gcd� r r c � � d S r r r! s r �lcmzIntegerBase.lcm� r r c � � d S r r )rr rb s r � jacobi_symbolzIntegerBase.jacobi_symbol� r r c �P � | dv r| S |dz dk r=t | |dz dz |� � }t |d|� � | k rt d� � �|S d}|dz dz }|dz s|dz }|dz }|dz �| � d� � } t ||dz dz |� � }|dk r|dz }�$||dz k rnt d� � �|}t |||� � }t | ||� � } t | |dz dz |� � } | dk r�t d|� � D ]}t | d|z |� � dk r n�||k rt d | |fz � � �t |d||z dz z |� � }|}|dz |z }| |dz z |z } | |z |z } | dk ��t | d|� � | k rt d� � �| S ) a� Tonelli-shanks algorithm for computing the square root of n modulo a prime p. n must be in the range [0..p-1]. p must be at least even. The return value r is the square root of modulo p. If non-zero, another solution will also exist (p-r). Note we cannot assume that p is really a prime: if it's not, we can either raise an exception or return the correct value. )r � � � r� � zCannot compute square rootTr z'Cannot compute square root of %d mod %d)�pow� ValueError� __class__r ) rb �p�root�s�q�z�euler�m�c�t�r�irs s r �_tonelli_shankszIntegerBase._tonelli_shanks� s( � �"