ok

Mini Shell

Direktori : /proc/self/root/usr/lib64/python2.7/site-packages/M2Crypto/
Upload File :
Current File : //proc/self/root/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyc

�

�1Mc@sdZddlZddlZddlZdefd��YZeje�ejZejZej	Z	ej
Z
ejZejZej
Z
ejZejZejZejZejZejZejZejZejZejZejZejZejZejZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*ej+Z+ej,Z,ej-Z-ej.Z.ej/Z/ej0Z0ej1Z1ej2Z2ej3Z3ej4Z4ej5Z5ej6Z6ej7Z7ej8Z8ej9Z9ej:Z:ej;Z;ej<Z<ej=Z=ej>Z>ej?Z?ej@Z@ejAZAejBZBejCZCejDZDejEZEejFZFejGZGddd��YZHdeHfd��YZId	�ZJejKd
�ZLejKd�ZMd�ZNd
�ZOd�ZPd�ZQdS(s�
M2Crypto wrapper for OpenSSL ECDH/ECDSA API.

@requires: OpenSSL 0.9.8 or newer

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.

Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. 
All rights reserved.i����NtECErrorcBseZRS((t__name__t
__module__(((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyR
stECcBs�eZdZejZdd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zdejd
�Zdejd�Zd�Zd�Zd�Zd�ZRS(s,
    Object interface to a EC key pair.
    icCs1tj|�std��||_||_dS(Ns'ec' type error(tm2tec_key_type_checktAssertionErrortect_pyfree(tselfRR((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt__init__is	cCs)t|dd�r%|j|j�ndS(NRi(tgetattrtm2_ec_key_freeR(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt__del__nscCs.tj|j�std��tj|j�S(Ns'ec' type error(RRRRt
ec_key_keylen(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt__len__rscCs2tj|j�std��tj|j�dS(s�
        Generates the key pair from its parameters. Use::
            keypair = EC.gen_params(curve)
            keypair.gen_key()
        to create an EC key pair.
        s'ec' type errorN(RRRRtec_key_gen_key(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytgen_keyvscCst|jd�S(Ni(tEC_pubR(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytpub�scCs+|j�std��tj|j|�S(sw
        Sign the given digest using ECDSA. Returns a tuple (r,s), the two
        ECDSA signature parameters.
        s'ec' type error(t_check_key_typeRRt
ecdsa_signR(R	tdigest((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytsign_dsa�scCs1|j�std��tj|j|||�S(sj
        Verify the given digest using ECDSA. r and s are the ECDSA
        signature parameters.
        s'ec' type error(RRRtecdsa_verifyR(R	Rtrts((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt
verify_dsa�scCs+|j�std��tj|j|�S(Ns'ec' type error(RRRtecdsa_sign_asn1R(R	R((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt
sign_dsa_asn1�scCs.|j�std��tj|j||�S(Ns'ec' type error(RRRtecdsa_verify_asn1R(R	Rtblob((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytverify_dsa_asn1�scCs.|j�std��tj|j|j�S(s�
        Compute the ECDH shared key of this key pair and the given public 
        key object. They must both use the same curve. Returns the 
        shared key in binary as a buffer object. No Key Derivation Function is 
        applied.
        skey is not initialised(t	check_keyRRtecdh_compute_keyR(R	tpub_key((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytcompute_dh_key�staes_128_cbccCs|dkr(tj|j|j�|�Stt|d�}|dkrYtd|��ntj|j|j�|�|�SdS(sR
        Save the key pair to an M2Crypto.BIO.BIO object in PEM format.

        @type bio: M2Crypto.BIO.BIO
        @param bio: M2Crypto.BIO.BIO object to save key to.

        @type cipher: string
        @param cipher: Symmetric cipher to protect the key. The default
        cipher is 'aes_128_cbc'. If cipher is None, then the key is saved
        in the clear.

        @type callback: Python callable
        @param callback: A Python callable object that is invoked
        to acquire a passphrase with which to protect the key.
        The default is util.passphrase_callback.
        snot such cipher %sN(tNoneRtec_key_write_bio_no_cipherRt_ptrRt
ValueErrortec_key_write_bio(R	tbiotciphertcallbacktciph((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytsave_key_bio�scCs%tj|d�}|j|||�S(s+
        Save the key pair to a file in PEM format.

        @type file: string
        @param file: Name of file to save key to.

        @type cipher: string
        @param cipher: Symmetric cipher to protect the key. The default
        cipher is 'aes_128_cbc'. If cipher is None, then the key is saved
        in the clear.

        @type callback: Python callable
        @param callback: A Python callable object that is invoked
        to acquire a passphrase with which to protect the key.
        The default is util.passphrase_callback.
        twb(tBIOtopenfileR/(R	tfileR,R-R+((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytsave_key�scCstj|j|j��S(s�
        Save the public key to an M2Crypto.BIO.BIO object in PEM format.

        @type bio: M2Crypto.BIO.BIO
        @param bio: M2Crypto.BIO.BIO object to save key to.
        (Rtec_key_write_pubkeyRR((R	R+((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytsave_pub_key_bio�scCs+tj|d�}tj|j|j��S(s�
        Save the public key to a file in PEM format.

        @type file: string
        @param file: Name of file to save key to.
        R0(R1R2RR5RR((R	R3R+((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytsave_pub_key�scCstj|j�S(N(RRR(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyR�scCs.tj|j�std��tj|j�S(Ns'ec' type error(RRRRtec_key_check_key(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyR!�s(RRt__doc__Rtec_key_freeRR
R
RRRRRRR R$tutiltpassphrase_callbackR/R4R6R7RR!(((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyRas$				
						
			
	RcBs5eZdZdd�Zd�ZejZejZ	RS(sc
    Object interface to an EC public key. 
    ((don't like this implementation inheritance))
    icCs tj|||�d|_dS(N(RR
R&tder(R	RR((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyR
�scCsF|j�std��|jdkr?tj|j�|_n|jS(sJ
        Returns the public key in DER format as a buffer object.
        skey is not initialisedN(R!RR=R&Rtec_key_get_public_derR(R	((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytget_der�s(
RRR9R
R?RR7R4R6R/(((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyR�s
			cCsttj|�d�S(s�
    Factory function that generates EC parameters and 
    instantiates a EC object from the output.

    @param curve: This is the OpenSSL nid of the curve to use. 
    i(RRtec_key_new_by_curve_name(tcurve((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt
gen_paramsscCstj|�}t||�S(s
    Factory function that instantiates a EC object.

    @param file: Names the file that contains the PEM representation 
    of the EC key pair.

    @param callback: Python callback object that will be invoked 
    if the EC key pair is passphrase-protected.
    (R1R2tload_key_bio(R3R-R+((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytload_keys
cCsttj|j�|�d�S(s
    Factory function that instantiates a EC object.

    @param bio: M2Crypto.BIO object that contains the PEM
    representation of the EC key pair. 

    @param callback: Python callback object that will be invoked 
    if the EC key pair is passphrase-protected.
    i(RRtec_key_read_bioR((R+R-((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyRCs
cCstj|�}t|�S(s�
    Load an EC public key from file.

    @type file: string
    @param file: Name of file containing EC public key in PEM format.

    @rtype: M2Crypto.EC.EC_pub
    @return: M2Crypto.EC.EC_pub object.
    (R1R2tload_pub_key_bio(R3R+((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytload_pub_key*s
cCs8tj|j��}|dkr+t�nt|d�S(s�
    Load an EC public key from an M2Crypto.BIO.BIO object.

    @type bio: M2Crypto.BIO.BIO
    @param bio: M2Crypto.BIO.BIO object containing EC public key in PEM
    format.

    @rtype: M2Crypto.EC.EC_pub
    @return: M2Crypto.EC.EC_pub object.
    iN(Rtec_key_read_pubkeyR(R&tec_errorR(R+R((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyRF8s
cCsttjtj���dS(N(RRterr_reason_error_stringt
err_get_error(((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyRIHscCsttj|�d�S(s!
    Create EC_pub from DER.
    i(RRtec_key_from_pubkey_der(R=((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pytpub_key_from_derKs((RR9R;R1Rt	ExceptionRtec_initt
NID_secp112r1t
NID_secp112r2t
NID_secp128r1t
NID_secp128r2t
NID_secp160k1t
NID_secp160r1t
NID_secp160r2t
NID_secp192k1t
NID_secp224k1t
NID_secp224r1t
NID_secp256k1t
NID_secp384r1t
NID_secp521r1t
NID_sect113r1t
NID_sect113r2t
NID_sect131r1t
NID_sect131r2t
NID_sect163k1t
NID_sect163r1t
NID_sect163r2t
NID_sect193r1t
NID_sect193r2t
NID_sect233k1t
NID_sect233r1t
NID_sect239k1t
NID_sect283k1t
NID_sect283r1t
NID_sect409k1t
NID_sect409r1t
NID_sect571k1t
NID_sect571r1tNID_X9_62_prime192v1tNID_X9_62_prime192v2tNID_X9_62_prime192v3tNID_X9_62_prime239v1tNID_X9_62_prime239v2tNID_X9_62_prime239v3tNID_X9_62_prime256v1tNID_X9_62_c2pnb163v1tNID_X9_62_c2pnb163v2tNID_X9_62_c2pnb163v3tNID_X9_62_c2pnb176v1tNID_X9_62_c2tnb191v1tNID_X9_62_c2tnb191v2tNID_X9_62_c2tnb191v3tNID_X9_62_c2pnb208w1tNID_X9_62_c2tnb239v1tNID_X9_62_c2tnb239v2tNID_X9_62_c2tnb239v3tNID_X9_62_c2pnb272w1tNID_X9_62_c2pnb304w1tNID_X9_62_c2tnb359v1tNID_X9_62_c2pnb368w1tNID_X9_62_c2tnb431r1tNID_wap_wsg_idm_ecid_wtls1tNID_wap_wsg_idm_ecid_wtls3tNID_wap_wsg_idm_ecid_wtls4tNID_wap_wsg_idm_ecid_wtls5tNID_wap_wsg_idm_ecid_wtls6tNID_wap_wsg_idm_ecid_wtls7tNID_wap_wsg_idm_ecid_wtls8tNID_wap_wsg_idm_ecid_wtls9tNID_wap_wsg_idm_ecid_wtls10tNID_wap_wsg_idm_ecid_wtls11tNID_wap_wsg_idm_ecid_wtls12RRRBR<RDRCRGRFRIRM(((s1/usr/lib64/python2.7/site-packages/M2Crypto/EC.pyt<module>	s�$
																																																																	
�	
			

Zerion Mini Shell 1.0