ó Û_e[c@`sddlmZmZmZddlmZddlmZmZej eƒde fd„ƒYƒZ ej eƒde fd„ƒYƒZ dS( i(tabsolute_importtdivisiontprint_function(tutils(tX25519PrivateKeytX25519PublicKeyt_X25519PublicKeycB`seZd„Zd„ZRS(cC`s||_||_dS(N(t_backendt _evp_pkey(tselftbackendtevp_pkey((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyt__init__s cC`sĨ|jjjdƒ}|jjj|j|ƒ}|jj|dkƒ|jj|d|jjjkƒ|jjj|d|jjj ƒ}|jjj ||ƒS(Nsunsigned char **i i( Rt_ffitnewt_libtEVP_PKEY_get1_tls_encodedpointRtopenssl_asserttNULLtgct OPENSSL_freetbuffer(R tucharpptrestdata((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyt public_bytess # (t__name__t __module__R R(((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyR s t_X25519PrivateKeycB`s#eZd„Zd„Zd„ZRS(cC`s||_||_dS(N(RR(R R R ((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyR "s cC`są|jjƒ}|jjj||jƒ}|jj|dkƒ|jjj||jjjƒ}|jj||jjjkƒ|jjj ||jjj ƒ}t |j|ƒS(Ni( Rt_create_mem_bio_gcRti2d_PUBKEY_bioRRtd2i_PUBKEY_bioR RRt EVP_PKEY_freeR(R tbioRR ((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyt public_key&s  cC`sīt|tƒstdƒ‚n|jjj|j|jjjƒ}|jj ||jjjkƒ|jjj ||jjj ƒ}|jjj |ƒ}|jj |dkƒ|jjj ||jƒ}|jj |dkƒ|jjjdƒ}|jjj||jjj|ƒ}|jj |dkƒ|jj |ddkƒ|jjjd|dƒ}|jjj|||ƒ}|dkr™tdƒ‚n|jjj||dƒS(Ns(peer_public_key must be X25519PublicKey.issize_t *isunsigned char[]s1Null shared key derived from public/private pair.(t isinstanceRt TypeErrorRRtEVP_PKEY_CTX_newRR RRRtEVP_PKEY_CTX_freetEVP_PKEY_derive_inittEVP_PKEY_derive_set_peerRtEVP_PKEY_derivet ValueErrorR(R tpeer_public_keytctxRtkeylentbuf((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pytexchange3s, !    (RRR R"R/(((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyR s  N( t __future__RRRt cryptographyRt0cryptography.hazmat.primitives.asymmetric.x25519RRtregister_interfacetobjectRR(((sS/tmp/pip-install-KP2Jbq/cryptography/cryptography/hazmat/backends/openssl/x25519.pyts