| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/Cryptodome/Cipher/__pycache__/ |
Upload File : |
�
8�tc�8 � � � d Z dgZddlZddlmZ ddlmZmZmZ ddl m
Z
ddlmZ ddl
mZmZ dd lmZmZ dd
lmZ G d� de� � Zd� ZdS )
z
EAX mode.
�EaxMode� N)� unhexlify)�byte_string�bord�_copy_bytes)� is_buffer)�strxor)�
long_to_bytes�
bytes_to_long)�CMAC�BLAKE2s)�get_random_bytesc �V � e Zd ZdZd� Zd� Zd
d�Zd
d�Zd� Zd� Z d � Z
d
� Zd
d�Zd
d�Z
dS )r a� *EAX* mode.
This is an Authenticated Encryption with Associated Data
(`AEAD`_) mode. It provides both confidentiality and authenticity.
The header of the message may be left in the clear, if needed,
and it will still be subject to authentication.
The decryption step tells the receiver if the message comes
from a source that really knowns the secret key.
Additionally, decryption detects if any part of the message -
including the header - has been modified or corrupted.
This mode requires a *nonce*.
This mode is only available for ciphers that operate on 64 or
128 bits blocks.
There are no official standards defining EAX.
The implementation is based on `a proposal`__ that
was presented to NIST.
.. _AEAD: http://blog.cryptographyengineering.com/2012/05/how-to-choose-authenticated-encryption.html
.. __: http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/eax/eax-spec.pdf
:undocumented: __init__
c �� � ���� �j � _ t dd|� � � _ |� _ d� _ � j � j � j � j � j g� _
d� j cxk r� j k sn t d� j z � � �t � j � � dk rt d� � �t |� � st d� � ����� fd�t dd� � D � � � _ � j d � � j � � � j d � _ t% � j d � � � � � } �j ��j f|d
d����� _ dS )zEAX cipher modeN� z.Parameter 'mac_len' must not be larger than %dr z!Nonce cannot be empty in EAX modez,nonce must be bytes, bytearray or memoryviewc
� �� g | ];}t j �d �j dz
z t j d|� � z ���� � ��<S )� � �B)� ciphermod�
cipher_params)r �new�
block_size�struct�pack)�.0�ir �factory�key�selfs �����=/usr/lib/python3/dist-packages/Cryptodome/Cipher/_mode_eax.py�
<listcomp>z$EaxMode.__init__.<locals>.<listcomp>k sd �� � � � �
� ��� �D�O�a�$7�8�6�;�s�A�;N�;N�N�#*�'4�6� 6� 6�� � � � r r# )�
initial_value�nonce)r r r&