U +¥Mbßã@sdddlmZddlmZmZmZmZmZmZm Z eddƒZ Gdd„de ƒZ d dd „Z e jZe jZdS) é©Úbord)Úload_pycryptodome_raw_libÚ VoidPointerÚ SmartPointerÚcreate_string_bufferÚget_raw_bufferÚc_size_tÚ c_uint8_ptrzCrypto.Hash._MD2aí int md2_init(void **shaState); int md2_destroy(void *shaState); int md2_update(void *hs, const uint8_t *buf, size_t len); int md2_digest(const void *shaState, uint8_t digest[20]); int md2_copy(const void *src, void *dst); c@sPeZdZdZdZdZdZddd„Zdd„Zd d „Z d d „Z d d„Z ddd„Z dS)ÚMD2Hasha“An MD2 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 éz1.2.840.113549.2.2NcCsHtƒ}t | ¡¡}|r$td|ƒ‚t| ¡tjƒ|_|rD|  |¡dS)Nú Error %d while instantiating MD2) rÚ _raw_md2_libZmd2_initZ address_ofÚ ValueErrorrÚgetZ md2_destroyÚ_stateÚupdate)ÚselfÚdataÚstateÚresult©rú6/tmp/pip-target-t616c12r/lib/python/Crypto/Hash/MD2.pyÚ__init__KsÿÿzMD2Hash.__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. r N)rZ md2_updaterrr r Úlenr)rrrrrrrVs  þÿzMD2Hash.updatecCs4t|jƒ}t |j ¡|¡}|r,td|ƒ‚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 r )rÚ digest_sizerZ md2_digestrrrr)rZbfrrrrrÚdigestds  ÿÿzMD2Hash.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Ú }sz%MD2Hash.hexdigest..)Újoinr)rrrrÚ hexdigestuszMD2Hash.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 MD2)r rZmd2_copyrrr)rÚclonerrrrÚcopys  ÿ z MD2Hash.copycCst|ƒS)N)r )rrrrrÚnew‘sz MD2Hash.new)N)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚ block_sizeÚoidrrrr"r$r%rrrrr 5s  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:`MD2Hash.update`. :type data: bytes/bytearray/memoryview :Return: A :class:`MD2Hash` hash object )r r%)rrrrr%•s r%)N)ZCrypto.Util.py3compatrZCrypto.Util._raw_apirrrrrr r rÚobjectr r%rr*rrrrÚs $þ`