§
    m:Rfu   ã                   ór   — d Z dgZddlmZmZmZmZmZmZm	Z	m
Z
  edd¦  «        Z G d„ de¦  «        Zd„ ZdS )	z"
Electronic Code Book (ECB) mode.
ÚEcbModeé    )Úload_pycryptodome_raw_libÚVoidPointerÚcreate_string_bufferÚget_raw_bufferÚSmartPointerÚc_size_tÚc_uint8_ptrÚis_writeable_bufferzCrypto.Cipher._raw_ecbak  
                    int ECB_start_operation(void *cipher,
                                            void **pResult);
                    int ECB_encrypt(void *ecbState,
                                    const uint8_t *in,
                                    uint8_t *out,
                                    size_t data_len);
                    int ECB_decrypt(void *ecbState,
                                    const uint8_t *in,
                                    uint8_t *out,
                                    size_t data_len);
                    int ECB_stop_operation(void *state);
                    c                   ó(   — e Zd ZdZd„ Zdd„Zdd„ZdS )r   aó  *Electronic Code Book (ECB)*.

    This is the simplest encryption mode. Each of the plaintext blocks
    is directly encrypted into a ciphertext block, independently of
    any other block.

    This mode is dangerous because it exposes frequency of symbols
    in your plaintext. Other modes (e.g. *CBC*) should be used instead.

    See `NIST SP800-38A`_ , Section 6.1.

    .. _`NIST SP800-38A` : http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf

    :undocumented: __init__
    c                 óˆ  — |j         | _         t          ¦   «         | _        t                               |                     ¦   «         | j                             ¦   «         ¦  «        }|rt          d|z  ¦  «        ‚t          | j                             ¦   «         t          j	        ¦  «        | _        | 
                    ¦   «          dS )z¸Create a new block cipher, configured in ECB mode.

        :Parameters:
          block_cipher : C pointer
            A smart pointer to the low-level block cipher instance.
        z)Error %d while instantiating the ECB modeN)Ú
block_sizer   Ú_stateÚraw_ecb_libÚECB_start_operationÚgetÚ
address_ofÚ
ValueErrorr   ÚECB_stop_operationÚrelease)ÚselfÚblock_cipherÚresults      úJ/var/www/bsim/venv/lib/python3.11/site-packages/Crypto/Cipher/_mode_ecb.pyÚ__init__zEcbMode.__init__D   s·   € ð 'Ô1ˆŒå!‘m”mˆŒÝ×0Ò0°×1AÒ1AÑ1CÔ1CØ15´×1GÒ1GÑ1IÔ1IñKô Kˆàð 	'ÝÐHØ%ñ&ñ 'ô 'ð 'õ # 4¤;§?¢?Ñ#4Ô#4Ý#.Ô#AñCô CˆŒð
 	×ÒÑÔÐÐÐó    Nc           
      óF  — |€t          t          |¦  «        ¦  «        }n_|}t          |¦  «        st          d¦  «        ‚t          |¦  «        t          |¦  «        k    rt	          dt          |¦  «        z  ¦  «        ‚t
                               | j                             ¦   «         t          |¦  «        t          |¦  «        t          t          |¦  «        ¦  «        ¦  «        }|r'|dk    rt	          d¦  «        ‚t	          d|z  ¦  «        ‚|€t          |¦  «        S dS )ab  Encrypt data with the key set at initialization.

        The data to encrypt can be broken up in two or
        more pieces and `encrypt` can be called multiple times.

        That is, the statement:

            >>> c.encrypt(a) + c.encrypt(b)

        is equivalent to:

             >>> c.encrypt(a+b)

        This function does not add any padding to the plaintext.

        :Parameters:
          plaintext : bytes/bytearray/memoryview
            The piece of data to encrypt.
            The length must be multiple of the cipher block length.
        :Keywords:
          output : bytearray/memoryview
            The location where the ciphertext must be written to.
            If ``None``, the ciphertext is returned.
        :Return:
          If ``output`` is ``None``, the ciphertext is returned as ``bytes``.
          Otherwise, ``None``.
        Nú4output must be a bytearray or a writeable memoryviewú9output must have the same length as the input  (%d bytes)é   ú2Data must be aligned to block boundary in ECB modez%Error %d while encrypting in ECB mode)r   Úlenr   Ú	TypeErrorr   r   ÚECB_encryptr   r   r
   r	   r   )r   Ú	plaintextÚoutputÚ
ciphertextr   s        r   ÚencryptzEcbMode.encrypt^   s   € ð: ˆ>Ý-­c°)©n¬nÑ=Ô=ˆJˆJàˆJå& vÑ.Ô.ð XÝÐ VÑWÔWÐWå�9‰~Œ~¥ V¡¤Ò,Ð,Ý ð "0Ý25°i±.´.ñ"Añ Bô Bð Bõ ×(Ò(¨¬¯ªÑ):Ô):Ý)4°YÑ)?Ô)?Ý)4°ZÑ)@Ô)@Ý)1µ#°i±.´.Ñ)AÔ)AñCô Cˆð ð 	OØ˜Š{ˆ{Ý Ð!UÑVÔVÐVÝÐDÀvÑMÑNÔNÐNàˆ>Ý! *Ñ-Ô-Ð-à�4r   c           
      óF  — |€t          t          |¦  «        ¦  «        }n_|}t          |¦  «        st          d¦  «        ‚t          |¦  «        t          |¦  «        k    rt	          dt          |¦  «        z  ¦  «        ‚t
                               | j                             ¦   «         t          |¦  «        t          |¦  «        t          t          |¦  «        ¦  «        ¦  «        }|r'|dk    rt	          d¦  «        ‚t	          d|z  ¦  «        ‚|€t          |¦  «        S dS )ae  Decrypt data with the key set at initialization.

        The data to decrypt can be broken up in two or
        more pieces and `decrypt` can be called multiple times.

        That is, the statement:

            >>> c.decrypt(a) + c.decrypt(b)

        is equivalent to:

             >>> c.decrypt(a+b)

        This function does not remove any padding from the plaintext.

        :Parameters:
          ciphertext : bytes/bytearray/memoryview
            The piece of data to decrypt.
            The length must be multiple of the cipher block length.
        :Keywords:
          output : bytearray/memoryview
            The location where the plaintext must be written to.
            If ``None``, the plaintext is returned.
        :Return:
          If ``output`` is ``None``, the plaintext is returned as ``bytes``.
          Otherwise, ``None``.
        Nr   r   r    r!   z%Error %d while decrypting in ECB mode)r   r"   r   r#   r   r   ÚECB_decryptr   r   r
   r	   r   )r   r'   r&   r%   r   s        r   ÚdecryptzEcbMode.decrypt•   s   € ð: ˆ>Ý,­S°©_¬_Ñ=Ô=ˆIˆIàˆIå& vÑ.Ô.ð XÝÐ VÑWÔWÐWå�:‰Œ¥# f¡+¤+Ò-Ð-Ý ð "0Ý25°i±.´.ñ"Añ Bô Bð Bõ ×(Ò(¨¬¯ªÑ):Ô):Ý)4°ZÑ)@Ô)@Ý)4°YÑ)?Ô)?Ý)1µ#°j±/´/Ñ)BÔ)BñDô Dˆð ð 	OØ˜Š{ˆ{Ý Ð!UÑVÔVÐVÝÐDÀvÑMÑNÔNÐNàˆ>Ý! )Ñ,Ô,Ð,à�4r   )N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r(   r+   © r   r   r   r   3   sV   € € € € € ðð ð ð ð ð45ð 5ð 5ð 5ðn5ð 5ð 5ð 5ð 5ð 5r   c                 ó¤   — |                       |¦  «        }| j        |_        |rt          dt          |¦  «        z  ¦  «        ‚t	          |¦  «        S )aM  Instantiate a cipher object that performs ECB encryption/decryption.

    :Parameters:
      factory : module
        The underlying block cipher, a module from ``Crypto.Cipher``.

    All keywords are passed to the underlying block cipher.
    See the relevant documentation for details (at least ``key`` will need
    to be presentzUnknown parameters for ECB: %s)Ú_create_base_cipherr   r#   Ústrr   )ÚfactoryÚkwargsÚcipher_states      r   Ú_create_ecb_cipherr7   Í   sS   € ð ×.Ò.¨vÑ6Ô6€LØ%Ô0€LÔØð HÝÐ8½3¸v¹;¼;ÑFÑGÔGÐGÝ�<Ñ Ô Ð r   N)r/   Ú__all__ÚCrypto.Util._raw_apir   r   r   r   r   r	   r
   r   r   Úobjectr   r7   r0   r   r   ú<module>r;      så   ðð.ð ð ˆ-€ð7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7ð (Ð'Ð(@ð Cñ *ô *€ð Wð Wð Wð Wð Wˆfñ Wô Wð Wðt!ð !ð !ð !ð !r   