관리-도구
편집 파일: test_modexp.cpython-311.pyc
� O�Dg� � � � d Z ddlZddlmZ ddlmZmZ ddlT ddlm Z m Z mZmZm Z ddlmZ ddlmZ dd lmZ dd lmZ d� Z G d� d e� � Zd� ZdZdZ G d� dej � � Zi fd�Zedk rd� Z ej! d�� � dS dS )z.Self-test for the custom module exponentiation� N)�list_test_cases)� long_to_bytes� bytes_to_long)�*)�load_pycryptodome_raw_lib�create_string_buffer�get_raw_buffer�c_size_t�c_ulonglong)�SHAKE128)�Integer)�_raw_montgomery)�StrongRandomc �J � t t j | �� � � � }|S )N)�data)r r �new)�tag�rngs ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Math/test_modexp.py� create_rngr 9 s! � � �x�|��-�-�-� .� .�C��J� c � � e Zd ZdS )�ExceptionModulusN)�__name__� __module__�__qualname__� r r r r = s � � � � � ��Dr r c � � � t t t | ||� � � � � � � � fd�| ||fD � � \ }}}t � � � }t j ||||t � � � t d� � � � }|dk rt � � �|rt d|z � � �t t |� � � � }|S )Nc �0 �� g | ]}t |�� � ��S r )r )�.0�x�max_lens �r � <listcomp>zmonty_pow.<locals>.<listcomp>C s/ �� � 8� 8� 8�q��q�'�!:�!:� 8� 8� 8r � � zmonty_pow failed with error: %d)�lenr �maxr r � monty_powr r r � ValueErrorr r ) �base�exp�modulus�base_b�exp_b� modulus_b�out�error�resultr"