CyberAlphaWolf

Server : Apache
System : Linux 182.49.167.72.host.secureserver.net 4.18.0-553.92.1.el8_10.x86_64 #1 SMP Wed Jan 14 06:31:58 EST 2026 x86_64
User : kikai ( 1014)
PHP Version : 8.3.30
Disable Function : NONE
Directory :  /var/opt/nydus/ops/asn1crypto/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/opt/nydus/ops/asn1crypto/__pycache__/algos.cpython-312.pyc
�

��i�����dZddlmZmZmZmZddlmZddlm	Z	ddl
mZmZddl
mZmZmZmZmZmZmZmZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�ZGd�de�ZGd�dee�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Z Gd�de�Z!Gd�de�Z"Gd �d!ee�Z#Gd"�d#e�Z$Gd$�d%e�Z%Gd&�d'e�Z&Gd(�d)e�Z'Gd*�d+e�Z(Gd,�d-e�Z)Gd.�d/e�Z*Gd0�d1e�Z+Gd2�d3e�Z,Gd4�d5e�Z-Gd6�d7e�Z.Gd8�d9e�Z/Gd:�d;e�Z0Gd<�d=e�Z1Gd>�d?e�Z2Gd@�dAe�Z3GdB�dCe�Z4GdD�dEee�Z5GdF�dGe�Z6GdH�dIe�Z7GdJ�dKe�Z8GdL�dMe�Z9e6e5jtdN<GdO�dPe�Z;GdQ�dRee�Z<yS)Ta�
ASN.1 type classes for various algorithms using in various aspects of public
key cryptography. Exports the following items:

 - AlgorithmIdentifier()
 - AnyAlgorithmIdentifier()
 - DigestAlgorithm()
 - DigestInfo()
 - DSASignature()
 - EncryptionAlgorithm()
 - HmacAlgorithm()
 - KdfAlgorithm()
 - Pkcs5MacAlgorithm()
 - SignedDigestAlgorithm()

Other type classes are defined that help compose the types listed above.
�)�unicode_literals�division�absolute_import�print_function�)�unwrap)�
fill_width)�int_from_bytes�int_to_bytes)�Any�Choice�Integer�Null�ObjectIdentifier�OctetString�Sequence�Voidc�"�eZdZdefdeddifgZy)�AlgorithmIdentifier�	algorithm�
parameters�optionalTN)�__name__�
__module__�__qualname__rr�_fields���A/opt/nydus/tmp/pip-target-4r_833n3/lib/python/asn1crypto/algos.pyrr+s!��	�&�'�	�s�Z��.�/��Grrc�D��eZdZdZegd��Zd�ZdeiZ�fd�Z�xZ	S)�_ForceNullParametersz�
    Various structures based on AlgorithmIdentifier require that the parameters
    field be core.Null() for certain OIDs. This mixin ensures that happens.
    )
�1.2.840.113549.1.1.1�1.2.840.113549.1.1.11�1.2.840.113549.1.1.12�1.2.840.113549.1.1.13�1.2.840.113549.1.1.14�
1.3.14.3.2.26�2.16.840.1.101.3.4.2.4�2.16.840.1.101.3.4.2.1�2.16.840.1.101.3.4.2.2�2.16.840.1.101.3.4.2.3c��|jdk(r,|dj}||jvr|j|S|dj|jvrt
Sy)N�rrr)�	_oid_pair�native�
_oid_specs�dotted�_null_algosr)�self�algos  r�_parameters_specz%_ForceNullParameters._parameters_specJs[���>�>�8�8���$�+�+�D��t���&����t�,�,����#�#�t�'7�'7�7��K�rrc����tt|�||�}|dk7r|S|dj|jvr|S|dj
tk7r|St�|d<|S)Nrr)�superr!�__setitem__r1r2�	__class__rr)r3�key�value�resr9s    �rr8z _ForceNullParameters.__setitem___sk����(�$�;�C��G���+���J����#�#�4�+;�+;�;��J����'�'�4�/��J�!�V��\���
r)
rrr�__doc__�setr2r5�_spec_callbacksr8�
__classcell__)r9s@rr!r!2s7�������K�	�	�&��O�	�	rr!c
�*�eZdZddddddddd	d
ddd
�Zy)�HmacAlgorithmId�des_mac�sha1�sha224�sha256�sha384�sha512�
sha512_224�
sha512_256�sha3_224�sha3_256�sha3_384�sha3_512)z
1.3.14.3.2.10z1.2.840.113549.2.7z1.2.840.113549.2.8z1.2.840.113549.2.9z1.2.840.113549.2.10z1.2.840.113549.2.11z1.2.840.113549.2.12z1.2.840.113549.2.13z2.16.840.1.101.3.4.2.13z2.16.840.1.101.3.4.2.14z2.16.840.1.101.3.4.2.15z2.16.840.1.101.3.4.2.16N�rrr�_maprrrrBrBks-��"�$�&�&�'�'�+�+�#-�#-�#-�#-�
�DrrBc�"�eZdZdefdeddifgZy)�
HmacAlgorithmrrrTN)rrrrBrrrrrrRrR|s ��	�o�&�	�s�Z��.�/��GrrRc�v�eZdZidd�dd�dd�dd�d	d
�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�Zy#)$�DigestAlgorithmIdz1.2.840.113549.2.2�md2z1.2.840.113549.2.5�md5r'rDr(rEr)rFr*rGr+rHz2.16.840.1.101.3.4.2.5rIz2.16.840.1.101.3.4.2.6rJz2.16.840.1.101.3.4.2.7rKz2.16.840.1.101.3.4.2.8rLz2.16.840.1.101.3.4.2.9rMz2.16.840.1.101.3.4.2.10rNz2.16.840.1.101.3.4.2.11�shake128z2.16.840.1.101.3.4.2.12�shake256z2.16.840.1.101.3.4.2.17�shake128_lenz2.16.840.1.101.3.4.2.18�shake256_lenNrOrrrrTrT�s�����e���e��	���	!�(�	�
	!�(��	!�(�
�	!�(��	!�,��	!�,��	!�*��	!�*��	!�*��	"�:��	"�:��	"�:�� 	"�>�!�"	"�>�#�DrrTc�"�eZdZdefdeddifgZy)�DigestAlgorithmrrrTN)rrrrTrrrrrr\r\�s!��	�'�(�	�s�Z��.�/��Grr\c��eZdZdefdefgZy)�
DigestInfo�digest_algorithm�digestN)rrrr\rrrrrr^r^�s��	�_�-�	�;���Grr^c��eZdZddiZy)�MaskGenAlgorithmIdz1.2.840.113549.1.1.8�mgf1NrOrrrrbrb�s�����Drrbc�.�eZdZdefdeddifgZdZdeiZy)�MaskGenAlgorithmrrrTr-rcN)	rrrrbrrr.r\r0rrrrere�s4��	�(�)�	�s�Z��.�/��G�
,�I����Jrrec��eZdZddiZy)�TrailerFieldr�trailer_field_bcNrOrrrrgrg�s��	���Drrgc�V�eZdZdedddid�fdeddddid	�d�fd
eddd�fd
eddd�fgZy)�RSASSAPSSParams�hash_algorithmrrrD��explicit�default�mask_gen_algorithmrrcr-�salt_length���
trailer_field�rhN)rrrr\rerrgrrrrrjrj�s{��
���'��0�
�	
�
!���!'�#.��"7��
�
	
�
����
�	
�
���-�
�	
�9$�Grrjc��eZdZidd�dd�dd�dd�dd�d	d�d
d�dd
�dd�dd�dd�dd�dd�dd�dd�dd�dd�ddd d!d"d#d$d%d&d'd(d)d*d+�
�Zid'd,�d(d-�dd�dd�d&d.�dd�dd�dd�dd	�dd�dd/�dd
�dd�dd0�d
d�d d1�dd�d2dd3d4d5d6d7d8d9��Zy:);�SignedDigestAlgorithmIdz1.3.14.3.2.3�md5_rsaz
1.3.14.3.2.29�sha1_rsaz1.3.14.7.2.3.1�md2_rsaz1.2.840.113549.1.1.2z1.2.840.113549.1.1.4z1.2.840.113549.1.1.5r&�
sha224_rsar#�
sha256_rsar$�
sha384_rsar%�
sha512_rsaz1.2.840.113549.1.1.10�
rsassa_pssz1.2.840.10040.4.3�sha1_dsaz
1.3.14.3.2.13z
1.3.14.3.2.27z2.16.840.1.101.3.4.3.1�
sha224_dsaz2.16.840.1.101.3.4.3.2�
sha256_dsaz1.2.840.10045.4.1�
sha1_ecdsa�sha224_ecdsa�sha256_ecdsa�sha384_ecdsa�sha512_ecdsa�sha3_224_ecdsa�sha3_256_ecdsa�sha3_384_ecdsa�sha3_512_ecdsa�rsassa_pkcs1v15�dsa�ecdsa�ed25519�ed448)
�1.2.840.10045.4.3.1�1.2.840.10045.4.3.2�1.2.840.10045.4.3.3�1.2.840.10045.4.3.4�2.16.840.1.101.3.4.3.9�2.16.840.1.101.3.4.3.10�2.16.840.1.101.3.4.3.11�2.16.840.1.101.3.4.3.12r"�1.2.840.10040.4.1�1.2.840.10045.4�1.3.101.112�1.3.101.113r�r�r"r�r�r�r�r�r�r�r�r�r�)r�r}r�r�r�r�r�r�N)rrrrP�_reverse_maprrrrvrv�s��!��	�!���!�	�)�!�	�	�	!�
	�	�!�	�
�
!�	 ��!�	 ��!�	 ��!�	 ��!�	 ��!�	�Z�!�	��!�	��!�	!�,�!� 	!�,�!!�"	�\�#!�$ .�-�-�-�"2�#3�#3�#3� 1�"�"� ��A!�D�F�
�"���"��	�)��	�)�	�
	�1��	�-�
�	�'��	�)��	�*��	�.��	�-��	�-��	�.��	�-��	�-�� 	�-�!�"	�-�#�$.�-�2�3�3�3� ��3�Lrrvc�N�eZdZdefdeddifgZdZdeiZe	d��Z
e	d��Zy	)
�SignedDigestAlgorithmrrrTr-r~c
���|dj}idd�dd�dd�dd�dd�dd�d	d�dd�d
d
�dd�d
d�dd�dd�dd�dd�dd�dd�ddddddddd��}||vr||Sttd|���)z�
        :return:
            A unicode string of "rsassa_pkcs1v15", "rsassa_pss", "dsa",
            "ecdsa", "ed25519" or "ed448"
        rryr�rwrxrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�)r�r�r�r�r�r�r�r�z>
            Signature algorithm not known for %s
            �r/�
ValueErrorr�r3r�algo_maps   r�signature_algoz$SignedDigestAlgorithm.signature_algo4s=����%�,�,�	�
��(�
��(�
�
�)�
�
�+�	
�

�+�
�
�+�

�
�+�
�
�0�
�
�,�
�
��
�
�%�
�
�%�
�
�5�
�
�'�
�
�G�
� 
�G�!
�"
�G�#
�$$�%�%�%�%�� ��3
��6�� ��I�&�&���
�
�	
��	rc��|dj}idd�dd�dd�dd	�d
d�dd
�dd�dd�dd	�dd�dd�dd	�dd�dd
�dd�dd�dd�}||vr||S|dk(r|dddjSttd|���)z�
        :return:
            A unicode string of "md2", "md5", "sha1", "sha224", "sha256",
            "sha384", "sha512", "sha512_224", "sha512_256" or "shake256"
        rryrUrwrVrxrDrzrEr{rFr|rGr}rHrr�r�r�r�r�r�r�r�r�rXr~rrkz9
            Hash algorithm not known for %s
            r�r�s   r�	hash_algozSignedDigestAlgorithm.hash_algocs:����%�,�,�	�
��u�
��u�
�
��
�
�(�	
�

�(�
�
�(�

�
�(�
�
��
�
�(�
�
�(�
�
�&�
�
�H�
�
�H�
�
�H�
�
�H�
� 
�x�!
�"
�Z�#
��&�� ��I�&�&���$���%�&6�7��D�K�K�K���
�
�	
��	rN)rrrrvrrr.rjr0�propertyr�r�rrrr�r�)s]��	�-�.�	�s�Z��.�/��G�
,�I��o��J��,��,�\�'��'rr�c��eZdZdefdefgZy)�
Pbkdf2Salt�	specified�other_sourceN)rrrrr�
_alternativesrrrr�r��s��	�k�"�	�,�-��Mrr�c�8�eZdZdefdefdeddifdeddd	iifgZy
)�Pbkdf2Params�salt�iteration_count�
key_lengthrT�prfrnrrDN)rrrr�rrRrrrrr�r��s<��	���	�G�$�	�w��T� 2�3�	�
�	�K��+@�A�B�	�Grr�c��eZdZddiZy)�KdfAlgorithmIdz1.2.840.113549.1.5.12�pbkdf2NrOrrrr�r��������Drr�c�.�eZdZdefdeddifgZdZdeiZy)�KdfAlgorithmrrrTr-r�N)	rrrr�rrr.r�r0rrrr�r��s3��	�n�%�	�s�Z��.�/��G�,�I��,��Jrr�c�,�eZdZdZdefdefdeddifgZy)�DHParameterszn
    Original Name: DHParameter
    Source: ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-3.asc section 9
    �p�g�private_value_lengthrTN)rrrr=rrrrrr�r��s-���

�g��	�g��	��:�t�*<�=��Grr�c��eZdZddiZy)�KeyExchangeAlgorithmIdz1.2.840.113549.1.3.1�dhNrOrrrr�r��s�����Drr�c�.�eZdZdefdeddifgZdZdeiZy)�KeyExchangeAlgorithmrrrTr-r�N)	rrrr�rrr.r�r0rrrr�r��s4��	�,�-�	�s�Z��.�/��G�,�I��l��Jrr�c�"�eZdZdeddifdefgZy)�	Rc2Params�rc2_parameter_versionrT�ivN)rrrrrrrrrr�r��s ��	 �'�J��+=�>�	
�{���Grr�c��eZdZddiZy)�Rc5ParamVersion�zv1-0NrOrrrr�r��s��
�F��Drr�c�.�eZdZdefdefdefdeddifgZy)�	Rc5Params�version�rounds�block_size_in_bitsr�rTN)rrrr�rrrrrrr�r��s0��	�O�$�	�7��	�w�'�	
�{�Z��.�/�	�Grr�c��eZdZdefdefgZy)�Pbes1Paramsr��
iterationsN�rrrrrrrrrr�r��s��	���	�w���Grr�c��eZdZdefdefgZy)�	CcmParams�	aes_nonce�
aes_icvlenNr�rrrr�r��s��
�k�"�	�w���Grr�c��eZdZddiZy)�PSourceAlgorithmIdz1.2.840.113549.1.1.9�p_specifiedNrOrrrr�r��s���
��Drr�c�.�eZdZdefdeddifgZdZdeiZy)�PSourceAlgorithmrrrTr-r�N)	rrrr�rrr.rr0rrrr�r��s4��	�(�)�	�s�Z��.�/��G�
,�I��{��Jrr�c�N�eZdZdedddid�fdeddddid	�d�fd
eddd
d	�d�fgZy)�RSAESOAEPParamsrkrrrDrlrorrcr-�p_source_algorithmrqr�rN)rrrr\rer�rrrrr�r�sk��
���'��0�
�	
�
!���!'�#.��"7��
�
	
�
!���!.�"%��
�
	
�)�Grr�c�6�eZdZdZdefdefgZed��Zd�Zy)�DSASignaturea

    An ASN.1 class for translating between the OS crypto library's
    representation of an (EC)DSA signature and the ASN.1 structure that is part
    of various RFCs.

    Original Name: DSS-Sig-Value
    Source: https://tools.ietf.org/html/rfc3279#section-2.2.2
    �r�sc��t|dt|�dz�}t|t|�dzd�}|||d��S)a
        Reads a signature from a byte string encoding accordint to IEEE P1363,
        which is used by Microsoft's BCryptSignHash() function.

        :param data:
            A byte string from BCryptSignHash()

        :return:
            A DSASignature object
        rrqN)r�r�)r
�len)�cls�datar�r�s    r�
from_p1363zDSASignature.from_p13637sF��
�4��#�d�)�q�.�1�2���4��D�	�Q���0�1�����#�$�$rc���t|dj�}t|dj�}tt|�t|��}t	||�}t	||�}||zS)z�
        Dumps a signature to a byte string compatible with Microsoft's
        BCryptVerifySignature() function.

        :return:
            A byte string compatible with BCryptVerifySignature()
        r�r�)rr/�maxr�r	)r3�r_bytes�s_bytes�int_byte_lengths    r�to_p1363zDSASignature.to_p1363Hsc���t�C�y�/�/�0���t�C�y�/�/�0���c�'�l�C��L�9���W�o�6���W�o�6���� � rN)	rrrr=rr�classmethodr�r�rrrr�r�(s7���

�g��	�g���G�
�%��%� !rr�c��eZdZidd�dd�dd�dd�d	d
�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�id#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d7d8�d9d:�d;d<�d=d>�d?d@�dAdB�dCdD��dEdFdGdHdIdJdKdLdMdNdO�
�ZyP)Q�EncryptionAlgorithmIdz1.3.14.3.2.7�desz1.2.840.113549.3.7�tripledes_3keyz1.2.840.113549.3.2�rc2z1.2.840.113549.3.4�rc4z1.2.840.113549.3.9�rc5z2.16.840.1.101.3.4.1.1�
aes128_ecbz2.16.840.1.101.3.4.1.2�
aes128_cbcz2.16.840.1.101.3.4.1.3�
aes128_ofbz2.16.840.1.101.3.4.1.4�
aes128_cfbz2.16.840.1.101.3.4.1.5�aes128_wrapz2.16.840.1.101.3.4.1.6�
aes128_gcmz2.16.840.1.101.3.4.1.7�
aes128_ccmz2.16.840.1.101.3.4.1.8�aes128_wrap_padz2.16.840.1.101.3.4.1.21�
aes192_ecbz2.16.840.1.101.3.4.1.22�
aes192_cbcz2.16.840.1.101.3.4.1.23�
aes192_ofbz2.16.840.1.101.3.4.1.24�
aes192_cfbz2.16.840.1.101.3.4.1.25�aes192_wrapz2.16.840.1.101.3.4.1.26�
aes192_gcmz2.16.840.1.101.3.4.1.27�
aes192_ccmz2.16.840.1.101.3.4.1.28�aes192_wrap_padz2.16.840.1.101.3.4.1.41�
aes256_ecbz2.16.840.1.101.3.4.1.42�
aes256_cbcz2.16.840.1.101.3.4.1.43�
aes256_ofbz2.16.840.1.101.3.4.1.44�
aes256_cfbz2.16.840.1.101.3.4.1.45�aes256_wrapz2.16.840.1.101.3.4.1.46�
aes256_gcmz2.16.840.1.101.3.4.1.47�
aes256_ccmz2.16.840.1.101.3.4.1.48�aes256_wrap_padz1.2.840.113549.1.5.13�pbes2z1.2.840.113549.1.5.1�
pbes1_md2_desz1.2.840.113549.1.5.3�
pbes1_md5_desz1.2.840.113549.1.5.4�
pbes1_md2_rc2z1.2.840.113549.1.5.6�
pbes1_md5_rc2�pbes1_sha1_des�pbes1_sha1_rc2�pkcs12_sha1_rc4_128�pkcs12_sha1_rc4_40�pkcs12_sha1_tripledes_3key�pkcs12_sha1_tripledes_2key�pkcs12_sha1_rc2_128�pkcs12_sha1_rc2_40�rsaes_pkcs1v15�
rsaes_oaep)
z1.2.840.113549.1.5.10z1.2.840.113549.1.5.11z1.2.840.113549.1.12.1.1z1.2.840.113549.1.12.1.2z1.2.840.113549.1.12.1.3z1.2.840.113549.1.12.1.4z1.2.840.113549.1.12.1.5z1.2.840.113549.1.12.1.6r"z1.2.840.113549.1.1.7NrOrrrr�r�[s���1���1��.�1�	�e�1�	�e�	1�
	�e�1�	!�,�1�	!�,�1�	!�,�1�	!�,�1�	!�-�1�	!�,�1�	!�,�1�	!�"3�1�	"�<�1� 	"�<�!1�"	"�<�#1�$	"�<�%1�&	"�=�'1�(	"�<�)1�*	"�<�+1�,	"�#4�-1�.	"�<�/1�0	"�<�11�2	"�<�31�4	"�<�51�6	"�=�71�8	"�<�91�:	"�<�;1�<	"�#4�=1�@	 ��A1�B	��C1�D	��E1�F	��G1�H	��I1�J"2�!1�#8�#7�#?�#?�#8�#7� 0� ,�a1�Drr�c�8�eZdZdefdeddifgZdZide�de�de�d	e	�d
e�de�de�d
e�de�de�de
�de
�de
�de�de�de�de�eeeeeeeeed�	�Z
ed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed ��Zy!)"�EncryptionAlgorithmrrrTr-r�r�r�r�r�r�rr�rrr�rrrrrr)	rrrrrrrrrc�:�|dj}|dk(r|dddjS|jd�dk(rJ|jd�dk7r!|jdd�\}}|d	k(ry
|dk(rytt	d
|���tt	d|���)z�
        Returns the name of the key derivation function to use.

        :return:
            A unicode from of one of the following: "pbkdf1", "pbkdf2",
            "pkcs12_kdf"
        rrr�key_derivation_func�.����_r�pbes1�pbkdf1�pkcs12�
pkcs12_kdf�~
                Encryption algorithm "%s" does not have a registered key
                derivation function
                zw
            Unrecognized encryption algorithm "%s", can not determine key
            derivation function
            �r/�find�splitr�r)r3�encryption_algor#s   r�kdfzEncryptionAlgorithm.kdf�s����{�+�2�2���g�%���%�&;�<�[�I�P�P�P�����$��*��#�#�C�(�B�.�%4�%:�%:�3��%B�"���"�g�-�#�"�h�.�'��V�� ���
���
�
�
��	rc�4�|dj}|dk(r|dddddjS|jd�dk(rA|jd�dk7r|jdd	�\}}}|Stt	d
|���tt	d|���)z�
        Returns the HMAC algorithm to use with the KDF.

        :return:
            A unicode string of one of the following: "md2", "md5", "sha1",
            "sha224", "sha256", "sha384", "sha512"
        rrrr r�r!r"r#rqr(z}
            Unrecognized encryption algorithm "%s", can not determine key
            derivation hmac algorithm
            r))r3r,r#�	hmac_algos    r�kdf_hmaczEncryptionAlgorithm.kdf_hmac�s����{�+�2�2���g�%���%�&;�<�\�J�5�Q�R]�^�e�e�e�����$��*��#�#�C�(�B�.�"1�"7�"7��Q�"?���9�a� � ��V�� ���
���
�
�
��	rc�l�|dj}|dk(r=|dddd}|jdk(rttd���|jS|j	d�d	k(r;|j	d
�d	k7r|ddjSttd|���ttd|���)
zu
        Returns the byte string to use as the salt for the KDF.

        :return:
            A byte string
        rrrr r�r�z�
                    Can not determine key derivation salt - the
                    reserved-for-future-use other source salt choice was
                    specified in the PBKDF2 params structure
                    r!r"r#r(zs
            Unrecognized encryption algorithm "%s", can not determine key
            derivation salt
            )r/�namer�rr*)r3r,r�s   r�kdf_saltzEncryptionAlgorithm.kdf_salts����{�+�2�2���g�%���%�&;�<�\�J�6�R�D��y�y�N�*� ���"����;�;������$��*��#�#�C�(�B�.��L�)�&�1�8�8�8��V�� ���
���
�
�
��	rc�"�|dj}|dk(r|ddddjS|jd�dk(r;|jd�dk7r|dd	jSttd
|���ttd|���)z{
        Returns the number of iterations that should be run via the KDF.

        :return:
            An integer
        rrrr r�r!r"r#r�r(zy
            Unrecognized encryption algorithm "%s", can not determine key
            derivation iterations
            )r/r*r�r�r3r,s  r�kdf_iterationsz"EncryptionAlgorithm.kdf_iterations2s����{�+�2�2���g�%���%�&;�<�\�J�K\�]�d�d�d�����$��*��#�#�C�(�B�.��L�)�,�7�>�>�>��V�� ���
���
�
�
��	rc
���|dj}|dddk(rdddd�|dd	Sd
dd�}||vr||S|dk(r?|d
dj}dd
dd�}||vr||S|dk\r|S|�yttd���|dk(r.|d
dd
dj}|�|S|d
djS|j	d�dk(rd
d
d
d
d
d
ddddddd�|Sttd|���)a�
        Returns the key length to pass to the cipher/kdf. The PKCS#5 spec does
        not specify a way to store the RC5 key length, however this tends not
        to be a problem since OpenSSL does not support RC5 in PKCS#8 and OS X
        does not provide an RC5 cipher for use in the Security Transforms
        library.

        :raises:
            ValueError - when the key length can not be determined

        :return:
            An integer representing the length in bytes
        rrrt�aesr��� ��aes128_�aes192_�aes256_��)r�r�r�rr��)��x�:��zw
                Invalid RC2 parameter version found in EncryptionAlgorithm
                parameters
                rr r��encryption_schemer!r"�rrrrrrrrrrrr�@
            Unrecognized encryption algorithm "%s"
            )r/r�rr�r*)r3r,�cipher_lengthsr��encoded_key_bits_mapr�s      rr�zEncryptionAlgorithm.key_lengthTs��� �{�+�2�2���1�Q��5�(������a��"�	$�
$�� �
��
�n�,�!�/�2�2��e�#�$(��$6�7N�$O�$V�$V�!�
���$� �%�(<�<�+�,A�B�B�$��+�,�,�$�,���V����
��g�%��l�+�,A�B�<�P�Q]�^�e�e�J��%�!�!���%�&9�:�E�E�E�����$��*�!"�!"�!"�!"�"#�"#�')�&'�.0�.0�')�&'�
��
�

���
�
�	
��	rc���|dj}|ddtgd��vr|ddS|dddk(ry|ddd	k(ry|tgd
��vry|dk(r|dd
jStt	d|���)z�
        Returns the name of the encryption mode to use.

        :return:
            A unicode string from one of the following: "cbc", "ecb", "ofb",
            "cfb", "wrap", "gcm", "ccm", "wrap_pad"
        rrr?r;N��pbes1_�cbc�pkcs12_)r�r�r�r�rrrGrI)r/r>�encryption_moder�rr5s  rrQz#EncryptionAlgorithm.encryption_mode�s����{�+�2�2���1�Q��3�'H�#I�I�"�1�2�&�&��1�Q��8�+���1�Q��9�,���c�"I�J�J���g�%���%�&9�:�J�J�J���
�
�	
��	rc
��|dj}|ddtgd��vry|tgd��vr|S|dk(ry|d	k(r|d
djS|jd�d
k(rddddddddddddd�|St	td|���)al
        Returns the name of the symmetric encryption cipher to use. The key
        length can be retrieved via the .key_length property to disabiguate
        between different variations of TripleDES, AES, and the RC* ciphers.

        :return:
            A unicode string from one of the following: "rc2", "rc5", "des",
            "tripledes", "aes"
        rrr?r;r8)r�r�r�r��	tripledesrrrGr!r"r�r�r�rHrI)r/r>�encryption_cipherr*r�rr5s  rrTz%EncryptionAlgorithm.encryption_cipher�s����{�+�2�2���1�Q��3�'H�#I�I���c�"7�8�8�"�"��.�.���g�%���%�&9�:�L�L�L�����$��*�!&�!&�!&�!&�"'�"'�',�&+�.9�.9�',�&+�
��
�

���
�
�	
��	rc
�<�|dj}|ddtgd��vrydddd�}||vr||S|dk(r|d	d
jdzS|dk(r|d	djS|jd
�dk(rddddddddddddd�|St	td|���)z�
        Returns the block size of the encryption cipher, in bytes.

        :return:
            An integer that is the block size in bytes
        rrr?r;r�r@)r�r�r�r�rr�rrGr!r"rHrI)r/r>�encryption_block_sizer*r�r)r3r,�
cipher_maps   rrVz)EncryptionAlgorithm.encryption_block_sizes���{�+�2�2���1�Q��3�'H�#I�I�����
�
�
�j�(��o�.�.��e�#���%�&:�;�B�B�a�G�G��g�%���%�&9�:�P�P�P�����$��*�!"�!"�!"�!"�"#�"#�'(�&'�./�./�'(�&'�
��
�

���
�
�	
��	rc�$�|dj}|tddg�vr|ddjStgd��}||vr|djS|dk(r|ddjS|jd	�d
k(ryt	td|���)
a
        Returns the byte string of the initialization vector for the encryption
        scheme. Only the PBES2 stores the IV in the params. For PBES1, the IV
        is derived from the KDF and this property will return None.

        :return:
            A byte string or None
        rr�r�rr�)r�r�r�r�rr�rrrrGr!r"NrI)r/r>�
encryption_ivr*r�r)r3r,�octet_string_iv_oidss   rrYz!EncryptionAlgorithm.encryption_iv9s����{�+�2�2���c�5�%�.�1�1���%�d�+�2�2�2� #�	$
�	 ���2�2���%�,�,�,��g�%���%�&9�:�H�H�H�����$��*����
�
�	
��	rN)rrrr�rrr.rr�r�r�r�r�r0r�r-r0r3r6r�rQrTrVrYrrrrr�s���	�+�,�	�s�Z��.�/��G�
,�I��
�{���+��	�y��	�y�	�
	�k��	�k�
�	�k��	�k��	�k��	�k��	�i��	�i��	�i�� 	��!�"	��#�$	��%�&	��'�(&�%�*�)�&1�&1�*�)�%�=�J�B�&��&�P�!��!�F�*��*�X����B�\��\�|����B�.��.�`�0��0�d�-��-rrc��eZdZdefdefgZy)�Pbes2Paramsr rGN)rrrr�rrrrrr\r\js��	��-�	�1�2��Grr\c��eZdZdefdefgZy)�Pbmac1Paramsr �message_auth_schemeN)rrrr�rRrrrrr^r^qs��	��-�	�
�.��Grr^c��eZdZddiZy)�
Pkcs5MacIdz1.2.840.113549.1.5.14�pbmac1NrOrrrraraxr�rrac�(�eZdZdefdefgZdZdeiZy)�Pkcs5MacAlgorithmrrr-rbN)	rrrrarrr.r^r0rrrrdrd~s,��	�j�!�	�s���G�
,�I��,��Jrrdrc��eZdZiZd�Zy)�AnyAlgorithmIdc��|jj}tttfD])}|jj�D]
\}}|||<��+y�N)r9rPr�rvrT�items)r3rP�	other_cls�oidr2s     r�_setupzAnyAlgorithmId._setup�sI���~�~�"�"��/�1H�J[�\�I�&�^�^�1�1�3�	��T� ��S�	�4�]rN)rrrrPrlrrrrfrf�s��
�D�!rrfc�0�eZdZdefdeddifgZdZiZd�Zy)�AnyAlgorithmIdentifierrrrTr-c���tj|�|jj}tt
fD])}|jj
�D]
\}}|||<��+yrh)rrlr9r0rr�ri)r3�specsrjrk�specs     rrlzAnyAlgorithmIdentifier._setup�sT����������)�)��-�/D�E�I�&�1�1�7�7�9�	��T�!��c�
�:�FrN)	rrrrfrrr.r0rlrrrrnrn�s1��	�n�%�	�s�Z��.�/��G�
,�I��J�"rrnN)=r=�
__future__rrrr�_errorsr�_intr	�utilr
r�corerr
rrrrrrr�objectr!rBrRrTr\r^rbrergrjrvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr\r^rardr0rfrnrrr�<module>rxs���$S�R���.�	�	�	�"�(��6�6�6�r�&��"�H���(��,�*�H������)��	�x�	��7��%�h�%�P>�.�>�Bb�0�(�b�J����8���%���8��
�8�
��-���8������g������(������)��	�x�	� �h� �F0!�8�0!�f2�,�2�jW�.��W�t�(���8���!��	��	�+6����w�'�!�%�!�"�1�8�"r

XYZEAZ - Cyber Alpha Wolf © All Rights Reserved