
    ;Si                     $    d Z ddlZ G d d      Zy)z1
This module holds the AESModeCTR wrapper class.
    Nc                   "    e Zd ZdZd Zd Zd Zy)
AESModeCTRz>Wrapper around pyaes.AESModeOfOperationCTR mode with custom IVc                     t        |t              sJ t        j                  |      | _        t        |t              sJ t        |      dk(  sJ t        |      | j                  j                  _        y)z
        Initializes the AES CTR mode with the given key/iv pair.

        :param key: the key to be used as bytes.
        :param iv: the bytes initialization vector. Must have a length of 16.
           N)
isinstancebytespyaesAESModeOfOperationCTR_aeslenlist_counter)selfkeyivs      [/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/crypto/aesctr.py__init__zAESModeCTR.__init__   s\     #u%%%//4	"e$$$2w"}}&*2h		#    c                 8    | j                   j                  |      S )z
        Encrypts the given plain text through AES CTR.

        :param data: the plain text to be encrypted.
        :return: the encrypted cipher text.
        )r   encryptr   datas     r   r   zAESModeCTR.encrypt        yy  &&r   c                 8    | j                   j                  |      S )z
        Decrypts the given cipher text through AES CTR

        :param data: the cipher text to be decrypted.
        :return: the decrypted plain text.
        )r   decryptr   s     r   r   zAESModeCTR.decrypt#   r   r   N)__name__
__module____qualname____doc__r   r   r    r   r   r   r      s    H/''r   r   )r   r	   r   r    r   r   <module>r!      s    #' #'r   