o
    j                     @   s^   d dl mZmZ d dlZd dlmZ d dlmZ G dd dZdde	d	e	d
e
fddZeZdS )    )ABCabstractmethodN)hashlib)loggerc                   @   s\   e Zd Zdd Zedd Zedd Zedd Zed	d
 Zedd Z	e
dd ZdS )hmacBASEc                 C   s*   d | _ d | _d | _|| _d | _|   d S N)digest_size
block_sizename_key_hash
setup_hash)selfkey r   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/unicrypto/hmac.py__init__   s   zhmacBASE.__init__c                 C      t  r   NotImplementedErrorr   r   r   r   r      s   zhmacBASE.setup_hashc                 C   r   r   r   )r   datar   r   r   update      zhmacBASE.updatec                 C   r   r   r   r   r   r   r   digest   r   zhmacBASE.digestc                 C   r   r   r   r   r   r   r   	hexdigest   r   zhmacBASE.hexdigestc                 C   r   r   r   r   r   r   r   copy!   r   zhmacBASE.copyc                 C   r   r   r   )r   abr   r   r   compare_digest%   r   zhmacBASE.compare_digestN)__name__
__module____qualname__r   r   r   r   r   r   r   staticmethodr   r   r   r   r   r      s    




r    r   msg	digestmodc                 C   s   t d|  t| ||S )Nzhmac using "builtin" for "%s")r   debug__builtinHMACnew)r   r%   r&   r   r   r   hmacselector)   s   r*   )Nr$   )abcr   r   hmacr(   	unicryptor   r   r   bytesstrr*   r)   r   r   r   r   <module>   s    "