3 L]q@sdZddlmZmZmZmZddlZddlZddlm Z m Z m Z m Z m Z mZmZddlmZddlmZmZmZddlmZmZmZmZdd lmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*dd l+m,Z,m-Z-Gd d d e(Z.Gd dde)Z/Gddde Z0Gddde(Z1Gddde(Z2Gddde(Z3GdddZ4Gddde%e4Z5Gddde$e4Z6Gddde Z7Gdd d e#Z8Gd!d"d"e#Z9Gd#d$d$e(Z:Gd%d&d&e(Z;Gd'd(d(e(ZGd-d.d.e#Z?Gd/d0d0eZ@Gd1d2d2e ZAGd3d4d4e(ZBGd5d6d6e(ZCGd7d8d8e(ZDGd9d:d:e*ZEGd;d<dd>ee(ZGGd?d@d@e(ZHGdAdBdBe(ZIGdCdDdDe(ZJGdEdFdFe(ZKGdGdHdHe#ZLGdIdJdJee(ZMGdKdLdLe(ZNdS)Ma' ASN.1 type classes for public and private keys. Exports the following items: - DSAPrivateKey() - ECPrivateKey() - EncryptedPrivateKeyInfo() - PrivateKeyInfo() - PublicKeyInfo() - RSAPrivateKey() - RSAPublicKey() Other type classes are defined that help compose the types listed above. )unicode_literalsdivisionabsolute_importprint_functionN)SECP192R1_BASE_POINTSECP224R1_BASE_POINTSECP256R1_BASE_POINTSECP384R1_BASE_POINTSECP521R1_BASE_POINT PrimeCurve PrimePoint)unwrap) type_namestr_clsbyte_cls)_ForceNullParametersDigestAlgorithmEncryptionAlgorithmRSAESOAEPParams)Any Asn1Value BitStringChoiceIntegerIntegerOctetStringNullObjectIdentifierOctetBitString OctetStringParsableOctetStringParsableOctetBitStringSequence SequenceOfSetOf)int_from_bytes int_to_bytesc@s&eZdZdZdefdefdefgZdS)OtherPrimeInfoz= Source: https://tools.ietf.org/html/rfc3447#page-46 primeexponent coefficientN)__name__ __module__ __qualname____doc__r_fieldsr0r07/tmp/pip-install-wfra5znf/asn1crypto/asn1crypto/keys.pyr'6sr'c@seZdZdZeZdS)OtherPrimeInfosz= Source: https://tools.ietf.org/html/rfc3447#page-46 N)r+r,r-r.r' _child_specr0r0r0r1r2Bsr2c@seZdZdZdddZdS)RSAPrivateKeyVersionzX Original Name: Version Source: https://tools.ietf.org/html/rfc3447#page-45 z two-primeZmulti)rrN)r+r,r-r._mapr0r0r0r1r4Jsr4c @sVeZdZdZdefdefdefdefdefdefdefd efd efd ed d ifg ZdS) RSAPrivateKeyz= Source: https://tools.ietf.org/html/rfc3447#page-45 versionmoduluspublic_exponentZprivate_exponentZprime1Zprime2Z exponent1Z exponent2r*Zother_prime_infosoptionalTN)r+r,r-r.r4rr2r/r0r0r0r1r6Vsr6c@s eZdZdZdefdefgZdS) RSAPublicKeyz= Source: https://tools.ietf.org/html/rfc3447#page-44 r8r9N)r+r,r-r.rr/r0r0r0r1r;isr;c@s8eZdZdZdefdefdefdefdefdefgZdS) DSAPrivateKeya& The ASN.1 structure that OpenSSL uses to store a DSA private key that is not part of a PKCS#8 structure. Reversed engineered from english-language description on linked OpenSSL documentation page. Original Name: None Source: https://www.openssl.org/docs/apps/dsa.html r7pqg public_key private_keyN)r+r,r-r.rr/r0r0r0r1r<tsr<c@s$eZdZdZeddZddZdS)_ECPointa  In both PublicKeyInfo and PrivateKeyInfo, the EC public key is a byte string that is encoded as a bit string. This class adds convenience methods for converting to and from the byte string to a pair of integers that are the X and Y coordinates. cCsjttjtj|dd}ttjtj|dd}t||}d}|t||d7}|t||d7}||S)a Creates an ECPoint object from the X and Y integer coordinates of the point :param x: The X coordinate, as an integer :param y: The Y coordinate, as an integer :return: An ECPoint object g @)width)intmathceillogmaxr&)clsxyZx_bytesZy_bytes num_bytesZ byte_stringr0r0r1 from_coordss z_ECPoint.from_coordscCs|j}|dd}|dkrZ|dd}t|d}t|d|}t||d}||fS|tddgkrvttdttd dS) z Returns the X and Y coordinates for this EC point, as native Python integers :return: A 2-element tuple containing integers (X, Y) rrrDNrCzQ Invalid EC public key - first byte is incorrect z| Compressed representations of EC public keys are not supported due to patent US6252960 )nativelenr%set ValueErrorr)selfdataZ first_byte remainingZ field_lenrLrMr0r0r1 to_coordss    z_ECPoint.to_coordsN)r+r,r-r. classmethodrOrYr0r0r0r1rBs rBc@s eZdZdS)ECPointN)r+r,r-r0r0r0r1r[sr[c@s eZdZdS)ECPointBitStringN)r+r,r-r0r0r0r1r\sr\c@seZdZdZddddZdS)SpecifiedECDomainVersionz: Source: http://www.secg.org/sec1-v2.pdf page 104 ZecdpVer1ZecdpVer2ZecdpVer3)rrCN)r+r,r-r.r5r0r0r0r1r]sr]c@seZdZdZdddZdS) FieldTypezR Original Name: None Source: http://www.secg.org/sec1-v2.pdf page 101 prime_fieldcharacteristic_two_field)z1.2.840.10045.1.1z1.2.840.10045.1.2N)r+r,r-r.r5r0r0r0r1r_sr_c@seZdZdZddddZdS)CharacteristicTwoBasiszR Original Name: None Source: http://www.secg.org/sec1-v2.pdf page 102 gn_basistp_basispp_basis)z1.2.840.10045.1.2.1.1z1.2.840.10045.1.2.1.2z1.2.840.10045.1.2.1.3N)r+r,r-r.r5r0r0r0r1rbsrbc@s&eZdZdZdefdefdefgZdS) Pentanomialz: Source: http://www.secg.org/sec1-v2.pdf page 102 Zk1Zk2Zk3N)r+r,r-r.rr/r0r0r0r1rfsrfc@s6eZdZdZdefdefdefgZdZe ee dZ dS)CharacteristicTwoz` Original Name: Characteristic-two Source: http://www.secg.org/sec1-v2.pdf page 101 mbasis parameters)rcrdreN)rirj) r+r,r-r.rrbrr/ _oid_pairrrf _oid_specsr0r0r0r1rgs rgc@s.eZdZdZdefdefgZdZee dZ dS)FieldIDz: Source: http://www.secg.org/sec1-v2.pdf page 100 field_typerj)r`raN)rnrj) r+r,r-r.r_rr/rkrrgrlr0r0r0r1rms  rmc@s,eZdZdZdefdefdeddifgZdS)Curvez: Source: http://www.secg.org/sec1-v2.pdf page 104 abseedr:TN)r+r,r-r.rrr/r0r0r0r1ro-sroc @sJeZdZdZdefdefdefdefdefdedd ifd e dd ifgZ d S) SpecifiedECDomainz: Source: http://www.secg.org/sec1-v2.pdf page 103 r7field_idcurvebaseorderZcofactorr:ThashN) r+r,r-r.r]rmror[rrr/r0r0r0r1rs9s rsc)@sfeZdZdZdddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*(Zd+S), NamedCurvez Various named curves Original Name: None Source: https://tools.ietf.org/html/rfc3279#page-23, https://tools.ietf.org/html/rfc5480#page-5 Z c2pnb163v1Z c2pnb163v2Z c2pnb163v3Z c2pnb176w1Z c2tnb191v1Z c2tnb191v2Z c2tnb191v3Z c2onb191v4Z c2onb191v5Z c2pnb208w1Z c2tnb239v1Z c2tnb239v2Z c2tnb239v3Z c2onb239v4Z c2onb239v5Z c2pnb272w1Z c2pnb304w1Z c2tnb359v1Z c2pnb368w1Z c2tnb431r1Z prime192v2Z prime192v3Z prime239v1Z prime239v2Z prime239v3Z sect163k1Z sect163r2 secp192r1 secp224r1Z sect233k1 secp256r1Z sect233r1Z sect283k1Z sect283r1 secp384r1Z sect409k1Z sect409r1 secp521r1Z sect571k1Z sect571r1)(z1.2.840.10045.3.0.1z1.2.840.10045.3.0.2z1.2.840.10045.3.0.3z1.2.840.10045.3.0.4z1.2.840.10045.3.0.5z1.2.840.10045.3.0.6z1.2.840.10045.3.0.7z1.2.840.10045.3.0.8z1.2.840.10045.3.0.9z1.2.840.10045.3.0.10z1.2.840.10045.3.0.11z1.2.840.10045.3.0.12z1.2.840.10045.3.0.13z1.2.840.10045.3.0.14z1.2.840.10045.3.0.15z1.2.840.10045.3.0.16z1.2.840.10045.3.0.17z1.2.840.10045.3.0.18z1.2.840.10045.3.0.19z1.2.840.10045.3.0.20z1.2.840.10045.3.1.2z1.2.840.10045.3.1.3z1.2.840.10045.3.1.4z1.2.840.10045.3.1.5z1.2.840.10045.3.1.6z 1.3.132.0.1z 1.3.132.0.15z1.2.840.10045.3.1.1z 1.3.132.0.33z 1.3.132.0.26z1.2.840.10045.3.1.7z 1.3.132.0.27z 1.3.132.0.16z 1.3.132.0.17z 1.3.132.0.34z 1.3.132.0.36z 1.3.132.0.37z 1.3.132.0.35z 1.3.132.0.38z 1.3.132.0.39N)r+r,r-r.r5r0r0r0r1ryIsRryc@s&eZdZdZdefdefdefgZdS)ECDomainParametersz: Source: http://www.secg.org/sec1-v2.pdf page 102 specifiednamed implicit_caN)r+r,r-r.rsryrZ _alternativesr0r0r0r1rsrc@seZdZdZddiZdS)ECPrivateKeyVersionzR Original Name: None Source: http://www.secg.org/sec1-v2.pdf page 108 rZ ecPrivkeyVer1N)r+r,r-r.r5r0r0r0r1rsrc@s<eZdZdZdefdefdedddfded ddfgZd S) ECPrivateKeyz: Source: http://www.secg.org/sec1-v2.pdf page 108 r7rArjrT)explicitr:r@rN) r+r,r-r.rrrr\r/r0r0r0r1rs rc@s&eZdZdZdefdefdefgZdS) DSAParamsz Parameters for a DSA public or private key Original Name: Dss-Parms Source: https://tools.ietf.org/html/rfc3279#page-9 r=r>r?N)r+r,r-r.rr/r0r0r0r1rsrc@s&eZdZdZdefdedeifgZdS) Attributezq Source: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.501-198811-S!!PDF-E&type=items page 8 typevaluesspecN)r+r,r-r.rr$rr/r0r0r0r1rsrc@seZdZdZeZdS) Attributesz< Source: https://tools.ietf.org/html/rfc5208#page-3 N)r+r,r-r.rr3r0r0r0r1rsrc@seZdZdZddddZdS)PrivateKeyAlgorithmIdz These OIDs for various public keys are reused when storing private keys inside of a PKCS#8 structure Original Name: None Source: https://tools.ietf.org/html/rfc3279 rsadsaec)z1.2.840.113549.1.1.1z1.2.840.10040.4.1z1.2.840.10045.2.1N)r+r,r-r.r5r0r0r0r1rsrc@s4eZdZdZdefdeddifgZdZee dZ dS) PrivateKeyAlgorithmzm Original Name: PrivateKeyAlgorithmIdentifier Source: https://tools.ietf.org/html/rfc5208#page-3 algorithmrjr:T)rrN)rrj) r+r,r-r.rrr/rkrrrlr0r0r0r1rs rc@seZdZdZdefdefdefdedddfgZd d Z de iZ d Z d Z d Z d Zed d ZddZddZeddZeddZeddZeddZeddZeddZeddZed d!Zd S)"PrivateKeyInfoz< Source: https://tools.ietf.org/html/rfc5208#page-3 r7private_key_algorithmrA attributesrT)Zimplicitr:cCs|ddj}tttd|S)Nrr)rrr)rRr6rr)rVrr0r0r1_private_key_specs z PrivateKeyInfo._private_key_specNcCsDt|t r*t|t r*ttdt||dkrNt|tsFtj|}t}n|dkrt|t sjt j|}t }|d|d<|d|d<|d|d<|d}|d}nH|d krt|t st j|}n|j }|d }|d =nt td t|t}t||d <||d <|}||_td |d<||d<||d<|dkr@||_|S)a' Wraps a private key in a PrivateKeyInfo structure :param private_key: A byte string or Asn1Value object of the private key :param algorithm: A unicode string of "rsa", "dsa" or "ec" :return: A PrivateKeyInfo object zX private_key must be a byte string or Asn1Value, not %s rrr=r>r?r@rArrjzU algorithm must be one of "rsa", "dsa", "ec", not %s rrr7r) isinstancerr TypeErrorrrr6loadrr<rrcopyrUreprrr _algorithmr _public_key)rKrArparamsr@Zprivate_key_algo containerr0r0r1wrapsJ               zPrivateKeyInfo.wrapc Csf|jdkr:|dd}tt|dj|djj|djS|jdkrd|dj}t|d|d d S|jd krb|j\}}|d krttd |dkr|dddkrttdt |ddt |ddt |dd}|ddj dj \}}t |||}n6|dkr>|d kr*ttd|tttttd|}||djdj} tj| j| jSdS)!z Computes the public key corresponding to the current private key. :return: For RSA keys, an RSAPublicKey object. For DSA keys, an Integer object. For EC keys, an ECPointBitString. rrrjr?rAr=rr8r9)r8r9rrz Unable to compute public key for EC key using Implicit CA parameters rrtrnraz Unable to compute public key for EC key over a characteristic two field rurprqrvrrzr{r|r}r~z Unable to compute public key for EC named curve %s, parameters not currently included )rzr{r|r}r~N)rzr{r|r}r~)rrpowrRparsedr;rurUrr r%chosenrYr rrr r r r\rOrLrM) rVrkeyZ curve_typedetailsruZbase_xZbase_yZ base_pointZ public_pointr0r0r1_compute_public_keyLsN           z"PrivateKeyInfo._compute_public_keycCs|jdkr|djS|jdkrT|dd}td|d|d|d |j|djd S|jd kr|dj}|dd|d<|j|d <|Sd S)z Unwraps the private key into an RSAPrivateKey, DSAPrivateKey or ECPrivateKey object :return: An RSAPrivateKey, DSAPrivateKey or ECPrivateKey object rrArrrjrr=r>r?)r7r=r>r?r@rArr@N)rrr<r@)rVroutputr0r0r1rs       zPrivateKeyInfo.unwrapcCsP|jdkrttd|jj|dd}|j}|jdkr@d}n|j}|j|fS)a# Returns information about the curve used for an EC key :raises: ValueError - when the key is not an EC key :return: A two-element tuple, with the first element being a unicode string of "implicit_ca", "specified" or "named". If the first element is "implicit_ca", the second is None. If "specified", the second is an OrderedDict that is the native version of SpecifiedECDomain. If "named", the second is a unicode string of the curve name. rzK Only EC keys have a curve, this key is %s rrjrN)rrUrupperrnamerR)rVrrvaluer0r0r1rus   zPrivateKeyInfo.curvecCsL|jdkrttd|jjtj|dddjdd}|dkrHd Sd S) z Returns the name of the family of hash algorithms used to generate a DSA key :raises: ValueError - when the key is not a DSA key :return: A unicode string of "sha1" or "sha2" rzt Only DSA keys are generated using a hash algorithm, this key is %s rrjr>rCsha1sha2)rrUrrrGrIrR)rVbyte_lenr0r0r1 hash_algos zPrivateKeyInfo.hash_algocCs |jdkr|ddj|_|jS)zO :return: A unicode string of "rsa", "dsa" or "ec" Nrr)rrR)rVr0r0r1rs zPrivateKeyInfo.algorithmcCs|jdkr|jdkr&|djdj}n8|jdkrD|dddj}n|jd kr^|djdj}ttjtj|d |_|jd }|d kr|jd |7_|jS) zU :return: The bit size of the private key, as an integer NrrAr8rrrjr=rrCrr) _bit_sizerrrRrFrGrHrI)rVr(r8r0r0r1bit_sizes     zPrivateKeyInfo.bit_sizecCsttj|jdS)zV :return: The byte size of the private key, as an integer r)rFrGrHr)rVr0r0r1 byte_size szPrivateKeyInfo.byte_sizecCsR|jdkrL|jdkrB|dj}|dr6|dj|_qL|j|_n |j|_|jS)z :return: If an RSA key, an RSAPublicKey object. If a DSA key, an Integer object. If an EC key, an ECPointBitString object. NrrAr@)rrruntagr)rVrr0r0r1r@s     zPrivateKeyInfo.public_keycCs t|j|ddd|jdS)z\ :return: A PublicKeyInfo object derived from this private key. rrj)rrj)rr@) PublicKeyInforr@)rVr0r0r1public_key_info*szPrivateKeyInfo.public_key_infocCsj|jdkrd|dd}|dj}|jdkrFd|dj|djf}n|jd kr||j}d |d j|d j|d j|jf}n|jdkr>|dj}|dkr|jj}|jdkrd|jj}|jd}||7}nr|jdkr|}nb|jdkr>d|jddj}|jd}|d|jddj7}|d|jddj7}||7}t|t rT|jd}t j |j |_|jS)aY Creates a fingerprint that can be compared with a public key to see if the two form a pair. This fingerprint is not compatible with fingerprints generated by any other software. :return: A byte string that is a sha256 hash of selected components (based on the key type) NrrjrArz%d:%dr8r9rz %d:%d:%d:%dr=r>r?rr@rz%s:zutf-8rrrt:rurprq) _fingerprintrrrRr@rrencoderrhashlibsha256digest)rVrrto_hashr@r0r0r1 fingerprint9sD                 zPrivateKeyInfo.fingerprint)r+r,r-r.rrr rr/r_spec_callbacksrrrrrZrrrpropertyrurrrrr@rrr0r0r0r1rs,  DI "    rc@s eZdZdZdefdefgZdS)EncryptedPrivateKeyInfoz< Source: https://tools.ietf.org/html/rfc5208#page-4 Zencryption_algorithmZencrypted_dataN)r+r,r-r.rrr/r0r0r0r1rvsrc@s eZdZdZdefdefgZdS)ValidationParmsz= Source: https://tools.ietf.org/html/rfc3279#page-10 rrZ pgen_counterN)r+r,r-r.rrr/r0r0r0r1rsrc@s>eZdZdZdefdefdefdeddifdeddifgZd S) DomainParametersz= Source: https://tools.ietf.org/html/rfc3279#page-10 r=r?r>jr:TZvalidation_paramsN)r+r,r-r.rrr/r0r0r0r1rs  rc@s eZdZdZddddddZdS) PublicKeyAlgorithmIdzM Original Name: None Source: https://tools.ietf.org/html/rfc3279 r rsaes_oaeprrdh)z1.2.840.113549.1.1.1z1.2.840.113549.1.1.7z1.2.840.10040.4.1z1.2.840.10045.2.1z1.2.840.10046.2.1N)r+r,r-r.r5r0r0r0r1rs rc@s8eZdZdZdefdeddifgZdZee e e dZ dS) PublicKeyAlgorithmzd Original Name: AlgorithmIdentifier Source: https://tools.ietf.org/html/rfc5280#page-18 rrjr:T)rrrrN)rrj) r+r,r-r.rrr/rkrrrrrlr0r0r0r1rsrc@seZdZdZdefdefgZddZdeiZdZ dZ dZ dZ dZ eddZd d Zed d Zed dZeddZeddZeddZeddZeddZeddZdS)rze Original Name: SubjectPublicKeyInfo Source: https://tools.ietf.org/html/rfc5280#page-17 rr@cCs&|ddj}ttttdftd|S)Nr)rrrrr)rRr;rr\)rVrr0r0r1_public_key_specszPublicKeyInfo._public_key_specNcCst|t r*t|t r*ttdt||dkrDttdt|t}t ||d<t |d<|}||d<t|tr|j j }t ||d<|S)a Wraps a public key in a PublicKeyInfo structure :param public_key: A byte string or Asn1Value object of the public key :param algorithm: A unicode string of "rsa" :return: A PublicKeyInfo object zW public_key must be a byte string or Asn1Value, not %s rz> algorithm must "rsa", not %s rrjr@)rrrrrrrUrrrrrdumpr!)rKr@ralgorr0r0r1rs"       zPublicKeyInfo.wrapcCsB|jdkr|djS|jj}|dkr*dnd}ttd||dS)z Unwraps an RSA public key into an RSAPublicKey object. Does not support DSA or EC public keys since they do not have an unwrapped form. :return: An RSAPublicKey object rr@ZECZanrpzj Only RSA public keys may be unwrapped - this key is %s %s public key N)rrrrUr)rVkey_typeZa_anr0r0r1rs   zPublicKeyInfo.unwrapcCsP|jdkrttd|jj|dd}|j}|jdkr@d}n|j}|j|fS)a# Returns information about the curve used for an EC key :raises: ValueError - when the key is not an EC key :return: A two-element tuple, with the first element being a unicode string of "implicit_ca", "specified" or "named". If the first element is "implicit_ca", the second is None. If "specified", the second is an OrderedDict that is the native version of SpecifiedECDomain. If "named", the second is a unicode string of the curve name. rzK Only EC keys have a curve, this key is %s rrjrN)rrUrrrrrR)rVrrrr0r0r1ru's   zPublicKeyInfo.curvecCs^|jdkrttd|jj|dd}|jdkr8dStj|djdd}|d krZd Sd S) a# Returns the name of the family of hash algorithms used to generate a DSA key :raises: ValueError - when the key is not a DSA key :return: A unicode string of "sha1" or "sha2" or None if no parameters are present rzt Only DSA keys are generated using a hash algorithm, this key is %s rrjNr>rCrrrr)rrUrrrRrGrI)rVrjrr0r0r1rIs   zPublicKeyInfo.hash_algocCs |jdkr|ddj|_|jS)zO :return: A unicode string of "rsa", "dsa" or "ec" Nr)rrR)rVr0r0r1rhs zPublicKeyInfo.algorithmcCs|jdkr|jdkr2t|djddd|_nt|jdkrN|djdj}n|jd krj|d d d j}ttjtj|d|_|jd}|d kr|jd|7_|jS)zT :return: The bit size of the public key, as an integer Nrr@rrCrrr8rrrjr=r) rrrSrRrrFrGrHrI)rVr(r8r0r0r1rss     zPublicKeyInfo.bit_sizecCsttj|jdS)zU :return: The byte size of the public key, as an integer r)rFrGrHr)rVr0r0r1rszPublicKeyInfo.byte_sizecCs(|jdkr"tjt|dj|_|jS)ze :return: The SHA1 hash of the DER-encoded bytes of this public key info Nr@)_sha1rrrr)rVr0r0r1rs zPublicKeyInfo.sha1cCs(|jdkr"tjt|dj|_|jS)zh :return: The SHA-256 hash of the DER-encoded bytes of this public key info Nr@)_sha256rrrr)rVr0r0r1rs zPublicKeyInfo.sha256cCsj|jdkrd|ddj}|dd}|dkrR|dj}d|dj|djf}n|d kr|dj}d |d j|d j|d j|jf}n|dkr>|d}|jdkrd|jj}|jd}||j7}nv|jdkr|j}nd|jdkr>d|jddj}|jd}|d|jddj7}|d|jddj7}||j7}t|trT|jd}tj |j |_|jS)aZ Creates a fingerprint that can be compared with a private key to see if the two form a pair. This fingerprint is not compatible with fingerprints generated by any other software. :return: A byte string that is a sha256 hash of selected components (based on the key type) Nrrjrr@z%d:%dr8r9rz %d:%d:%d:%dr=r>r?rrz%s:zutf-8rrrtrrurprq) rrRrrrrrrrrr)rVrrrrr0r0r1rsB                zPublicKeyInfo.fingerprint)r+r,r-r.rr!r/rrrrrrrrZrrrrurrrrrrrr0r0r0r1rs(   + "   r)Or. __future__rrrrrrGZ_elliptic_curverrr r r r r _errorsr_typesrrrZalgosrrrrcorerrrrrrrrrrr r!r"r#r$utilr%r&r'r2r4r6r;r<rBr[r\r]r_rbrfrgrmrorsryrrrrrrrrrrrrrrrr0r0r0r1sZ$ D   F     7