+
    ^eòj»  ã                   ó  € ^ RI Ht ^ RIt^ RIt^ RIt^ RIHtHtHtH	t	H
t
 ^ RIHt ^ RIHtHtHtHt ^ RIHtHtHt ^ RIHtHt ^ RIHt ^R	IHtHtHt ^R
IHt   ! R R]!4      t" ! R R]#4      t$R t%R t&R&R lt'R t(R'R lt)R t*R t+R t,R t-R t.R t/R t0R t1R t2R&R lt3]4R8X  dÚ   ^ RI5t5Rt6]R ,          Pn                  Pq                  4       t9R!t:]5Pj                  ! 4       t;]<! ]:4       F  t=]9]6,          t>K  	  ]?! R"]5Pj                  ! 4       ];,
          ]:,          R#,          R$4       ]5Pj                  ! 4       t;]<! ]:4       F  t=]>]6,          t>K  	  ]?! R%]5Pj                  ! 4       ];,
          ]:,          R#,          R$4       R# R# )(é    )Úprint_functionN)ÚbordÚtobytesÚtostrÚbchrÚ	is_string)ÚInteger)ÚDerObjectIdÚDerOctetStringÚDerSequenceÚDerBitString)Ú_expand_subject_public_key_infoÚ_create_subject_public_key_infoÚ _extract_subject_public_key_info)ÚSHA512ÚSHAKE256)Úget_random_bytes)ÚEccPointÚ	EccXPointÚ_curves)ÚCurveIDc                   ó   € ] tR t^7tRtR# )ÚUnsupportedEccFeature© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    Ú‹/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/Crypto/PublicKey/ECC.pyr   r   7   s   † Ûr    r   c                   óÊ   a € ] tR t^;t o RtR tR tR tR tR t	R t
]R 4       t]R	 4       t]R
 4       tR tR tR tR tR tRR ltR tR tR tR tR tR tR tRtV tR# )ÚEccKeyaÂ  Class defining an ECC key.
Do not instantiate directly.
Use :func:`generate`, :func:`construct` or :func:`import_key` instead.

:ivar curve: The **canonical** name of the curve as defined in the `ECC table`_.
:vartype curve: string

:ivar pointQ: an ECC point representing the public component.
:vartype pointQ: :class:`EccPoint` or :class:`EccXPoint`

:ivar d: A scalar that represents the private component
         in NIST P curves. It is smaller than the
         order of the generator point.
:vartype d: integer

:ivar seed: A seed that represents the private component
            in Ed22519 (32 bytes), Curve25519 (32 bytes),
            Curve448 (56 bytes), Ed448 (57 bytes).
:vartype seed: bytes
c                óÐ
  € \        V4      pVP                  RR4      pVP                  RR4      V n        VP                  RR4      V n        VP                  RR4      V n        Vf)   V P                  '       d   V P                  P
                  pV'       d   \        R\        V4      ,           4      hV\        9  d   \        RV,          4      h\        V,          V n
        V P                  P                  V n        \        V P                  RJ4      \        V P                  RJ4      ,           pV^ 8X  d   V P                  f   \        R4      hR# V^8X  d   \        R	4      hV P                  P                  \        P                  8X  dÛ   V P                  e   \        R
4      h\!        V P                  4      ^ 8w  d   \        R4      h\"        P$                  ! V P                  4      P'                  4       pVR,          V n        \+        VR,          4      pV^ ;;,          ^ø,          uu&   V^,          ^,          ^@,          V^&   \,        P.                  ! VRR7      V n        R# V P                  P                  \        P0                  8X  dÜ   V P                  e   \        R
4      h\!        V P                  4      ^98w  d   \        R4      h\2        P$                  ! V P                  4      P5                  ^r4      pVR,          V n        \+        VR,          4      pV^ ;;,          ^ü,          uu&   V^7;;,          ^€,          uu&   ^ V^8&   \,        P.                  ! VRR7      V n        R# V P                  P                  \        P6                  8X  d¢   V P                  e   \        R
4      h\!        V P                  4      ^ 8w  d   \        R4      h\+        V P                  4      pV^ ;;,          ^ø,          uu&   V^,          ^,          ^@,          V^&   \,        P.                  ! VRR7      V n        R# V P                  P                  \        P8                  8X  d�   V P                  e   \        R
4      h\!        V P                  4      ^88w  d   \        R4      h\+        V P                  4      pV^ ;;,          ^ü,          uu&   V^7;;,          ^€,          uu&   \,        P.                  ! VRR7      V n        R# V P                  e   \        R4      h\-        V P                  4      V n        ^V P                  u;8:  d   V P                  P:                  8  g   M \        R4      hR# )a(  Create a new ECC key

Keywords:
  curve : string
    The name of the curve.
  d : integer
    Mandatory for a private key one NIST P curves.
    It must be in the range ``[1..order-1]``.
  seed : bytes
    Mandatory for a private key on Ed25519 (32 bytes),
    Curve25519 (32 bytes), Curve448 (56 bytes) or Ed448 (57 bytes).
  point : EccPoint or EccXPoint
    Mandatory for a public key. If provided for a private key,
    the implementation will NOT check whether it matches ``d``.

Only one parameter among ``d``, ``seed`` or ``point`` may be used.
ÚcurveNÚdÚseedÚpointúUnknown parameters: zUnsupported curve (%s)zGAt lest one between parameters 'point', 'd' or 'seed' must be specifiedz,Parameters d and seed are mutually exclusivez/Parameter d can only be used with NIST P curvesz0Parameter seed must be 32 bytes long for Ed25519:é    NN:Nr*   NÚlittle©Ú	byteorderz.Parameter seed must be 57 bytes long for Ed448:é9   NN:Nr.   Nz3Parameter seed must be 32 bytes long for Curve25519z1Parameter seed must be 56 bytes long for Curve448z2Parameter 'seed' cannot be used with NIST P-curvesz;Parameter d must be an integer smaller than the curve order)ÚdictÚpopÚ_dÚ_seedÚ_pointr%   Ú	TypeErrorÚstrr   Ú
ValueErrorÚ_curveÚ	canonicalÚintÚidÚ_CurveIDÚED25519Úlenr   ÚnewÚdigestÚ_prefixÚ	bytearrayr	   Ú
from_bytesÚED448r   ÚreadÚ
CURVE25519ÚCURVE448Úorder)ÚselfÚkwargsÚkwargs_Ú
curve_nameÚcountÚ	seed_hashÚtmps   &,     r!   Ú__init__ÚEccKey.__init__Q   sä  € ô& �v“,ˆØ—[‘[ ¨$Ó/ˆ
Ø—+‘+˜c 4Ó(ˆŒØ—[‘[ ¨Ó.ˆŒ
Ø—k‘k '¨4Ó0ˆŒØÒ $§+§+ +ØŸ™×*Ñ*ˆJßÜÐ2´S¸³\ÕAÓBÐBàœWÔ$ÜÐ5¸
ÕBÓCÐCÜ˜jÕ)ˆŒØ—[‘[×*Ñ*ˆŒ
ä�D—G‘G 4Ð'Ó(¬3¨t¯z©zÀÐ/EÓ+FÕFˆà�AŒ:Ø�{‰{Ò"Ü Ð!jÓkÐkÙà�AŒ:ÜÐKÓLÐLð
 �;‰;�>‰>œX×-Ñ-Ô-Ø�w‰wÒ"Ü Ð!RÓSÐSÜ�4—:‘:‹ "Ô$Ü Ð!SÓTÐTÜŸ
š
 4§:¡:Ó.×5Ñ5Ó7ˆIØ$ S�>ˆDŒLÜ˜I c�NÓ+ˆCØ��F�d�N‹FØ˜2•w •~¨Õ-ˆC�‰GÜ×(Ò(¨¸ÔAˆDŽGà�[‰[�^‰^œxŸ~™~Ô-Ø�w‰wÒ"Ü Ð!RÓSÐSÜ�4—:‘:‹ "Ô$Ü Ð!QÓRÐRÜ Ÿš T§Z¡ZÓ0×5Ñ5°cÓ:ˆIØ$ S�>ˆDŒLÜ˜I c�NÓ+ˆCØ��F�d�N‹FØ��G�t�O‹GØˆC�‰GÜ×(Ò(¨¸ÔAˆDŽGà�[‰[�^‰^œx×2Ñ2Ô2Ø�w‰wÒ"Ü Ð!RÓSÐSÜ�4—:‘:‹ "Ô$Ü Ð!VÓWÐWÜ˜DŸJ™JÓ'ˆCØ��F�d�N‹FØ˜2•w •~¨Õ-ˆC�‰GÜ×(Ò(¨¸ÔAˆDŽGØ�[‰[�^‰^œx×0Ñ0Ô0Ø�w‰wÒ"Ü Ð!RÓSÐSÜ�4—:‘:‹ "Ô$Ü Ð!TÓUÐUÜ˜DŸJ™JÓ'ˆCØ��F�d�N‹FØ��G�t�O‹GÜ×(Ò(¨¸ÔAˆDŽGð �z‰zÒ%Ü Ð!UÓVÐVÜ˜dŸg™gÓ&ˆDŒGØ˜Ÿ™Ö3 $§+¡+×"3Ñ"3Ö3Ü Ð!^Ó_Ð_ñ 4r    c                ó®   € \        V\        4      '       g   R # VP                  4       V P                  4       8w  d   R # VP                  V P                  8H  # )F)Ú
isinstancer#   Úhas_privateÚpointQ)rH   Úothers   &&r!   Ú__eq__ÚEccKey.__eq__³   sB   € Ü˜%¤×(Ò(Ùà×ÑÓ $×"2Ñ"2Ó"4Ô4Ùà�|‰|˜tŸ{™{Ñ*Ð*r    c                óZ  € V P                  4       '       dk   V P                  P                  '       d2   R \        \        P
                  ! V P                  4      4      ,          pMR\        V P                  4      ,          pMRpV P                  P                  \        P                  \        P                  39   d8   V P                  P                  pRV P                  P                  W!3,          pV# V P                  P                   w  r$RV P                  P                  W$V3,          pV# )z	, seed=%sz, d=%dÚ z EccKey(curve='%s', point_x=%d%s)z,EccKey(curve='%s', point_x=%d, point_y=%d%s))rS   r7   Ú
is_edwardsr   ÚbinasciiÚhexlifyr2   r9   r1   r:   r;   rE   rF   rT   Úxr8   Úxy)rH   Úextrar]   ÚresultÚys   &    r!   Ú__repr__ÚEccKey.__repr__¼   sÝ   € Ø×Ñ×ÒØ�{‰{×%×%Ð%Ø#¤e¬H×,<Ò,<¸T¿Z¹ZÓ,HÓ&IÕI‘à ¤3 t§w¡w£<Õ/‘àˆEØ�;‰;�>‰>œh×1Ñ1Ü&×/Ñ/ð1ô 1à—‘—‘ˆAØ7¸4¿;¹;×;PÑ;PÐRSÐ:[Õ[ˆFð ˆð —;‘;—>‘>‰DˆAØCÀtÇ{Á{×G\ÑG\Ð^_ÐdiÐFjÕjˆFØˆr    c                ó   € V P                   RJ# )zJ``True`` if this key can be used for making signatures or decrypting data.N)r1   ©rH   s   &r!   rS   ÚEccKey.has_privateÍ   s   € ð �w‰w˜dÐ"Ð"r    c                óª  € ^ Tu;8  d   V P                   P                  8  g   Q h Q hV P                   P                  p\        P                  ! ^VR7      pV P                  V,          pWB,          P                  V4      pV P                   P                  V,          P                  V,          pWdV,          WW,          ,           ,          V,          pWx3# )r   )Úmin_inclusiveÚmax_exclusive)r7   rG   r	   Úrandom_ranger1   ÚinverseÚGr]   )	rH   ÚzÚkrG   ÚblindÚblind_dÚinv_blind_kÚrÚss	   &&&      r!   Ú_signÚEccKey._signÓ   s¦   € Ø�1Ö(�t—{‘{×(Ñ(Ô(Ð(Ñ(Ð(Ð(à—‘×!Ñ!ˆÜ×$Ò$°1Ø38ô:ˆð —'‘'˜E•/ˆØ•y×)Ñ)¨%Ó0ˆà�[‰[�]‰]˜QÕ×!Ñ! EÕ)ˆØ 1�9 w¥{Õ2Õ3°eÕ;ˆØˆvˆr    c                óF  € V P                   P                  pV^,          P                  V4      pV P                   P                  WA,          V,          ,          pV P                  WB^ ,          ,          V,          ,          pWV,           P
                  V,          V^ ,          8H  # )é   )r7   rG   rk   rl   rT   r]   )rH   rm   ÚrsrG   ÚsinvÚpoint1Úpoint2s   &&&    r!   Ú_verifyÚEccKey._verifyâ   sq   € Ø—‘×!Ñ!ˆØ�!�u�}‰}˜UÓ#ˆØ—‘—‘ 4¥8¨uÕ"4Õ5ˆØ—‘ ¨1­¥°Õ 6Õ7ˆØ•×"Ñ" UÕ*¨b°­eÑ3Ð3r    c                ó\   € V P                  4       '       g   \        R 4      hV P                  # ©zThis is not a private ECC key)rS   r6   r1   re   s   &r!   r&   ÚEccKey.dé   s&   € à×Ñ×!Ò!ÜÐ<Ó=Ð=Ø�w‰wˆr    c                ó\   € V P                  4       '       g   \        R 4      hV P                  # r   )rS   r6   r2   re   s   &r!   r'   ÚEccKey.seedï   s'   € à×Ñ×!Ò!ÜÐ<Ó=Ð=Ø�z‰zÐr    c                óŽ   € V P                   f-   V P                  P                  V P                  ,          V n         V P                   # ©N)r3   r7   rl   r1   re   s   &r!   rT   ÚEccKey.pointQõ   s.   € à�;‰;ÒØŸ+™+Ÿ-™-¨$¯'©'Õ1ˆDŒKØ�{‰{Ðr    c                óX   € \        V P                  P                  V P                  R7      # )zFA matching ECC public key.

Returns:
    a new :class:`EccKey` object
)r%   r(   )r#   r7   r8   rT   re   s   &r!   Ú
public_keyÚEccKey.public_keyû   s   € ô ˜DŸK™K×1Ñ1¸¿¹ÔEÐEr    c                óþ  € V P                   P                  '       g   \        R 4      hV P                  P	                  4       pV'       d^   V P                  P
                  P                  4       '       d   RpMRpVV P                  P                  P                  V4      ,           pV# RV P                  P                  P                  V4      ,           V P                  P
                  P                  V4      ,           pV# )z/SEC1 format is only supported for NIST P curvesó   ó   ó   )	r7   Úis_weierstrassr6   rT   Úsize_in_bytesra   Úis_oddr]   Úto_bytes)rH   ÚcompressÚmodulus_bytesÚ
first_byter‡   s   &&   r!   Ú_export_SEC1ÚEccKey._export_SEC1  sÆ   € Ø�{‰{×)×)Ð)ÜÐNÓOÐOð Ÿ™×1Ñ1Ó3ˆçØ�{‰{�}‰}×#Ñ#×%Ò%Ø$‘
à$�
Ø$ØŸ+™+Ÿ-™-×0Ñ0°Ó?õ@ˆJð Ðð "ØŸ+™+Ÿ-™-×0Ñ0°Ó?õ@àŸ+™+Ÿ-™-×0Ñ0°Ó?õ@ˆJð Ðr    c                óÞ  € V P                   P                  w  rV P                  P                  \        P
                  8X  d?   \        VP                  ^ RR7      4      pV^,          ^,          V^,          ,          V^&   MdV P                  P                  \        P                  8X  d1   \        VP                  ^9RR7      4      pV^,          ^,          V^8&   M\        R4      h\        V4      # )r*   r+   r,   zNot an EdDSA key to export)rT   r^   r7   r:   r;   r<   rA   r�   rC   r6   Úbytes)rH   r]   ra   r`   s   &   r!   Ú_export_eddsa_publicÚEccKey._export_eddsa_public   sª   € Ø�{‰{�~‰~‰ˆØ�;‰;�>‰>œX×-Ñ-Ô-Ü˜qŸz™z¨"¸˜zÓAÓBˆFØ˜q�5 Q�,¨&°­*Õ4ˆF�2ŠJØ�[‰[�^‰^œxŸ~™~Ô-Ü˜qŸz™z¨"¸˜zÓAÓBˆFØ˜a�% A�ˆF�2ŠJäÐ9Ó:Ð:Ü�V‹}Ðr    c                óþ   € V P                   P                  '       g   \        R 4      hV P                  P                  pV P                  P                  4       p\        VP                  VRR7      4      p\        V4      # )zNot a Montgomery key to exportr+   r,   )	r7   Úis_montgomeryr6   rT   r]   rŽ   rA   r�   r—   )rH   r]   Ú
field_sizer`   s   &   r!   Ú_export_montgomery_publicÚ EccKey._export_montgomery_public,  s^   € Ø�{‰{×(×(Ð(ÜÐ=Ó>Ð>Ø�K‰K�M‰MˆØ—[‘[×.Ñ.Ó0ˆ
Ü˜1Ÿ:™: j¸H˜:ÓEÓFˆÜ�V‹}Ðr    c                ó”  € V P                   P                  '       d*   V P                   P                  pV P                  4       pR pMwV P                   P                  '       d*   V P                   P                  pV P                  4       pR pM2RpV P                  V4      p\        V P                   P                  4      p\        VVV4      # )Nú1.2.840.10045.2.1)	r7   rZ   Úoidr˜   r›   r�   r”   r
   r   )rH   r‘   r¡   r‡   Úparamss   &&   r!   Ú_export_subjectPublicKeyInfoÚ#EccKey._export_subjectPublicKeyInfo4  sž   € Ø�;‰;×!×!Ð!Ø—+‘+—/‘/ˆCØ×2Ñ2Ó4ˆJØ‰FØ�[‰[×&×&Ð&Ø—+‘+—/‘/ˆCØ×7Ñ7Ó9ˆJØ‰Fà%ˆCØ×*Ñ*¨8Ó4ˆJÜ  §¡§¡Ó1ˆFä.¨sØ/9Ø/5ó7ð 	7r    c                óþ  € V P                  4       '       g   Q hV P                  P                  4       pR V P                  P                  P	                  V4      ,           V P                  P
                  P	                  V4      ,           p^\        V P                  P	                  V4      4      \        V P                  P                  ^ R7      \        V^R7      .pV'       g   V^ \        V4      P                  4       # )rŒ   ©Úexplicit)rS   rT   rŽ   r]   r�   ra   r   r&   r
   r7   r¡   r   r   Úencode)rH   Úinclude_ec_paramsr’   r‡   Úseqs   &&   r!   Ú_export_rfc5915_private_derÚ"EccKey._export_rfc5915_private_derF  sÃ   € à×Ñ×!Ò!Ð!Ð!ð Ÿ™×1Ñ1Ó3ˆØØ—k‘k—m‘m×,Ñ,¨]Ó;õ<à—k‘k—m‘m×,Ñ,¨]Ó;õ<ˆ
ð Ü˜dŸf™fŸo™o¨mÓ<Ó=Ü˜4Ÿ;™;Ÿ?™?°QÔ7Ü˜J°Ô3ð5ˆ÷
 !Ø�A�ä˜3Ó×&Ñ&Ó(Ð(r    c                ó„  € ^ RI Hp VP                  RR4      e   RV9  d   \        R4      hV P                  e=   V P
                  P                  p\        V P                  4      P                  4       pRpM3RpV P                  RR7      p\        V P
                  P                  4      pVP                  ! VV3R	V/VB pV# )
r   ©ÚPKCS8Ú
passphraseNÚ
protectionz3At least the 'protection' parameter must be presentr    F)r©   Ú
key_params)Ú	Crypto.IOr¯   Úgetr6   r2   r7   r¡   r   r¨   r«   r
   Úwrap)rH   rI   r¯   r¡   Úprivate_keyr¢   r`   s   &,     r!   Ú_export_pkcs8ÚEccKey._export_pkcs8a  s²   € Ý#à�:‰:�l DÓ)Ò5¸,ÈfÔ:TÜÐRÓSÐSà�:‰:Ò!Ø—+‘+—/‘/ˆCÜ(¨¯©Ó4×;Ñ;Ó=ˆKØ‰Fà%ˆCØ×:Ñ:ÈUÐ:ÓSˆKÜ  §¡§¡Ó1ˆFà—’˜KØñ&à'-ð&ð %ñ&ˆð ˆr    c                óT   € ^ RI Hp V P                  V4      pVP                  VR4      # )r   ©ÚPEMz
PUBLIC KEY)r³   r»   r£   r¨   )rH   r‘   r»   Úencoded_ders   &&  r!   Ú_export_public_pemÚEccKey._export_public_pemv  s&   € Ý!à×7Ñ7¸ÓAˆØ�z‰z˜+ |Ó4Ð4r    c                óX   € ^ RI Hp V P                  4       pVP                  ! VRV3/ VB # )r   rº   zEC PRIVATE KEY)r³   r»   r«   r¨   ©rH   r°   rI   r»   r¼   s   &&,  r!   Ú_export_private_pemÚEccKey._export_private_pem|  s,   € Ý!à×6Ñ6Ó8ˆØ�zŠz˜+Ð'7¸ÑNÀvÑNÐNr    c                óR   € ^ RI Hp V P                  4       pVP                  VR4      # )r   rº   zPRIVATE KEY)r³   r»   r·   r¨   )rH   r»   r¼   s   &  r!   Ú(_export_private_clear_pkcs8_in_clear_pemÚ/EccKey._export_private_clear_pkcs8_in_clear_pem‚  s$   € Ý!à×(Ñ(Ó*ˆØ�z‰z˜+ }Ó5Ð5r    c                ó’   € ^ RI Hp V'       g   Q hRV9  d   \        R4      hV P                  ! RRV/VB pVP	                  VR4      # )r   rº   r±   z5At least the 'protection' parameter should be presentr°   zENCRYPTED PRIVATE KEYr   )r³   r»   r6   r·   r¨   rÀ   s   &&,  r!   Ú,_export_private_encrypted_pkcs8_in_clear_pemÚ3EccKey._export_private_encrypted_pkcs8_in_clear_pemˆ  sK   € Ý!çÐˆzØ˜vÔ%ÜÐTÓUÐUØ×(Ò(ÑI°JÐIÀ&ÑIˆØ�z‰z˜+Ð'>Ó?Ð?r    c                ó  € V P                  4       '       d   \        R 4      hV P                  P                  pVf   \        RV P                  ,          4      hVR8X  d)   V P                  4       p\        V4      \        V4      3pEMV P                  P                  4       pV'       db   ^V P                  P                  P                  4       ,           p\        V4      V P                  P                  P                  V4      ,           pMVRV P                  P                  P                  V4      ,           V P                  P                  P                  V4      ,           pVP                  R4      ^,          p\        V4      \        V4      V3pRP                  V Uu. uF*  p\         P"                  ! R\%        V4      4      V,           NK,  	  up4      p	VR,           \'        \(        P*                  ! V	4      4      ,           # u upi )z"Cannot export OpenSSH private keysz Cannot export %s keys as OpenSSHússh-ed25519rŒ   Ú-r    ú>IÚ )rS   r6   r7   Úopensshr%   r˜   r   rT   rŽ   ra   r�   r   r]   r�   ÚsplitÚjoinÚstructÚpackr=   r   r[   Ú
b2a_base64)
rH   r‘   Údescr‡   Úcompsr’   r“   Úmiddler]   Úblobs
   &&        r!   Ú_export_opensshÚEccKey._export_openssh‘  s…  € Ø×Ñ×ÒÜÐAÓBÐBà�{‰{×"Ñ"ˆàŠ<ÜÐ?À$Ç*Á*ÕLÓMÐMØ�]Ô"Ø×2Ñ2Ó4ˆJÜ˜T“]¤G¨JÓ$7Ð8ŠEà ŸK™K×5Ñ5Ó7ˆMçØ §¡§¡×!5Ñ!5Ó!7Õ7�
Ü" :Ó.Ø"Ÿk™kŸm™m×4Ñ4°]ÓCõD‘
ð &Ø"Ÿk™kŸm™m×4Ñ4°]ÓCõDà"Ÿk™kŸm™m×4Ñ4°]ÓCõD�
ð —Z‘Z “_ QÕ'ˆFÜ˜T“]¤G¨F£O°ZÐ@ˆEà�x‰xÁÓFÁ¸1œŸš T¬3¨q«6Ó2°Q×6Ð6ÁÑFÓGˆØ�c�zœE¤(×"5Ò"5°dÓ";Ó<Õ<Ð<ùò Gs   Æ0Hc                óZ  € VP                  4       pVP                  R4      pVR9  d   \        RV,          4      hVP                  RR4      pV P                  4       '       Edg   VP                  R	R
4      p\	        V4      '       d   \        V4      pV'       g   \        R4      hVP                  RR4      pVRJ da   V P                  P                  '       d   \        R4      hV P                  P                  '       d   \        R4      hRV9   d   \        R4      hVR8X  dG   V'       d,   V'       d   V P                  ! V3/ VB # V P                  4       # V P                  ! V3/ VB # VR8X  dH   V'       d   V'       g   \        R4      hV'       d   V P                  ! RR	V/VB # V P                  4       # \        RV,          4      hV'       d   \        RV,          4      hVR8X  d   V P                  V4      # VR8X  d   V P                  V4      # VR8X  d   V P!                  V4      # VR8X  dj   V P                  P                  '       d   V P#                  4       # V P                  P                  '       d   V P%                  4       # V P!                  V4      # V P'                  V4      # )aŠ  Export this ECC key.

Args:
  format (string):
    The output format:

    - ``'DER'``. The key will be encoded in ASN.1 DER format (binary).
      For a public key, the ASN.1 ``subjectPublicKeyInfo`` structure
      defined in `RFC5480`_ will be used.
      For a private key, the ASN.1 ``ECPrivateKey`` structure defined
      in `RFC5915`_ is used instead (possibly within a PKCS#8 envelope,
      see the ``use_pkcs8`` flag below).
    - ``'PEM'``. The key will be encoded in a PEM_ envelope (ASCII).
    - ``'OpenSSH'``. The key will be encoded in the OpenSSH_ format
      (ASCII, public keys only).
    - ``'SEC1'``. The public key (i.e., the EC point) will be encoded
      into ``bytes`` according to Section 2.3.3 of `SEC1`_
      (which is a subset of the older X9.62 ITU standard).
      Only for NIST P-curves.
    - ``'raw'``. The public key will be encoded as ``bytes``,
      without any metadata.

      * For NIST P-curves: equivalent to ``'SEC1'``.
      * For Ed25519 and Ed448: ``bytes`` in the format
        defined in `RFC8032`_.
      * For Curve25519 and Curve448: ``bytes`` in the format
        defined in `RFC7748`_.

  passphrase (bytes or string):
    (*Private keys only*) The passphrase to protect the
    private key.

  use_pkcs8 (boolean):
    (*Private keys only*)
    If ``True`` (default and recommended), the `PKCS#8`_ representation
    will be used.
    It must be ``True`` for Ed25519, Ed448, Curve25519, and Curve448.

    If ``False`` and a passphrase is present, the obsolete PEM
    encryption will be used.

  protection (string):
    When a private key is exported with password-protection
    and PKCS#8 (both ``DER`` and ``PEM`` formats), this parameter MUST be
    present,
    For all possible protection schemes,
    refer to :ref:`the encryption parameters of PKCS#8<enc_params>`.
    It is recommended to use ``'PBKDF2WithHMAC-SHA512AndAES128-CBC'``.

  compress (boolean):
    If ``True``, the method returns a more compact representation
    of the public key, with the X-coordinate only.

    If ``False`` (default), the method returns the full public key.

    This parameter is ignored for Ed25519/Ed448/Curve25519/Curve448,
    as compression is mandatory.

  prot_params (dict):
    When a private key is exported with password-protection
    and PKCS#8 (both ``DER`` and ``PEM`` formats), this dictionary
    contains the  parameters to use to derive the encryption key
    from the passphrase.
    For all possible values,
    refer to :ref:`the encryption parameters of PKCS#8<enc_params>`.
    The recommendation is to use ``{'iteration_count':21000}`` for PBKDF2,
    and ``{'iteration_count':131072}`` for scrypt.

.. warning::
    If you don't provide a passphrase, the private key will be
    exported in the clear!

.. note::
    When exporting a private key with password-protection and `PKCS#8`_
    (both ``DER`` and ``PEM`` formats), any extra parameters
    to ``export_key()`` will be passed to :mod:`Crypto.IO.PKCS8`.

.. _PEM:        http://www.ietf.org/rfc/rfc1421.txt
.. _`PEM encryption`: http://www.ietf.org/rfc/rfc1423.txt
.. _OpenSSH:    http://www.openssh.com/txt/rfc5656.txt
.. _RFC5480:    https://tools.ietf.org/html/rfc5480
.. _SEC1:       https://www.secg.org/sec1-v2.pdf
.. _RFC7748:    https://tools.ietf.org/html/rfc7748

Returns:
    A multi-line string (for ``'PEM'`` and ``'OpenSSH'``) or
    ``bytes`` (for ``'DER'``, ``'SEC1'``, and ``'raw'``) with the encoded key.
Úformatr»   ÚDERÚSEC1ÚrawzUnknown format '%s'r‘   Fr°   NzEmpty passphraseÚ	use_pkcs8Tz%'pkcs8' must be True for EdDSA curvesz#'pkcs8' must be True for Curve25519r±   z)'protection' is only supported for PKCS#8z8Private keys can only be encrpyted with DER using PKCS#8z2Private keys cannot be exported in the '%s' formatzUnexpected parameters: '%s')r»   rÜ   ÚOpenSSHrÝ   rÞ   r   )Úcopyr0   r6   rS   r   r   r7   rZ   r›   rÇ   rÄ   rÁ   r·   r«   r½   r£   r”   r˜   r�   rØ   )rH   rI   ÚargsÚ
ext_formatr‘   r°   rß   s   &,     r!   Ú
export_keyÚEccKey.export_key®  sd  € ðt �{‰{‹}ˆØ—X‘X˜hÓ'ˆ
ØÐEÔEÜÐ2°ZÕ?Ó@Ð@à—8‘8˜J¨Ó.ˆà×Ñ×ÓØŸ™ ,°Ó5ˆJÜ˜×$Ò$Ü$ ZÓ0�
ß!Ü$Ð%7Ó8Ð8àŸ™ ¨dÓ3ˆIØ˜EÓ!Ø—;‘;×)×)Ð)Ü$Ð%LÓMÐMØ—;‘;×,×,Ð,Ü$Ð%JÓKÐKØ 4Ô'Ü$Ð%PÓQÐQà˜UÔ"ßß!Ø#×PÒPÐQ[ÑdÐ_cÑdÐdà#×LÑLÓNÐNà×3Ò3°JÑGÀ$ÑGÐGØ˜uÔ$ç§iÜ$Ð%_Ó`Ð`ßØ×-Ò-ÑL¸ÐLÀtÑLÐLà×;Ñ;Ó=Ð=ä ð "6Ø8Bõ"Có Dð D÷ Ü Ð!>ÀÕ!EÓFÐFØ˜UÔ"Ø×.Ñ.¨xÓ8Ð8Ø˜uÔ$Ø×8Ñ8¸ÓBÐBØ˜vÔ%Ø×(Ñ(¨Ó2Ð2Ø˜uÔ$Ø—;‘;×)×)Ð)Ø×4Ñ4Ó6Ð6Ø—[‘[×.×.Ð.Ø×9Ñ9Ó;Ð;à×,Ñ,¨XÓ6Ð6à×+Ñ+¨HÓ5Ð5r    )r7   r1   r3   r@   r2   r%   N)T)r   r   r   r   Ú__doc__rO   rV   rb   rS   rt   r|   Úpropertyr&   r'   rT   r‡   r”   r˜   r�   r£   r«   r·   r½   rÁ   rÄ   rÇ   rØ   rä   r   Ú__classdictcell__)Ú__classdict__s   @r!   r#   r#   ;   s²   ø‡ € ñò*``òD+òò"#òò4ð ñó ðð
 ñó ðð
 ñó ðò
Fòò8
òò7ô$)ò6ò*5òOò6ò@ò=÷:U6ð U6r    r#   c                 óª  € V P                  R4      p\        V,          pV P                  R\        4      pV '       d   \        R\	        V 4      ,           4      h\        V,          P
                  \        P                  8X  d   V! ^ 4      p\        WR7      pV# \        V,          P
                  \        P                  8X  d   V! ^94      p\        WR7      pV# \        V,          P
                  \        P                  8X  d=   V! ^ 4      p\        WR7      p\        V,          P                  VP                  4       V# \        V,          P
                  \        P                  8X  d=   V! ^84      p\        WR7      p\        V,          P                  VP                  4       V# \        P                  ! ^VP                   VR7      p\        WR7      pV# )a  Generate a new private key on the given curve.

Args:

  curve (string):
    Mandatory. It must be a curve name defined in the `ECC table`_.

  randfunc (callable):
    Optional. The RNG to read randomness from.
    If ``None``, :func:`Crypto.Random.get_random_bytes` is used.
r%   Úrandfuncr)   ©r%   r'   )rh   ri   rë   )r%   r&   )r0   r   r   r4   r5   r:   r;   r<   r#   rC   rE   ÚvalidaterT   rF   r	   rj   rG   )rI   rK   r%   rë   r'   Únew_keyr&   s   ,      r!   Úgeneraterï   F  sr  € ð —‘˜GÓ$€JÜ�JÕ€EØ�z‰z˜*Ô&6Ó7€HßÜÐ.´°V³Õ<Ó=Ð=äˆzÕ×Ñ¤×!1Ñ!1Ô1Ù˜‹|ˆÜ˜zÔ5ˆð$ €Nô# 
�Õ	×	Ñ	¤8§>¡>Ô	1Ù˜‹|ˆÜ˜zÔ5ˆð €Nô 
�Õ	×	Ñ	¤8×#6Ñ#6Ô	6Ù˜‹|ˆÜ˜zÔ5ˆÜ�
Õ×$Ñ$ W§^¡^Ô4ð €Nô 
�Õ	×	Ñ	¤8×#4Ñ#4Ô	4Ù˜‹|ˆÜ˜zÔ5ˆÜ�
Õ×$Ñ$ W§^¡^Ô4ð €Nô × Ò ¨qØ/4¯{©{Ø*2ô4ˆô ˜zÔ/ˆà€Nr    c                 óô  € V R,          p\         V,          pV P                  RR4      pV P                  RR4      pRV 9   d   \        R4      hVP                  \        P
                  8X  d;   Ve   \        W14      V R&   \        R/ V B pVP                  VP                  4       V# VP                  \        P                  8X  d;   Ve   \        W14      V R&   \        R/ V B pVP                  VP                  4       V# RW439  d   \        W4V4      V R&   \        R/ V B pVP                  4       '       dB   RV 9   d;   VP                  VP                  ,          pVP                  W438w  d   \!        R4      hV# )	ay  Build a new ECC key (private or public) starting
from some base components.

In most cases, you will already have an existing key
which you can read in with :func:`import_key` instead
of this function.

Args:
  curve (string):
    Mandatory. The name of the elliptic curve, as defined in the `ECC table`_.

  d (integer):
    Mandatory for a private key and a NIST P-curve (e.g., P-256).
    It must be an integer in the range ``[1..order-1]``.

  seed (bytes):
    Mandatory for a private key and curves Ed25519 (32 bytes),
    Curve25519 (32 bytes), Curve448 (56 bytes) and Ed448 (57 bytes).

  point_x (integer):
    The X coordinate (affine) of the ECC point.
    Mandatory for a public key.

  point_y (integer):
    The Y coordinate (affine) of the ECC point.
    Mandatory for a public key,
    except for Curve25519 and Curve448.

Returns:
  :class:`EccKey` : a new ECC key object
r%   Úpoint_xNÚpoint_yr(   zUnknown keyword: pointz(Private and public ECC keys do not matchr   )r   r0   r4   r:   r;   rE   r   r#   rí   rT   rF   r   rS   rl   r&   r^   r6   )rI   rK   r%   rñ   rò   rî   Úpub_keys   ,      r!   Ú	constructrô   p  sV  € ðB ˜•€JÜ�JÕ€EØ�j‰j˜ DÓ)€GØ�j‰j˜ DÓ)€Gà�&ÔÜÐ0Ó1Ð1à‡x�x”8×&Ñ&Ô&àÒÜ'¨Ó<ˆF�7‰OÜÑ"˜6Ñ"ˆØ�‰�w—~‘~Ô&ð, €Nð) 
�‰”X×&Ñ&Ô	&àÒÜ'¨Ó<ˆF�7‰OÜÑ"˜6Ñ"ˆØ�‰�w—~‘~Ô&ð €Nð ˜Ð)Ô)Ü& w¸ÓDˆF�7‰OÜÑ"˜6Ñ"ˆð ×Ñ× Ò  W°Ô%6Ø—g‘g §	¡	Õ)ˆGØ�z‰z˜gÐ/Ô/Ü Ð!KÓLÐLà€Nr    c                ó  € \         P                  ! 4        F(  w  r4V'       d   VP                  V8X  d    M8W#8X  g   K(   M.	  V'       d   \        RV,          4      h\        RV,          4      hVP                  P                  4       p\        V ^ ,          4      pV^8X  dj   \        V 4      ^^V,          ,           8w  d   \        R4      h\        P                  ! V ^V^,            4      p\        P                  ! W^,           R 4      pMóVR9   dâ   \        V 4      ^V,           8w  d   \        R4      h\        P                  ! V R,          4      pV^,          V^,          ,
          VP                  ,           P                  VP                  4      pV^8X  d*   VP                  4       '       d   VP                  V,
          pV^8X  d*   VP                  4       '       d   VP                  V,
          pM\        R4      h\        W7VR7      # )	zóConvert an encoded EC point into an EccKey object

ec_point: byte string with the EC point (SEC1-encoded)
curve_oid: string with the name the curve
curve_name: string with the OID of the curve

Either curve_id or curve_name must be specified

úUnsupported ECC curve (OID: %s)zUnsupported ECC curve (%s)zIncorrect EC point lengthN:rw   NNzIncorrect EC point encoding©r%   rñ   rò   ©é   é   )r   Úitemsr¡   r   ÚprŽ   r   r=   r6   r	   rB   ÚbÚsqrtr�   Úis_evenrô   )	Úec_pointÚ	curve_oidrK   Ú_curve_namer%   r’   Ú
point_typer]   ra   s	   &&&      r!   Ú_import_public_derr  ·  s•  € ô &ŸmšmžoÑˆß˜Ÿ™ iÔ/ÙØÖ$Ùñ	 .÷ Ü'Ð(IÈIÕ(UÓVÐVä'Ð(DÀzÕ(QÓRÐRð —G‘G×)Ñ)Ó+€MÜ�h˜q•kÓ"€Jð �TÔÜˆx‹=˜Q  ]Õ!2Õ2Ô3ÜÐ8Ó9Ð9Ü×Ò˜x¨¨-¸­/Ð:Ó;ˆÜ×Ò˜x°a­Ð(8Ð9Ó:‰à	�|Ô	#Üˆx‹=˜Q Õ.Ô/ÜÐ8Ó9Ð9Ü×Ò˜x¨�|Ó,ˆà��T�A�a•C�Z˜%Ÿ'™'Õ!×'Ñ'¨¯©Ó0ˆØ˜Ô !§(¡(§*¢*Ø—‘˜!•ˆAØ˜Ô !§)¡)§+¢+Ø—‘˜!•ˆAøäÐ6Ó7Ð7ä˜;¸1Ô=Ð=r    c                ó`  € \        V 4      w  r#pRpRR\        3RR\        3/pRR\        3RR\        3/pW%9   dK   V'       g   \        R	V,          4      h \        4       P                  V4      P                  p\        Y8R7      # W&9   d<   Wb,          w  ršV'       d   \        RV,          4      hV
! V4      w  r¼\        W¼V	R7      # W'9   d9   Wr,          w  r�V'       d   \        RV,          4      hV! V4      p\        W¹R7      # \        RV,          4      h  \
         d    \        R
4      hi ; i)z4Convert a subjectPublicKeyInfo into an EccKey objectú1.3.101.112ÚEd25519ú1.3.101.113ÚEd448ú1.3.101.110Ú
Curve25519ú1.3.101.111ÚCurve448z%Missing ECC parameters for ECC OID %szError decoding namedCurve©r  z(Unexpected ECC parameters for ECC OID %s)rñ   rò   r%   )rñ   r%   zUnsupported ECC OID: %s©r    z1.3.132.1.12z1.3.132.1.13)r   Ú_import_ed25519_public_keyÚ_import_ed448_public_keyÚ_import_curve25519_public_keyÚ_import_curve448_public_keyr6   r
   ÚdecodeÚvaluer  rô   r   )ÚencodedrI   r¡   r   r¢   Únist_p_oidsÚ
eddsa_oidsÚxdh_oidsr  rK   Úimport_eddsa_public_keyr]   ra   Úimport_xdh_public_keys   &*            r!   Ú_import_subjectPublicKeyInfor  ï  sI  € ô <¸GÓDÑ€C�6ð€Kð 	˜	Ô#=Ð>Ø˜Ô#;Ð<ð€Jð
 	˜Ô&CÐDØ˜
Ô$?Ð@ð€Hð
 Ô÷ ÜÐDÀsÕJÓKÐKð	:Ü#›×,Ñ,¨VÓ4×:Ñ:ˆIô
 " (Ô@Ð@à	Ô	à.8­oÑ+ˆ
÷ ÜÐGÈ#ÕMÓNÐNá& xÓ0‰ˆÜ °ZÔ@Ð@à	ŒØ,4­MÑ)ˆ
÷ ÜÐGÈ#ÕMÓNÐNá! (Ó+ˆÜ Ô5Ð5ô $Ð$=ÀÕ$CÓDÐDøô9 ô 	:ÜÐ8Ó9Ð9ð	:ús   Á#D ÄD-c                 ó  € \        4       P                  V RR7      pV^ ,          ^8w  d   \        R4      h\        4       P                  V^,          4      P                  p^pV\        V4      8  dM    \        ^ R7      P                  W5,          4      P                  pVe   Wb8w  d   \        R4      hTpV^,          pVf   \        R4      h\        P                  ! 4        F  w  rxVP                  V8X  g   K   M	  \        RV,          4      hVP                  P                  4       p	\        V4      V	8w  d   \        R4      hR;r«V\        V4      8  dn    \        ^R7      P                  W5,          4      P                  p\        WÂR	7      pVP                   P"                  p
VP                   P$                  pV^,          p\&        P(                  ! V4      p\+        W~W«R
7      #   \         d     EL8i ; i  \         d     LBi ; i)rù   )Únr_elementsz!Incorrect ECC private key versionr¦   NzCurve mismatchzNo curve foundrö   zPrivate key is too smallr  )r%   r&   rñ   rò   ©rù   rú   é   )r   r  r6   r   Úpayloadr=   r
   r  r   rû   r¡   r   rü   rŽ   r   r  rT   r]   ra   r	   rB   rô   )r  r°   r  Úec_private_keyÚscalar_bytesÚnext_elementÚ
parametersrK   r%   r’   rñ   rò   Úpublic_key_encr‡   r&   s   &&&            r!   Ú_import_rfc5915_derr'  2  sÙ  € ô !“]×)Ñ)¨'¸yÐ)ÓI€NØ�aÕ˜AÔÜÐ<Ó=Ð=ä!Ó#×*Ñ*¨>¸!Õ+<Ó=×EÑE€Là€Lð ”c˜.Ó)Ô)ð	Ü$¨aÔ0×7Ñ7¸Õ8TÓU×[Ñ[ˆJØÒ$¨Ô)@Ü Ð!1Ó2Ð2Ø"ˆIØ˜AÕˆLð ÒÜÐ)Ó*Ð*ä$Ÿ]š]ž_Ñˆ
Ø�9‰9˜	Ö!Ùñ -ô $Ð$EÈ	Õ$QÓRÐRà—G‘G×)Ñ)Ó+€MÜ
ˆ<Ó˜MÔ)ÜÐ3Ó4Ð4ð Ð€GØ”c˜.Ó)Ô)ð	Ü)°1Ô5×<Ñ<¸^Õ=YÓZ×`Ñ`ˆNÜ+¨NÔPˆJØ ×'Ñ'×)Ñ)ˆGØ ×'Ñ'×)Ñ)ˆGØ˜AÕˆLô 	×Ò˜<Ó(€AÜ˜:°GÔMÐMøô; ô 	Úð	ûô2 ô 	Ùð	ús&   Á2AG' ÅA,G9 Ç'G6Ç5G6Ç9HÈHc                 ó2  € ^ RI Hp VP                  W4      w  r4pRpRRRR/pRRRR	/pW69   d0   \        4       P	                  V4      P
                  p	\        WAV	4      # W79   dH   Ve   \        R4      hR
p	\        4       P	                  V4      P                  p
\        Ws,          V
R7      # W89   dW   Wƒ,          pVe   \        RV,          4      hR
p	\        4       P	                  V4      P                  p
\        Wƒ,          V
R7      # \        RV,          4      h)r   r®   r  r  r  r	  r
  r  r  r  Nz.EdDSA ECC private key must not have parametersrì   z+%s ECC private key must not have parametersz!Unsupported ECC purpose (OID: %s)r  )r³   r¯   Úunwrapr
   r  r  r'  r6   r   r!  rô   r   )r  r°   r¯   Úalgo_oidr¶   r¢   r  r  r  r  r'   rK   s   &&          r!   Ú_import_pkcs8r+  m  s#  € Ýà$)§L¡L°Ó$EÑ!€H˜6ð€Kð 	�yØ�wð€Jð
 	�|Ø�zð€Hð
 ÔÜ“M×(Ñ(¨Ó0×6Ñ6ˆ	Ü" ;¸IÓFÐFØ	Ô	ØÒÜÐMÓNÐNØˆ	ÜÓ×&Ñ& {Ó3×;Ñ;ˆÜ˜zÕ3¸$Ô?Ð?Ø	Ô	ØÕ'ˆ
ØÒÜÐJØ'õ(ó )ð )àˆ	ÜÓ×&Ñ& {Ó3×;Ñ;ˆÜ˜xÕ1¸Ô=Ð=ä#Ð$GÈ(Õ$RÓSÐSr    c                 ó.   € \        V 4      p\        V4      # r„   )r   r  )r  rI   Úsp_infos   &* r!   Ú_import_x509_certr.  •  s   € ä.¨wÓ7€GÜ'¨Ó0Ð0r    c                 óØ  €  \        W4      #   \         d   pThR p?i\        \        \        3 d     Mi ; i \        Y4      #   \         d   pThR p?i\        \        \        3 d     Mi ; i \        Y4      #   \         d   pThR p?i\        \        \        3 d     Mi ; i \        Y4      #   \         d   pThR p?i\        \        \        3 d     Mi ; i\        R4      h)NzNot an ECC DER key)r  r   r6   r4   Ú
IndexErrorr.  r'  r+  )r  r°   Úerrs   && r!   Ú_import_derr2  ›  sì   € ðÜ+¨GÓ@Ð@øÜ ô Øˆ	ûÜœ	¤:Ð.ô ÙðúðÜ  Ó5Ð5øÜ ô Øˆ	ûÜœ	¤:Ð.ô ÙðúðÜ" 7Ó7Ð7øÜ ô Øˆ	ûÜœ	¤:Ð.ô ÙðúðÜ˜WÓ1Ð1øÜ ô Øˆ	ûÜœ	¤:Ð.ô Ùðúô Ð)Ó
*Ð*sƒ   ‚
 �6˜š6²6µ6º
A ÁA.ÁAÁA.Á*A.Á-A.Á2
A= Á=B&ÂB
Â
B&Â"B&Â%B&Â*
B5 Â5CÃ CÃCÃCÃCc                 ó\  € V P                  R 4      p\        V4      R9  d   \        R4      h \        P                  ! V^,          4      p. p\        V4      ^8”  dO   \
        P                  ! RVR,          4      ^ ,          pVP                  V^^V,            4       V^V,           R pK^  V^ ,          V^ ,          8w  d   \        R4      hV^ ,          P                  R4      '       d¿   \        P                  ! 4        Fs  w  rVVP                  f   K  VP                  P                  R4      '       g   K8  \        VP                  P                  R4      ^,          4      pV^,          V8X  g   Ks   M	  \        R	X,           4      h\        V^,          VP                  R
7      pV# V^ ,          R8X  d$   \        V^,          4      w  rš\!        RWšR7      pV# \        RV^ ,          ,           4      h  \"        \$        \        P&                  3 d    \        RT^ ,          ,           4      hi ; i)ó    zNot an openssh public keyrÌ   :Nr   NNzMismatch in openssh public keyó   ecdsa-sha2-ú
ecdsa-sha2rË   zUnsupported ECC curve: r  ó   ssh-ed25519r  r÷   zUnsupported SSH key type: zError parsing SSH key type: rø   )rÏ   r=   r6   r[   Ú
a2b_base64rÑ   ÚunpackÚappendÚ
startswithr   rû   rÎ   r   r  r¡   r  rô   r0  r4   ÚError)r  ÚpartsÚ	keystringÚkeypartsÚlkrK   r%   rÖ   Úecc_keyr]   ra   s   &          r!   Ú_import_openssh_publicrB  ¼  sÒ  € Ø�M‰M˜$Ó€EÜ
ˆ5ƒz˜ÔÜÐ4Ó5Ð5ð$DÜ×'Ò'¨¨a­Ó1ˆ	àˆÜ�)‹n˜qÔ Ü—’˜t Y¨r¥]Ó3°AÕ6ˆBØ�O‰O˜I a¨¨B­Ð/Ô0Ø! ! b¥& 'Ð*ŠIà��8�x •{Ô"ÜÐ=Ó>Ð>ð ��8×Ñ˜~×.Ò.ä%,§]¢]¦_Ñ!�
Ø—=‘=Ò(ÙØ—}‘}×/Ñ/°×=Ò=ÙÜ  §¡×!4Ñ!4°SÓ!9¸!Õ!<Ó=�Ø˜A•; &Ö(Ùñ &5ô !Ð!:¸VÕ!CÓDÐDä(¨°!­ÀÇ	Á	ÔJˆGð €Nð �1�X˜Ô'Ü-¨h°q­kÓ:‰DˆAÜ i¸ÔFˆGð €Nô Ð9¸EÀ!½HÕDÓEÐEøäœ	¤8§>¡>Ð2ô DÜÐ7¸%À½(ÕBÓCÐCðDús+   ®B:G1 Ã)A
G1 Ä48G1 Å14G1 Æ'/G1 ÇG1 Ç1:H+c                 ój  € ^RI HpHpHpHp V! W4      w  rgRR\
        ^ 3/pVP                  R4      '       Ed   V! V4      w  r—V	\        9  d   \        RV	,          4      h\        V	,          p
V
P                  ^,           ^,          pV! V4      w  rÇ\        V^ ,          4      ^8w  d   \        R4      h\        V4      ^V,          ^,           8w  d   \        R4      h\        P                  ! V^^V,            4      p\        P                  ! V^V,           R 4      pV! V4      w  r÷\        P                  ! V4      pR	VR
V	/pMOWh9   d8   W†,          w  pppV! V4      w  rÇV! V4      w  rÞV! V4      w  ppVRV pRVR
V/pM\        RV,           4      hV! V4      w  ppV! V4       \        RRVRV/VB # )rw   )Úimport_openssh_private_genericÚ
read_bytesÚread_stringÚcheck_paddingrÊ   r  r6  zUnsupported ECC curve %sz/Only uncompressed OpenSSH EC keys are supportedzIncorrect public key lengthNr&   r%   r'   zUnsupport SSH agent key type:rñ   rò   r   )Ú_opensshrD  rE  rF  rG  r  r;  r   r   Úmodulus_bitsr   r6   r=   r	   rB   rô   )ÚdataÚpasswordrD  rE  rF  rG  Úkey_typeÚ	decryptedÚ
eddsa_keysÚecdsa_curve_namer%   r’   r‡   rñ   rò   r¶   r&   r¢   rK   r  Úseed_lenÚprivate_public_keyr'   Ú_Úpaddeds   &&                       r!   Ú_import_openssh_private_eccrT  ê  sÖ  € ÷Có Cñ 9¸ÓHÑ€Hð 	˜	Ô#=¸rÐBð€Jð
 ×Ñ˜<×(Ó(á&1°)Ó&<Ñ#ÐØ¤7Ô*Ü'Ð(BÐEUÕ(UÓVÐVÜÐ(Õ)ˆØ×+Ñ+¨aÕ/°AÕ5ˆá *¨9Ó 5Ñˆ
ä�
˜1•Ó !Ô#ÜÐNÓOÐOÜˆz‹?˜a -Õ/°!Õ3Ô3ÜÐ:Ó;Ð;ä×$Ò$ Z°°!°Mµ/Ð%BÓCˆÜ×$Ò$ Z°°-µÐ0@Ð%AÓBˆá!+¨IÓ!6ÑˆÜ×Ò˜{Ó+ˆà�q˜'Ð#3Ð4‰à	Ô	à8BÕ8LÑ5ˆ
Ð+¨Xá *¨9Ó 5Ñˆ
Ù2°:Ó>Ñˆá(2°9Ó(=Ñ%Ð˜IØ! ) 8Ð,ˆà˜$ ¨Ð4‰äÐ8¸8ÕCÓDÐDá˜IÓ&�I€A€vÙ�&ÔäÑ@˜WÐ@¨gÐ@¸Ñ@Ð@r    c                ób  € \        V 4      ^ 8w  d   \        R4      h\        R4      pRp\        V 4      pV^,          ^,	          pV^;;,          ^,          uu&   \        P                  ! VRR7      pWQ8¼  d   \        R4      hV^8X  d   R# V^,          ^,
          V,          pV^,          V,          V,          ^,           V,          p VP                  V4      pWh,          V,          p	\        P                  ! W‘4      p
V
^,          V8w  d	   W,
          p
W¥3#   \         d    \        R4      hi ; i)	aA  Import an Ed25519 ECC public key, encoded as raw bytes as described
in RFC8032_.

Args:
  encoded (bytes):
    The Ed25519 public key to import. It must be 32 bytes long.

Returns:
  x and y (integer)

Raises:
  ValueError: when the given key cannot be parsed.

.. _RFC8032: https://datatracker.ietf.org/doc/html/rfc8032
z9Incorrect length. Only Ed25519 public keys are supported.l   íÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿl   £x²&(7Z/·
;(P8 ÑsÝe:Ì8ÎÛ
w6Rr+   r,   zInvalid Ed25519 key (y)zInvalid Ed25519 public key©r   rw   )r=   r6   r	   rA   rB   rk   Ú_tonelli_shanks©r  rü   r&   ra   Úx_lsbrò   ÚuÚvÚv_invÚx2rñ   s   &          r!   r  r  !  s  € ô" ˆ7ƒ|�rÔÜÐTÓUÐUäÐRÓS€AØU€Aä�'Ó€AØˆb�E�Q�J€EØ€b‡EˆT…MƒEÜ× Ò  ¨hÔ7€GØ„|ÜÐ2Ó3Ð3Ø�!„|Øˆà	�!��a�˜1Õ€AØ
�1�*�q�.˜AÕ	 Õ	! QÕ&€Að7Ø—	‘	˜!“ˆØ�i˜1�_ˆÜ×)Ò)¨"Ó0ˆØ�a�K˜EÔ!Ø•kˆGð ÐÐøô ô 7ÜÐ5Ó6Ð6ð7ús   ÃAD ÄD.c                ó¬   € \        V 4      ^ 8w  d   \        R4      h\        V 4      pV^;;,          ^,          uu&   \        P                  ! VRR7      pV# )a@  Import a Curve25519 ECC public key,
encoded as raw bytes as described in RFC7748_.

Args:
  encoded (bytes):
    The Curve25519 public key to import. It must be 32 bytes long.

Returns:
  x (integer)

Raises:
  ValueError: when the given key cannot be parsed.

.. _RFC7748: https://datatracker.ietf.org/doc/html/rfc7748
zIncorrect Curve25519 key lengthr+   r,   )r=   r6   rA   r	   rB   )r  r]   rñ   s   &  r!   r  r  N  sJ   € ô" ˆ7ƒ|�rÔÜÐ:Ó;Ð;ä�'Ó€Aà€b‡EˆT…MƒEÜ× Ò  ¨hÔ7€Gà€Nr    c                ól   € \        V 4      ^88w  d   \        R4      h\        P                  ! V RR7      pV# )a<  Import a Curve448 ECC public key,
encoded as raw bytes as described in RFC7748_.

Args:
  encoded (bytes):
    The Curve448 public key to import. It must be 56 bytes long.

Returns:
  x (integer)

Raises:
  ValueError: when the given key cannot be parsed.

.. _RFC7748: https://datatracker.ietf.org/doc/html/rfc7748
zIncorrect Curve448 key lengthr+   r,   )r=   r6   r	   rB   )r  rñ   s   & r!   r  r  j  s3   € ô" ˆ7ƒ|�rÔÜÐ8Ó9Ð9ä× Ò  °HÔ=€Gà€Nr    c                ól  € \        V 4      ^98w  d   \        R4      h\        R,          P                  pVR,
          pV R,          p\	        V ^8,          4      ^,	          p\
        P                  ! VRR7      pWQ8¼  d   \        R4      hV^8X  d   R	# V^,          ^,
          V,          pV^,          V,          V,          ^,
          V,          p VP                  V4      pWh,          V,          p	\
        P                  ! W‘4      p
V
^,          V8w  d	   W,
          p
W¥3#   \         d    \        R4      hi ; i)
a?  Import an Ed448 ECC public key, encoded as raw bytes as described
in RFC8032_.

Args:
  encoded (bytes):
    The Ed448 public key to import. It must be 57 bytes long.

Returns:
    x and y (integer)

Raises:
  ValueError: when the given key cannot be parsed.

.. _RFC8032: https://datatracker.ietf.org/doc/html/rfc8032
z7Incorrect length. Only Ed448 public keys are supported.Úcurve448i©˜  :Né8   Nr+   r,   zInvalid Ed448 key (y)zInvalid Ed448 public keyrV  )	r=   r6   r   rü   r   r	   rB   rk   rW  rX  s   &          r!   r  r  ƒ  s  € ô" ˆ7ƒ|�rÔÜÐRÓSÐSä�
Õ×Ñ€AØ	ˆE�	€Aà��€AÜ�˜•Ó Õ"€EÜ× Ò  ¨hÔ7€GØ„|ÜÐ0Ó1Ð1Ø�!„|Øˆà	�!��a�˜1Õ€AØ
�1�*�q�.˜AÕ	 Õ	! QÕ&€Að5Ø—	‘	˜!“ˆØ�i˜1�_ˆÜ×)Ò)¨"Ó0ˆØ�a�K˜EÔ!Ø•kˆGð ÐÐøô ô 5ÜÐ3Ó4Ð4ð5ús   ÃAD ÄD3c                ón  € ^ RI Hp \        V 4      p Ve   \        V4      pV P                  R4      '       d-   \	        V 4      pVP                  WA4      w  rVp\        WQ4      pV# V P                  R4      '       dr   \	        V 4      pRp	Rp
\        P                  ! V	R,           V
,           RV\        P                  R	7      pVP                  WA4      w  r¶pV'       d   Rp \        W±4      pV# V P                  R4      '       d   \        V 4      # \        V 4      ^ 8”  d#   \        V ^ ,          4      ^08X  d   \        W4      # \        V 4      ^ 8”  d3   \        V ^ ,          4      R9   d   Vf   \        R4      h\!        WR7      # \        R4      h  \         d   pThRp?i\         d    \        R
4      hi ; i)a 
  Import an ECC key (public or private).

Args:
  encoded (bytes or multi-line string):
    The ECC key to import.
    The function will try to automatically detect the right format.

    Supported formats for an ECC **public** key:

    * X.509 certificate: binary (DER) or ASCII (PEM).
    * X.509 ``subjectPublicKeyInfo``: binary (DER) or ASCII (PEM).
    * SEC1_ (or X9.62), as ``bytes``. NIST P curves only.
      You must also provide the ``curve_name`` (with a value from the `ECC table`_)
    * OpenSSH line, defined in RFC5656_ and RFC8709_ (ASCII).
      This is normally the content of files like ``~/.ssh/id_ecdsa.pub``.

    Supported formats for an ECC **private** key:

    * A binary ``ECPrivateKey`` structure, as defined in `RFC5915`_ (DER).
      NIST P curves only.
    * A `PKCS#8`_ structure (or the more recent Asymmetric Key
      Package, RFC5958_): binary (DER) or ASCII (PEM).
    * `OpenSSH 6.5`_ and newer versions (ASCII).

    Private keys can be in the clear or password-protected.

    For details about the PEM encoding, see `RFC1421`_/`RFC1423`_.

  passphrase (byte string):
    The passphrase to use for decrypting a private key.
    Encryption may be applied protected at the PEM level (not recommended)
    or at the PKCS#8 level (recommended).
    This parameter is ignored if the key in input is not encrypted.

  curve_name (string):
    For a SEC1 encoding only. This is the name of the curve,
    as defined in the `ECC table`_.

.. note::

    To import EdDSA private and public keys, when encoded as raw ``bytes``, use:

    * :func:`Crypto.Signature.eddsa.import_public_key`, or
    * :func:`Crypto.Signature.eddsa.import_private_key`.

.. note::

    To import X25519/X448 private and public keys, when encoded as raw ``bytes``, use:

    * :func:`Crypto.Protocol.DH.import_x25519_public_key`
    * :func:`Crypto.Protocol.DH.import_x25519_private_key`
    * :func:`Crypto.Protocol.DH.import_x448_public_key`
    * :func:`Crypto.Protocol.DH.import_x448_private_key`

Returns:
  :class:`EccKey` : a new ECC key object

Raises:
  ValueError: when the given key cannot be parsed (possibly because
    the pass phrase is wrong).

.. _RFC1421: https://datatracker.ietf.org/doc/html/rfc1421
.. _RFC1423: https://datatracker.ietf.org/doc/html/rfc1423
.. _RFC5915: https://datatracker.ietf.org/doc/html/rfc5915
.. _RFC5656: https://datatracker.ietf.org/doc/html/rfc5656
.. _RFC8709: https://datatracker.ietf.org/doc/html/rfc8709
.. _RFC5958: https://datatracker.ietf.org/doc/html/rfc5958
.. _`PKCS#8`: https://datatracker.ietf.org/doc/html/rfc5208
.. _`OpenSSH 6.5`: https://flak.tedunangst.com/post/new-openssh-key-format-and-bcrypt-pbkdf
.. _SEC1: https://www.secg.org/sec1-v2.pdf
rº   Ns   -----BEGIN OPENSSH PRIVATE KEYs   -----z-----BEGIN EC PARAMETERS-----z-----END EC PARAMETERS-----z.*?rY   )Úflagsz(Invalid DER encoding inside the PEM filezNo curve name was provided)rK   zECC key format is not supported)r5  r7  r  )r³   r»   r   r;  r   r  rT  ÚreÚsubÚDOTALLr2  r   r6   rB  r=   r   r  )r  r°   rK   r»   Útext_encodedÚopenssh_encodedÚmarkerÚenc_flagr`   Úecparams_startÚecparams_endÚder_encodedÚuefs   &&&          r!   Ú
import_keyrp  ¯  sž  € õR ä�gÓ€GØÒÜ˜ZÓ(ˆ
ð ×ÑÐ;×<Ò<Ü˜W“~ˆØ,/¯J©J°|Ó,PÑ)ˆ Ü,¨_ÓIˆØˆà	×	Ñ	˜H×	%Ò	%ä˜W“~ˆð 9ˆØ4ˆÜ—v’v˜n¨uÕ4°|ÕCÀRØ*Ü$&§I¡Iô/ˆð ),¯
©
°<Ó(LÑ%ˆ˜XßØˆJð	IÜ  Ó9ˆFð
 ˆð ×ÑÐ:×;Ò;Ü% gÓ.Ð.ô ˆ7ƒ|�aÔœD ¨¥Ó,°Ô4Ü˜7Ó/Ð/ô ˆ7ƒ|�aÔœD ¨¥Ó,Ð0BÔBØÒÜÐ9Ó:Ð:Ü! 'ÔAÐAä
Ð6Ó
7Ð7øô) %ô 	ØˆIûÜô 	IÜÐGÓHÐHð	Iús   ÃF ÆF4ÆFÆF4Æ'F4Ú__main__l   ýö_,)¶NÌ$ÔcÐhKf-5lk<X÷k©#E Úp256i¸  z	(P-256 G)iè  Úmsz(P-256 arbitrary point))NNr„   )@Ú
__future__r   re  rÑ   r[   ÚCrypto.Util.py3compatr   r   r   r   r   ÚCrypto.Math.Numbersr	   ÚCrypto.Util.asn1r
   r   r   r   ÚCrypto.PublicKeyr   r   r   ÚCrypto.Hashr   r   ÚCrypto.Randomr   r3   r   r   r   r   r;   r6   r   Úobjectr#   rï   rô   r  r  r'  r+  r.  r2  rB  rT  r  r  r  r  rp  r   Útimer&   rl   rá   r(   rL   ÚstartÚranger]   ÚpointXÚprintr   r    r!   Ú<module>r�     sw  ðõ> &ã 	Û Û ç GÕ Gå '÷,ó ,÷@ñ @÷ )å *ç 0Ñ 0Ý 'ô	˜Jô 	ôH6ˆVô H6òV'òTDôN5>òp@EôF8Nòv%TòP1ò+òB+ò\4Aòn*òZò8ò2)ôX{8ð| ˆzÔãàJ€Aà�F�O×Ñ×"Ñ"Ó$€EØ€Eà�IŠI‹K€EÙ�5Ž\ˆØ˜•Šñ á	ˆ+˜Ÿ	š	› eÕ+¨uÕ4°tÕ;¸TÔBà�IŠI‹K€EÙ�5Ž\ˆØ˜!•Šñ á	Ð
# d§i¢i£k°EÕ&9¸UÕ%BÀTÕ%IÈ4ÖPñ# r    