U +Mb@slddlmZddlmZmZmZmZmZmZm Z eddZ Gddde Z d dd Z e jZe jZd d ZdS) bord)load_pycryptodome_raw_lib VoidPointer SmartPointercreate_string_bufferget_raw_bufferc_size_t c_uint8_ptrzCrypto.Hash._SHA224a int SHA224_init(void **shaState); int SHA224_destroy(void *shaState); int SHA224_update(void *hs, const uint8_t *buf, size_t len); int SHA224_digest(const void *shaState, uint8_t *digest, size_t digest_size); int SHA224_copy(const void *src, void *dst); int SHA224_pbkdf2_hmac_assist(const void *inner, const void *outer, const uint8_t *first_digest, uint8_t *final_digest, size_t iterations, size_t digest_size); c@sPeZdZdZdZdZdZdddZdd Zd d Z d d Z ddZ dddZ dS) SHA224HashaA SHA-224 hash object. Do not instantiate directly. Use the :func:`new` function. :ivar oid: ASN.1 Object ID :vartype oid: string :ivar block_size: the size in bytes of the internal message block, input to the compression function :vartype block_size: integer :ivar digest_size: the size in bytes of the resulting hash :vartype digest_size: integer @z2.16.840.1.101.3.4.2.4NcCsHt}t|}|r$td|t|tj|_|rD| |dS)Nz#Error %d while instantiating SHA224) r_raw_sha224_libZ SHA224_initZ address_of ValueErrorrgetZSHA224_destroy_stateupdate)selfdatastateresultr9/tmp/pip-target-t616c12r/lib/python/Crypto/Hash/SHA224.py__init__HszSHA224Hash.__init__cCs4t|jt|tt|}|r0td|dS)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. z'Error %d while hashing data with SHA224N)rZ SHA224_updaterrr r lenr)rrrrrrrSs  zSHA224Hash.updatecCs<t|j}t|j|t|j}|r4td|t|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 z#Error %d while making SHA224 digest) r digest_sizerZ SHA224_digestrrr rr)rbfrrrrrdigestas  zSHA224Hash.digestcCsddd|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 cSsg|]}dt|qS)z%02xr).0xrrr {sz(SHA224Hash.hexdigest..)joinr)rrrr hexdigestsszSHA224Hash.hexdigestcCs2t}t|j|j}|r.td||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 SHA224)r rZ SHA224_copyrrr)rclonerrrrcopy}s   zSHA224Hash.copycCst|S)z#Create a fresh SHA-224 hash object.)r )rrrrrnewszSHA224Hash.new)N)N) __name__ __module__ __qualname____doc__r block_sizeoidrrrr#r%r&rrrrr 1s  r NcCs t|S)aCreate a new hash object. :parameter data: Optional. The very first chunk of the message to hash. It is equivalent to an early call to :meth:`SHA224Hash.update`. :type data: byte string/byte array/memoryview :Return: A :class:`SHA224Hash` hash object )r r&)rrrrr&s r&c Cs\|dks ttt|}t|j|j||t|tt|}|rTtd|t |S)z/Compute the expensive inner loop in PBKDF-HMAC.rz+Error %d with PBKDF2-HMAC assist for SHA224) AssertionErrorrrrZSHA224_pbkdf2_hmac_assistrrr rr)innerouterZ first_digest iterationsrrrrr_pbkdf2_hmac_assists    r1)N)ZCrypto.Util.py3compatrZCrypto.Util._raw_apirrrrrr r robjectr r&rr+r1rrrrs $d