관리-도구
편집 파일: cmac.cpython-36.opt-1.pyc
3 T��eV � @ sp d dl mZmZmZ d dlmZ d dlmZmZm Z d dl mZmZ d dl mZ ejej�G dd� de��ZdS ) � )�absolute_import�division�print_function)�utils)�InvalidSignature�UnsupportedAlgorithm�_Reasons)� constant_time�mac)�CBCc @ s@ e Zd Zd dd�Zejd�Zdd� Zdd� Zd d � Z dd� Z dS )�_CMACContextNc C s� |j |�stdtj��|| _|j| _|| _|jd | _ |d kr�| jj }|t|�tf }|| j|t�}| jj j� }| jj|| jjjk� | jjj|| jj j�}| jjj| j�}| jj j||t| j�|| jjj�}| jj|dk� || _d S )Nz#This backend does not support CMAC.� � )Zcmac_algorithm_supportedr r ZUNSUPPORTED_CIPHER�_backend�keyZ_key� _algorithmZ block_size�_output_lengthZ_cipher_registry�typer �_lib�CMAC_CTX_new�openssl_assert�_ffiZNULL�gc� CMAC_CTX_freeZfrom_bufferZ CMAC_Init�len�_ctx) �selfZbackend� algorithm�ctx�registryZadapterZ evp_cipherZkey_ptr�res� r! �/usr/lib64/python3.6/cmac.py�__init__ s0 z_CMACContext.__init__r c C s, | j jj| j|t|��}| j j|dk� d S )Nr )r r ZCMAC_Updater r r )r �datar r! r! r"