ff#zddlmZddlmZmZmZmZmZmZm Z m Z ddl m Z Gdde ZdZejZdZdS) bord)load_pycryptodome_raw_lib VoidPointer SmartPointercreate_string_bufferget_raw_bufferc_size_t c_uint8_ptrc_ubyte)_raw_keccak_libcDeZdZdZdZdZdZdZdZdZ dZ d Z d d Z d S) SHA3_256_HashzA SHA3-256 hash object. Do not instantiate directly. Use the :func:`new` function. :ivar oid: ASN.1 Object ID :vartype oid: string :ivar digest_size: the size in bytes of the resulting hash :vartype digest_size: integer z2.16.840.1.101.3.4.2.8c||_d|_d|_t}t j|t|jdztd}|rtd|zt| tj |_|r||dSdS)NF&Error %d while instantiating SHA-3/256)_update_after_digest _digest_done_paddingrr keccak_init address_ofr digest_sizer ValueErrorrgetkeccak_destroy_stateupdate)selfdataupdate_after_digeststateresults v/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/SHA3_256.py__init__zSHA3_256_Hash.__init__4s$7!!   ,U-=-=-?-?-5d6F6J-K-K-4R[[::  'E%&'' '"599;;#2#ACC   KK       c |jr|jstdtj|jt|tt|}|rtd|z|S)zContinue hashing of a message by consuming the next chunk of data. Args: data (byte string/byte array/memoryview): The next chunk of the message being hashed. z8You can only call 'digest' or 'hexdigest' on this objectz!Error %d while updating SHA-3/256) rr TypeErrorr keccak_absorbr rr r lenr)r"r#r&s r'r!zSHA3_256_Hash.updateEs   XT%> XVWW W .t{/@/@/:4/@/@/7D /B/B11  '@%&'' ' r)c:d|_t|j}tj|j|t|jt|j }|rtd|zt||_ |j S)zReturn the **binary** (non-printable) digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Binary form. :rtype: byte string Tr) rrrr keccak_digestr rr r rrr _digest_value)r"bfrr&s r'digestzSHA3_256_Hash.digestXs!"4#344 .t{/@/@/2/78H/I/I/6t}/E/EGG  'E%&'' ',C00!!r)cddd|DS)zReturn the **printable** digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Hexadecimal encoded. :rtype: string c2g|]}dt|zS)z%02xr).0xs r' z+SHA3_256_Hash.hexdigest..vs#@@@Qa(@@@r))joinr2)r"s r' hexdigestzSHA3_256_Hash.hexdigestns-ww@@$++--@@@AAAr)c|}tj|j|j}|rt d|z|S)a4Return a copy ("clone") of the hash object. The copy will have the same internal state as the original hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. :return: A hash object of the same type zError %d while copying SHA3-256)newr keccak_copyr rr)r"cloner&s r'copyzSHA3_256_Hash.copyxsf  ,T[__->->-2\-=-=-?-?AA  I>GHH H r)Nc>t|||jS)z$Create a fresh SHA3-256 hash object.)typer)r"r#s r'r<zSHA3_256_Hash.newstDzz$ 9:::r))N) __name__ __module__ __qualname____doc__roid block_sizer(r!r2r:r?r<r)r'rrs  K #CJ"&""",BBB$;;;;;;r)rc|dd}|dd}t|dkr|rtd|d}|rtdt |zt ||S) aCreate a new hash object. Args: data (byte string/byte array/memoryview): The very first chunk of the message to hash. It is equivalent to an early call to :meth:`update`. update_after_digest (boolean): Whether :meth:`digest` can be followed by another :meth:`update` (default: ``False``). :Return: A :class:`SHA3_256_Hash` hash object r#Nr$Fz%Initial data for hash specified twicerzUnknown parameters: )popr-rr+strr)argskwargsr#r$s r'r<r<s ::fd # #D **%:EBB 4yyA~~  FDEE EAw >.V<=== 2 3 33r)rN)Crypto.Util.py3compatrCrypto.Util._raw_apirrrrr r r r Crypto.Hash.keccakr objectrr<rrGrHr)r'rSs*'&&&&&88888888888888888888 /.....n;n;n;n;n;Fn;n;n;b4446'  r)