U +¥Mbóã@slddlmZddlmZmZmZmZmZmZm Z eddƒZ Gdd„de ƒZ d dd „Z e jZe jZd d „ZdS) é©Úbord)Úload_pycryptodome_raw_libÚ VoidPointerÚ SmartPointerÚcreate_string_bufferÚget_raw_bufferÚc_size_tÚ c_uint8_ptrzCrypto.Hash._SHA384aÌ int SHA384_init(void **shaState); int SHA384_destroy(void *shaState); int SHA384_update(void *hs, const uint8_t *buf, size_t len); int SHA384_digest(const void *shaState, uint8_t *digest, size_t digest_size); int SHA384_copy(const void *src, void *dst); int SHA384_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@sPeZdZdZdZdZdZddd„Zdd „Zd d „Z d d „Z dd„Z ddd„Z dS)Ú SHA384Hasha–A SHA-384 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 é0é€z2.16.840.1.101.3.4.2.2NcCsHtƒ}t | ¡¡}|r$td|ƒ‚t| ¡tjƒ|_|rD|  |¡dS)Nz#Error %d while instantiating SHA384) rÚ_raw_sha384_libZ SHA384_initZ address_ofÚ ValueErrorrÚgetZSHA384_destroyÚ_stateÚupdate)ÚselfÚdataÚstateÚresult©rú9/tmp/pip-target-t616c12r/lib/python/Crypto/Hash/SHA384.pyÚ__init__GsÿÿzSHA384Hash.__init__cCs4t |j ¡t|ƒtt|ƒƒ¡}|r0td|ƒ‚dS)z¼Continue 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 SHA384N)rZ SHA384_updaterrr r Úlenr)rrrrrrrRs  þÿzSHA384Hash.updatecCs<t|jƒ}t |j ¡|t|jƒ¡}|r4td|ƒ‚t|ƒS)zçReturn 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 SHA384 digest) rÚ digest_sizerZ SHA384_digestrrr rr)rÚbfrrrrrÚdigest`s  þÿzSHA384Hash.digestcCsd dd„| ¡Dƒ¡S)zÝReturn 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)Ú.0ÚxrrrÚ zsz(SHA384Hash.hexdigest..)Újoinr)rrrrÚ hexdigestrszSHA384Hash.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 SHA384)r rZ SHA384_copyrrr)rÚclonerrrrÚcopy|s  ÿ zSHA384Hash.copycCst|ƒS)z#Create a fresh SHA-384 hash object.)r )rrrrrÚnewŽszSHA384Hash.new)N)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚ block_sizeÚoidrrrr#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:`SHA384Hash.update`. :type data: byte string/byte array/memoryview :Return: A :class:`SHA384Hash` hash object )r r&)rrrrr&”s r&c Cs\|dks t‚tt|ƒƒ}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 SHA384) ÚAssertionErrorrrrZSHA384_pbkdf2_hmac_assistrrr rr)ÚinnerÚouterZ first_digestÚ iterationsrrrrrÚ_pbkdf2_hmac_assist©s   ú r1)N)ZCrypto.Util.py3compatrZCrypto.Util._raw_apirrrrrr r rÚobjectr r&rr+r1rrrrÚs $ÿc