o )%a @sXddlZddlmZmZddlmZdZdZGdddejdZ Gd d d ejdZ dS) N)UnsupportedAlgorithm_Reasons)_serialization @c@s^eZdZededdfddZejdej dej defddZ ejd ededd fd d Z d S) Ed25519PublicKeydatareturncC*ddlm}|stdtj||SNr)backendz4ed25519 is not supported by this version of OpenSSL.),cryptography.hazmat.backends.openssl.backendr ed25519_supportedrr UNSUPPORTED_PUBLIC_KEY_ALGORITHMed25519_load_public_bytesclsrr rS/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/asymmetric/ed25519.pyfrom_public_bytes  z"Ed25519PublicKey.from_public_bytesencodingformatcCdS)z9 The serialized bytes of the public key. Nr)selfrrrrr public_byteszEd25519PublicKey.public_bytes signatureNcCr)z' Verify the signature. Nr)rrrrrrverify'rzEd25519PublicKey.verify) __name__ __module__ __qualname__ classmethodbytesrabcabstractmethodrEncoding PublicFormatrrrrrrrs   r) metaclassc@s~eZdZedddZededdfddZejde fddZ ejd e j d e j d e jfd d ZejdedefddZdS)Ed25519PrivateKeyr cCs(ddlm}|stdtj|Sr )r r rrrred25519_generate_key)rr rrrgenerate/s zEd25519PrivateKey.generatercCr r )r r rrrred25519_load_private_bytesrrrrfrom_private_bytes;rz$Ed25519PrivateKey.from_private_bytescCr)zD The Ed25519PublicKey derived from the private key. Nr)rrrr public_keyGrzEd25519PrivateKey.public_keyrrencryption_algorithmcCr)z: The serialized bytes of the private key. Nr)rrrr/rrr private_bytesMrzEd25519PrivateKey.private_bytescCr)z! Signs the data. Nr)rrrrrsignXrzEd25519PrivateKey.signN)r r))rr r!r"r+r#r-r$r%rr.rr& PrivateFormatKeySerializationEncryptionr0r1rrrrr).s"     r)) r$cryptography.exceptionsrrcryptography.hazmat.primitivesr_ED25519_KEY_SIZE_ED25519_SIG_SIZEABCMetarr)rrrrs