관리-도구
편집 파일: _IntegerCustom.cpython-311.pyc
� O�Dg� � � � d dl mZ ddlmZmZ ddlmZmZmZm Z m Z mZ ddlm Z dZ ede� � Zde d �Z G d � de� � ZdS ) � )� IntegerNative� )� long_to_bytes� bytes_to_long)�load_pycryptodome_raw_lib�create_string_buffer�get_raw_buffer�backend�c_size_t�c_ulonglong)�getrandbitsz� int monty_pow(const uint8_t *base, const uint8_t *exp, const uint8_t *modulus, uint8_t *out, size_t len, uint64_t seed); zCrypto.Math._modexp�custom)�library�apic �. � e Zd Zedd�� � Zdd�ZdS )� IntegerCustom�bigc � � |dk rn9|dk r$t | � � } | � � � nt d� � �t t | � � � � S )Nr �littlezIncorrect byteorder)� bytearray�reverse� ValueErrorr r )�byte_string� byteorders �|/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Math/_IntegerCustom.py� from_byteszIntegerCustom.from_bytes; sb � ������ �(� "� "�#�K�0�0�K����!�!�!�!��2�3�3�3��]�;�7�7�8�8�8� Nc �` � t |� � }|dk rt d� � �|�t | j |� � | _ | S t |� � }|dk rt d� � �|dk rt d� � �|dz dk rt | j ||� � | _ | S | j |k r| xj |z c_ t t t | j ||� � � � � � }t | j |� � }t ||� � }t ||� � }t |� � } t � | |||t |� � t t d� � � � � � } | rt d| z � � �t t | � � � � }|| _ | S )Nr zExponent must not be negativezModulus must be positivezModulus cannot be zeror �@ zmonty_pow failed with error: %d)�intr �pow�_value�ZeroDivisionError�lenr �maxr �_raw_montgomery� monty_powr r r r r )�self�exponent�modulus� exp_value� mod_value�max_len�base_b�exp_b� modulus_b�out�error�results r �inplace_powzIntegerCustom.inplace_powF s� � ���M�M� ��q�=�=��<�=�=�=� �?��d�k�9�5�5�D�K��K� ��L�L� ��q�=�=��7�8�8�8���>�>�#�$<�=�=�=� ��M�a����d�k�9�i�@�@�D�K��K� �;�)�#�#��K�K�9�$�K�K��m�C���Y� �$J�$J�K�K�L�L���t�{�G�4�4���i��1�1��!�)�W�5�5� �"�7�+�+���)�)������W�%�%���B���0�0� � �� � H��>��F�G�G�G��~�c�2�2�3�3������r )r )N)�__name__� __module__�__qualname__�staticmethodr r4 � r r r r 9 sF � � � � � ��9� 9� 9� �\�9�0� 0� 0� 0� 0� 0r r N)�_IntegerNativer �Crypto.Util.numberr r �Crypto.Util._raw_apir r r r r r �Crypto.Random.randomr �c_defsr&