관리-도구
편집 파일: ed25519.cpython-36.opt-1.pyc
3 y�_& � @ s� d dl mZmZmZ d dlmZmZ d dlmZ d dl m Z mZmZm Z eje�G dd� de��Zeje �G dd� de��Zd S ) � )�absolute_import�division�print_function)� exceptions�utils)� serialization)�Ed25519PrivateKey�Ed25519PublicKey�_ED25519_KEY_SIZE�_ED25519_SIG_SIZEc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) �_Ed25519PublicKeyc C s || _ || _d S )N)�_backend� _evp_pkey)�self�backend�evp_pkey� r �/usr/lib64/python3.6/ed25519.py�__init__ s z_Ed25519PublicKey.__init__c C sV |t jjks|t jjkr@|t jjk s0|t jjk r8td��| j� S | jj||| | jd �S )Nz3When using Raw both encoding and format must be Raw) r �Encoding�Raw�PublicFormat� ValueError�_raw_public_bytesr Z_public_key_bytesr )r �encoding�formatr r r �public_bytes s z_Ed25519PublicKey.public_bytesc C sp | j jjdt�}| j jjdt�}| j jj| j||�}| j j|dk� | j j|d tk� | j jj|t�d d � S )Nzunsigned char []zsize_t *� r ) r �_ffi�newr �_lib�EVP_PKEY_get_raw_public_keyr �openssl_assert�buffer)r �buf�buflen�resr r r r * s z#_Ed25519PublicKey._raw_public_bytesc C s� | j jj� }| j j|| j jjk� | j jj|| j jj�}| j jj|| j jj| j jj| j jj| j �}| j j|dk� | j jj ||t|�|t|��}|dkr�| j j� t j�d S )Nr )r r �Cryptography_EVP_MD_CTX_newr"