| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/Cryptodome/Math/__pycache__/ |
Upload File : |
�
��es � � � d dl mZ ddlmZmZ ddlmZmZmZm Z m
Z
mZ ddlm
Z
dZ ede� Zde d �Z G d
� de� Zy)
� )�
IntegerNative� )�
long_to_bytes�
bytes_to_long)�load_pycryptodome_raw_lib�create_string_buffer�get_raw_buffer�backend�c_size_t�c_ulonglong)�getrandbitsa�
int monty_pow(uint8_t *out,
const uint8_t *base,
const uint8_t *exp,
const uint8_t *modulus,
size_t len,
uint64_t seed);
int monty_multiply(uint8_t *out,
const uint8_t *term1,
const uint8_t *term2,
const uint8_t *modulus,
size_t len);
zCryptodome.Math._modexp�custom)�library�apic �6 � e Zd Zedd�� Zdd�Zed� � Zy)�
IntegerCustomc � � |dk( rn,|dk( rt | � } | j � nt d� �t t | � � S )N�big�littlezIncorrect byteorder)� bytearray�reverse�
ValueErrorr r )�byte_string� byteorders �@/usr/lib/python3/dist-packages/Cryptodome/Math/_IntegerCustom.py�
from_byteszIntegerCustom.from_bytesA sG � �����
�(�
"�#�K�0�K����!��2�3�3��]�;�7�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 j | |||t |� t t d� � � }
|
rt d|
z � �t t | � � }|| _ | S )Nr zExponent must not be negative�Modulus must be positive�Modulus 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_powL s_ � ���M� ��q�=��<�=�=� �?��d�k�k�9�5�D�K��K� ��L� ��q�=��7�8�8���>�#�$<�=�=�
��M�a���d�k�k�9�i�@�D�K��K� �;�;�)�#��K�K�9�$�K��m�C����Y� �$J�K�L���t�{�{�G�4���i��1��!�)�W�5� �"�7�+���)�)������W�%���B��0�
�� ��>��F�G�G��~�c�2�3������r c � � t |� }|dk rt d� �|dk( rt d� �|dz dk( rt d� �| |k\ s| dk r| |z } ||k\ s|dk r||z }t |� }t |� }t | |� }t ||� }t |� }t j ||||t |� � } | rt d| z � �t |� S )Nr r r r zOdd modulus is requiredz$monty_multiply failed with error: %d)
r"