B
    Bd\R"  ã               @   sˆ   d Z dZdddgZddlT ddlmZ yddlZejZW n$ e	k
r\   dd	l
mZ eZY nX G d
d„ deƒZddd„ZejZejZdS )a†  SHA-512 cryptographic hash algorithm.

SHA-512 belongs to the SHA-2_ family of cryptographic hashes.
It produces the 512 bit digest of a message.

    >>> from Crypto.Hash import SHA512
    >>>
    >>> h = SHA512.new()
    >>> h.update(b'Hello')
    >>> print h.hexdigest()

*SHA* stands for Secure Hash Algorithm.

.. _SHA-2: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
z$Id$ÚnewÚdigest_sizeÚ
SHA512Hashé    )Ú*)ÚHashAlgoN)Ú_SHA512c               @   s4   e Zd ZdZedƒZdZdZd
dd„Zddd	„Z	dS )r   zLClass that implements a SHA-512 hash
    
    :undocumented: block_size
    u   	`Â†Heé@   é€   Nc             C   s   t  | t|¡ d S )N)r   Ú__init__ÚhashFactory)ÚselfÚdata© r   ú1lib/python3.7/site-packages/Crypto/Hash/SHA512.pyr
   G   s    zSHA512Hash.__init__c             C   s   t |ƒS )N)r   )r   r   r   r   r   r   J   s    zSHA512Hash.new)N)N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚbZoidr   Ú
block_sizer
   r   r   r   r   r   r   4   s   

c             C   s   t ƒ  | ¡S )a  Return a fresh instance of the hash object.

    :Parameters:
       data : byte string
        The very first chunk of the message to hash.
        It is equivalent to an early call to `SHA512Hash.update()`.
        Optional.

    :Return: A `SHA512Hash` object
    )r   r   )r   r   r   r   r   M   s    )N)r   Z_revision__Ú__all__ZCrypto.Util.py3compatZCrypto.Hash.hashalgor   ZhashlibZsha512r   ÚImportErrorZCrypto.Hashr   r   r   r   r   r   r   r   r   Ú<module>#   s   



