관리-도구
편집 파일: test_import_ECC.cpython-311.pyc
� O�Dg�� � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm Z m Z mZ d dlm Z mZ d dlmZ d dlmZ d dlmZ d dlZd Zn # e$ r d ZY nw xY w G d� de� � Zd<d�Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#d� Z$ G d� dej% � � Z& G d� dej% � � Z' G d� dej% � � Z( G d� d ej% � � Z) G d!� d"ej% � � Z* G d#� d$ej% � � Z+ G d%� d&ej% � � Z, G d'� d(ej% � � Z- G d)� d*ej% � � Z. G d+� d,ej% � � Z/ G d-� d.ej% � � Z0 G d/� d0ej% � � Z1 G d1� d2ej% � � Z2 G d3� d4ej% � � Z3 G d5� d6ej% � � Z4i fd7�Z5e6d8k rd9� Z7 ej8 d:�;� � dS dS )=� N)� unhexlify)�list_test_cases)�bord�tostr�FileNotFoundError)�DerSequence�DerBitString)� bytes_to_long)�SHAKE128)�ECCTFc � � e Zd ZdS )�MissingTestVectorExceptionN)�__name__� __module__�__qualname__� � ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/PublicKey/test_import_ECC.pyr r 4 s � � � � � ��Dr r �rbc �B � d } t s7t t j t j t j � � | � � �d}t j � t j � � }t j � t j j |g|�R � | � � }t ||� � 5 }|� � � }d d d � � n# 1 swxY w Y n,# t $ r t j dt d�� � Y nw xY w|�t! d| z � � �|S )N)� PublicKeyr z(Warning: skipping extended tests for ECC� )� stacklevelz Missing %s)�test_vectors_availabler �errno�ENOENT�os�strerror�path�dirname�pycryptodome_test_vectors�__file__�join�open�read�warnings�warn�UserWarningr )� file_name�mode�results� dir_comps�init_dir�full_file_name�file_ins r � load_filer0 8 s[ � ��G�$�%� /�#�E�L�$&�K���$=�$=�$-�/� /� /� )� ��7�?�?�#<�#E�F�F������b�g�l�8�&H�i�&H�&H�&H�)�T�T�� �.�$� '� '� %�7��l�l�n�n�G� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %��� � $� $� $�� �@�!�!"� $� $� $� $� $� $�$���� ��(�� �)A�B�B�B��Ns6 �B.C �2C�C �C�C �C�C �&D�Dc � � d� | � � }t t |� � � dd� � � dd� � � � S )Nr � � �:)r# r r �replace)�lines�exts r �compactr8 R sE � � �(�(�5�/�/�C��U�3�Z�Z�'�'��R�0�0�8�8��b�A�A�B�B�Br c � � d} t d� � � � � }t t |dd� � � � � }t |dd� � � }t |d � � dk sJ �t |d| dz � � � }t || dz d � � � }t j d |� � � t j d ||�� � fS )N� zecc_p192.txtr � � � r � zP-192��curve�d�r@ �point_x�point_y�r0 � splitlinesr r8 r r � construct��key_len� key_lines� private_key_d� public_key_xy�public_key_x�public_key_ys r �create_ref_keys_p192rO W �� � ��G��.�)�)�4�4�6�6�I�!�'�)�A�a�C�.�"9�"9�:�:�M��I�a��c�N�+�+�M�� �a� �!�!�Q�&�&�&�&� ��q����{�!;�<�<�L� ��w�q�y�z�z�!:�;�;�L��M��=�9�9�9��M���|�T�T�T�V� Vr c � � d} t d� � � � � }t t |dd� � � � � }t |dd� � � }t |d � � dk sJ �t |d| dz � � � }t || dz d � � � }t j d |� � � t j d ||�� � fS )N� zecc_p224.txtr r; r<