3 l�_a �@sxddlmZmZmZddlZddlZddlmZmZdZ dZ ej ej �Gdd�de ��Zej ej �Gdd �d e ��ZdS) �)�absolute_import�division�print_functionN)�UnsupportedAlgorithm�_Reasons� �@c@s4eZdZedd��Zejdd��Zejdd��ZdS)�Ed25519PublicKeycCs*ddlm}|j�s tdtj��|j|�S)Nr)�backendz4ed25519 is not supported by this version of OpenSSL.)�,cryptography.hazmat.backends.openssl.backendr �ed25519_supportedrr� UNSUPPORTED_PUBLIC_KEY_ALGORITHMZed25519_load_public_bytes)�cls�datar �r�/usr/lib64/python3.6/ed25519.py�from_public_bytess  z"Ed25519PublicKey.from_public_bytescCsdS)z9 The serialized bytes of the public key. Nr)�self�encoding�formatrrr� public_bytes szEd25519PublicKey.public_bytescCsdS)z' Verify the signature. Nr)rZ signaturerrrr�verify&szEd25519PublicKey.verifyN) �__name__� __module__� __qualname__� classmethodr�abc�abstractmethodrrrrrrr s r c@sNeZdZedd��Zedd��Zejdd��Zejdd��Z ejd d ��Z d S) �Ed25519PrivateKeycCs(ddlm}|j�s tdtj��|j�S)Nr)r z4ed25519 is not supported by this version of OpenSSL.)r r r rrr Zed25519_generate_key)rr rrr�generate/s  zEd25519PrivateKey.generatecCs*ddlm}|j�s tdtj��|j|�S)Nr)r z4ed25519 is not supported by this version of OpenSSL.)r r r rrr Zed25519_load_private_bytes)rrr rrr�from_private_bytes;s  z$Ed25519PrivateKey.from_private_bytescCsdS)zD The Ed25519PublicKey derived from the private key. Nr)rrrr� public_keyGszEd25519PrivateKey.public_keycCsdS)z: The serialized bytes of the private key. Nr)rrrZencryption_algorithmrrr� private_bytesMszEd25519PrivateKey.private_bytescCsdS)z! Signs the data. Nr)rrrrr�signSszEd25519PrivateKey.signN) rrrrrr rrr!r"r#rrrrr-s  r)Z __future__rrrrZsixZcryptography.exceptionsrrZ_ED25519_KEY_SIZEZ_ED25519_SIG_SIZEZ add_metaclass�ABCMeta�objectr rrrrr�s