9(Zc@`sddlmZmZmZddlmZddlmZmZej ede fdYZ ej ede fdYZ dS( i(tabsolute_importtdivisiontprint_function(tutils(tX25519PrivateKeytX25519PublicKeyt_X25519PublicKeycB`seZdZdZRS(cC`s||_||_dS(N(t_backendt _evp_pkey(tselftbackendtevp_pkey((sQ/tmp/pip-build-wDUJoH/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((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pyt public_bytess # (t__name__t __module__R R(((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pyR s t_X25519PrivateKeycB`s#eZdZdZdZRS(cC`s||_||_dS(N(RR(R R R ((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pyR "s cC`sq|jj}|jjj||j}|jj|dk|jjj||jjj}t |j|S(Ni( Rt_create_mem_bio_gcRti2d_PUBKEY_bioRRtd2i_PUBKEY_bioR RR(R tbioRR ((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pyt public_key&s  cC`st|tstdn|jjj|j|jjj}|jj ||jjjk|jjj ||jjj }|jjj |}|jj |dk|jjj ||j}|jj |dk|jjjd}|jjj||jjj|}|jj |dk|jj |ddk|jjjd|d}|jjj|||}|jj |dk|jjj||dS(Ns(peer_public_key must be X25519PublicKey.issize_t *isunsigned char[](t isinstanceRt TypeErrorRRtEVP_PKEY_CTX_newRR RRRtEVP_PKEY_CTX_freetEVP_PKEY_derive_inittEVP_PKEY_derive_set_peerRtEVP_PKEY_deriveR(R tpeer_public_keytctxRtkeylentbuf((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pytexchange/s( !  (RRR R!R-(((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pyR s  N( t __future__RRRt cryptographyRt0cryptography.hazmat.primitives.asymmetric.x25519RRtregister_interfacetobjectRR(((sQ/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/backends/openssl/x25519.pyts