관리-도구
편집 파일: hmac.cpython-36.pyc
3 T��e� � @ st d dl mZmZmZ d dlmZ d dlmZmZm Z d dl mZmZm Z eje j�ejej�G dd� de���ZdS )� )�absolute_import�division�print_function)�utils)�InvalidSignature�UnsupportedAlgorithm�_Reasons)� constant_time�hashes�macc @ s@ e Zd Zd dd�Zejd�Zdd� Zdd� Zd d � Z dd� Z dS )�_HMACContextNc C s� || _ || _|d kr�| jjj� }| jj|| jjjk� | jjj|| jjj�}| jj |�}|| jjjkrzt dj|j�t j��| jjj|�}| jjj||t|�|| jjj�}| jj|dk� || _|| _d S )Nz*{} is not a supported hash on this backendr )� _algorithm�_backend�_lib�Cryptography_HMAC_CTX_new�openssl_assert�_ffi�NULL�gc�Cryptography_HMAC_CTX_freeZ_evp_md_from_algorithmr �format�namer ZUNSUPPORTED_HASH�from_bufferZHMAC_Init_ex�len�_ctx�_key)�selfZbackend�key� algorithm�ctxZevp_mdZkey_ptr�res� r! �/usr/lib64/python3.6/hmac.py�__init__ s&