Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
M2Crypto
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/M2Crypto/EC.pyc
mò ž"¬Dc�����������@���sÓ��d��Z��d�k�Z�d�k�Z�d�k�Z�d�e�f�d�„��ƒ��YZ�e�i�e�ƒ�e�i�Z�e�i�Z�e�i �Z �e�i �Z �e�i�Z�e�i�Z�e�i �Z �e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i�Z�e�i �Z �e�i!�Z!�e�i"�Z"�e�i#�Z#�e�i$�Z$�e�i%�Z%�d�f��d�„��ƒ��YZ&�d�e&�f�d�„��ƒ��YZ'�d�„��Z(�e�i)�d �„�Z*�e�i)�d �„�Z+�d�„��Z,�d�„��Z-�d �„��Z.�d�„��Z/�d�S(���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.Nt���ECErrorc�����������B���s���t��Z�RS(���N(���t���__name__t ���__module__(����(����(����t/���/usr/lib/python2.4/site-packages/M2Crypto/EC.pyR���� ���s����t���ECc�����������B���s³���t��Z�d��Z�e�i�Z�d�d�„�Z�d�„��Z�d�„��Z�d�„��Z �d�„��Z �d�„��Z�d�„��Z�d �„��Z �d �„��Z�d�„��Z�d�e�i�d �„�Z�d�e�i�d�„�Z�d�„��Z�d�„��Z�d�„��Z�RS(���s,��� Object interface to a EC key pair. i����c���������C���s0���t��i�|�ƒ�p �t�d�‚�|�|��_�|�|��_�d��S(���Ns���'ec' type error(���t���m2t���ec_key_type_checkt���ect���AssertionErrort���selft���_pyfree(���R ���R���R ���(����(����R���t���__init__:���s���� c���������C���s+���t��|��d�d�ƒ�o�|��i�|��i�ƒ�n�d��S(���NR ���i����(���t���getattrR ���t���m2_ec_key_freeR���(���R ���(����(����R���t���__del__?���s����c���������C���s-���t��i�|��i�ƒ�p �t�d�‚�t��i�|��i�ƒ�S(���Ns���'ec' type error(���R���R���R ���R���R���t ���ec_key_keylen(���R ���(����(����R���t���__len__C���s����c���������C���s1���t��i�|��i�ƒ�p �t�d�‚�t��i�|��i�ƒ�d�S(���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(���R���R���R ���R���R���t���ec_key_gen_key(���R ���(����(����R���t���gen_keyG���s�����c���������C���s���t��|��i�d�ƒ�S(���Ni����(���t���EC_pubR ���R���(���R ���(����(����R���t���pubQ���s����c���������C���s*���|��i�ƒ��p �t�d�‚�t�i�|��i�|�ƒ�S(���sw��� Sign the given digest using ECDSA. Returns a tuple (r,s), the two ECDSA signature parameters. s���key is not initialisedN(���R ���t ���check_keyR���R���t ���ecdsa_signR���t���digest(���R ���R���(����(����R���t���sign_dsaU���s�����c���������C���s0���|��i�ƒ��p �t�d�‚�t�i�|��i�|�|�|�ƒ�S(���sj��� Verify the given digest using ECDSA. r and s are the ECDSA signature parameters. s���key is not initialisedN( ���R ���R���R���R���t���ecdsa_verifyR���R���t���rt���s(���R ���R���R���R���(����(����R���t ���verify_dsa]���s�����c���������C���s*���|��i�ƒ��p �t�d�‚�t�i�|��i�|�ƒ�S(���Ns���key is not initialised(���R ���R���R���R���t���ecdsa_sign_asn1R���R���(���R ���R���(����(����R���t ���sign_dsa_asn1e���s����c���������C���s-���|��i�ƒ��p �t�d�‚�t�i�|��i�|�|�ƒ�S(���Ns���key is not initialised(���R ���R���R���R���t���ecdsa_verify_asn1R���R���t���blob(���R ���R���R ���(����(����R���t���verify_dsa_asn1i���s����c���������C���s-���|��i�ƒ��p �t�d�‚�t�i�|��i�|�i�ƒ�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. s���key is not initialisedN(���R ���R���R���R���t���ecdh_compute_keyR���t���pub_key(���R ���R#���(����(����R���t���compute_dh_keym���s�����t���aes_128_cbcc���������C���s†���|�d�j�o �t�i�|��i�|�i�ƒ��|�ƒ�SnV�t �t�|�d�ƒ�}�|�d�j�o�t�d�|�ƒ�‚�n�t�i�|��i�|�i�ƒ��|�ƒ��|�ƒ�Sd�S(���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. s���not such cipher %sN( ���t���ciphert���NoneR���t���ec_key_write_bio_no_cipherR ���R���t���biot���_ptrt���callbackR���t���cipht ���ValueErrort���ec_key_write_bio(���R ���R)���R&���R+���R,���(����(����R���t���save_key_biow���s����� c���������C���s%���t��i�|�d�ƒ�}�|��i�|�|�|�ƒ�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. t���wbN(���t���BIOt���openfilet���fileR)���R ���R/���R&���R+���(���R ���R3���R&���R+���R)���(����(����R���t���save_key���s�����c���������C���s���t��i�|��i�|�i�ƒ��ƒ�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. N(���R���t���ec_key_write_pubkeyR ���R���R)���R*���(���R ���R)���(����(����R���t���save_pub_key_bio¤���s�����c���������C���s+���t��i�|�d�ƒ�}�t�i�|��i�|�i�ƒ��ƒ�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���N( ���R1���R2���R3���R)���R���R5���R ���R���R*���(���R ���R3���R)���(����(����R���t���save_pub_key���s�����c���������C���s-���t��i�|��i�ƒ�p �t�d�‚�t��i�|��i�ƒ�S(���Ns���'ec' type error(���R���R���R ���R���R���t���ec_key_check_key(���R ���(����(����R���R���·���s����(���R���R���t���__doc__R���t���ec_key_freeR ���R���R���R���R���R���R���R���R���R!���R$���t���utilt���passphrase_callbackR/���R4���R6���R7���R���(����(����(����R���R���2���s"���� R���c�����������B���s5���t��Z�d��Z�d�d�„�Z�d�„��Z�e�i�Z�e�i�Z �RS(���sc��� Object interface to an EC public key. ((don't like this implementation inheritance)) i����c���������C���s ���t��i�|��|�|�ƒ�d��|��_�d��S(���N(���R���R���R ���R���R ���R'���t���der(���R ���R���R ���(����(����R���R���Â���s����c���������C���sG���|��i�ƒ��p �t�d�‚�|��i�d�j�o�t�i�|��i�ƒ�|��_�n�|��i�S(���sJ��� Returns the public key in DER format as a buffer object. s���key is not initialisedN(���R ���R���R���R=���R'���R���t���ec_key_get_public_derR���(���R ���(����(����R���t���get_derÆ���s �����( ���R���R���R9���R���R?���R���R7���R4���R6���R/���(����(����(����R���R���¼���s ���� c���������C���s���t��t�i�|��ƒ�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���N(���R���R���t���ec_key_new_by_curve_namet���curve(���RA���(����(����R���t ���gen_paramsÔ���s�����c���������C���s���t��i�|��ƒ�}�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. N(���R1���R2���R3���R)���t���load_key_bioR+���(���R3���R+���R)���(����(����R���t���load_keyÞ���s���� �c���������C���s���t��t�i�|��i�ƒ��|�ƒ�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���N(���R���R���t���ec_key_read_bioR)���R*���R+���(���R)���R+���(����(����R���RC���ì���s���� �c���������C���s���t��i�|��ƒ�}�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. N(���R1���R2���R3���R)���t���load_pub_key_bio(���R3���R)���(����(����R���t���load_pub_keyø���s���� �c���������C���s:���t��i�|��i�ƒ��ƒ�}�|�d�j�o�t�ƒ��n�t�|�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. i���N(���R���t���ec_key_read_pubkeyR)���R*���R���R'���t���ec_errorR���(���R)���R���(����(����R���RF�����s ���� � c�����������C���s���t��t�i�t�i�ƒ��ƒ�‚�d��S(���N(���R����R���t���err_reason_error_stringt ���err_get_error(����(����(����R���RI�����s����c���������C���s���t��t�i�|��ƒ�d�ƒ�S(���s!��� Create EC_pub from DER. i���N(���R���R���t���ec_key_from_pubkey_derR=���(���R=���(����(����R���t���pub_key_from_der��s�����(0���R9���R;���R1���R���t ���ExceptionR����t���ec_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_sect571r1R���R���RB���R<���RD���RC���RG���RF���RI���RM���(,���RS���RR���Rh���RP���RQ���Rj���RI���RT���R\���RB���RF���RD���Rg���R1���Ra���RZ���RX���R���R����R���Rk���RV���RU���Rb���Rc���RG���R_���R���R`���R;���R[���Rl���Rd���RC���Re���RM���Rf���R]���R^���Ri���Rm���RW���Rn���RY���(����(����R���t���? ���sV��� Š