관리-도구
편집 파일: x448.cpython-36.pyc
3 l�_� � @ s� d dl mZmZmZ d dlmZ d dlmZ d dlm Z d dl mZmZ dZ eje�G dd� de��Zeje�G d d � d e��ZdS )� )�absolute_import�division�print_function)�utils)�_evp_pkey_derive)� serialization)�X448PrivateKey� X448PublicKey�8 c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�_X448PublicKeyc C s || _ || _d S )N)�_backend� _evp_pkey)�self�backend�evp_pkey� r �/usr/lib64/python3.6/x448.py�__init__ s z_X448PublicKey.__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_X448PublicKey.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�new�_X448_KEY_SIZE�_lib�EVP_PKEY_get_raw_public_keyr �openssl_assert�buffer)r �buf�buflen�resr r r r + s z _X448PublicKey._raw_public_bytesN)�__name__� __module__�__qualname__r r r r r r r r s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )�_X448PrivateKeyc C s || _ || _d S )N)r r )r r r r r r r 8 s z_X448PrivateKey.__init__c C sd | j jjdt�}| j jjdt�}| j jj| j||�}| j j|dk� | j j|d tk� | j j|�S )Nzunsigned char []zsize_t *r r ) r r r r r r! r r"