+
    Ai                     `    ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
  ! R R]4      tR# )    N)Key)
ALGORITHMS)JWKError)base64_to_longlong_to_base64c                     a  ] tR t^t o Rt]P                  t]P                  t	]P                  t]]P                  P                  ]	]P                  P                  ]]P                  P                   /t]P                  P                  R3]P                  P                  R3]P                  P                   R33tR tR tR tR tR	 tR
 tR tR tRtV tR# )
ECDSAECKeyz
Performs signing and verification operations using
ECDSA and the specified hash function

This class requires the ecdsa package to be installed.

This is based off of the implementation in PyJWT 0.3.2
zP-256zP-384zP-521c                   V\         P                  9  d   \        R V,          4      h\         P                  V P                  \         P
                  V P                  \         P                  V P                  /P                  V4      V n
        W n        V P                  P                  V P                  4      V n        \        V\        P                   \        P"                  34      '       d	   Wn        R# \        V\&        4      '       d   V P)                  V4      V n        R# \        V\*        4      '       d   VP-                  R4      p\        V\.        4      '       d)    \        P"                  P1                  V4      pYn        R# \        RV,          4      h  \        P2                  P4                   d#    \        P                   P1                  T4      p LZ\6         d   p\        T4      hRp?ii ; i)z*hash_alg: %s is not a valid hash algorithmNzutf-8z%Unable to parse an ECKey from key: %s)r   ECr   ES256SHA256ES384SHA384ES512SHA512gethash_alg
_algorithm	CURVE_MAPcurve
isinstanceecdsa
SigningKeyVerifyingKeyprepared_keydict_process_jwkstrencodebytesfrom_pemderUnexpectedDER	Exception)selfkey	algorithmes   &&& Y/var/www/html/photoedit/myenv/lib/python3.14/site-packages/jose/backends/ecdsa_backend.py__init__ECDSAECKey.__init__$   ss   JMM)G)STT dkkdkkdkk
 #i.	 	
 $^^''6
cE,,e.@.@ABB #c4   $ 1 1# 6Dc3**W%Cc5!!"((11#6 !$>DEE 99** 5&&//4 "qk!"s$    F >G3G3"G3#G..G3c                  a SP                  R 4      R8X  g"   \        RSP                  R 4      ,          4      h\        ;QJ d    V3R lR 4       F  '       d   K   RM	  RM! V3R lR 4       4      '       g   \        R4      hR	S9   dN   \        SP                  R	4      4      p\        P
                  P                  P                  W P                  4      # \        SP                  R4      4      p\        SP                  R4      4      p\        P                  P                  V P                  P                  W44      '       g   \        R
V RV R24      h\        P                  P                  V P                  P                  W4V P                  P                  4      p\        P
                  P                  P                  WPP                  4      # )ktyr   z0Incorrect key type. Expected: 'EC', Received: %sc              3   ,   <"   T F	  qS9   x  K  	  R # 5iN ).0kjwk_dicts   & r)   	<genexpr>*ECDSAECKey._process_jwk.<locals>.<genexpr>P   s     <*;Q=*;s   xyFTz Mandatory parameters are missingdzPoint: z, z is not a valid point)r6   r7   crv)r   r   allr   r   keysr   from_secret_exponentr   point_is_valid	generatorellipticcurvePointorderr   from_public_point)r%   r3   r8   r6   r7   points   &f    r)   r   ECDSAECKey._process_jwkL   sK   ||E"d*MPXP\P\]bPccdds<*;<sss<*;<<<=>>(? x||C01A::((==aLLx||C01Ax||C01A;;--djj.B.BAII2aS0EFGG''--djj.>.>djjFVFVWE::**<<UJJOO    c                    V P                   P                  WP                  \        P                  P
                  R R7      # )F)hashfunc	sigencodeallow_truncate)r   signr   r   utilsigencode_string)r%   msgs   &&r)   rJ   ECDSAECKey.signb   s6      %%--5::3N3N_d & 
 	
rE   c                     V P                   P                  W!V P                  \        P                  P
                  R R7      #   \         d     R # i ; i)F)rG   	sigdecoderI   )r   verifyr   r   rK   sigdecode_stringr$   )r%   rM   sigs   &&&r)   rQ   ECDSAECKey.verifyg   sQ    	$$++4==EJJ<W<Whm ,    		s   A A AAc                J    \        V P                  \        P                  4      # r/   )r   r   r   r   r%   s   &r)   	is_publicECDSAECKey.is_publico   s    $++U-?-?@@rE   c                    V P                  4       '       d   V # V P                  V P                  P                  4       V P                  4      # r/   )rW   	__class__r   get_verifying_keyr   rV   s   &r)   
public_keyECDSAECKey.public_keyr   s8    >>K~~d//AACT__UUrE   c                6    V P                   P                  4       # r/   )r   to_pemrV   s   &r)   r_   ECDSAECKey.to_pemw   s      ''))rE   c                @   V P                  4       '       g   V P                  P                  4       pMV P                  pR pV P                   F#  w  r4W0P                  P                  8X  g   K!  TpK%  	  V'       g#   \        RV P                  P                   24      hV P                  P                  P                  pRV P                  RRRVR\        VP                  P                  P                  4       VR7      P                  R4      R	\        VP                  P                  P                  4       VR7      P                  R4      /pV P                  4       '       g>   \        V P                  P                  P                  VR7      P                  R4      VR
&   V# )NzCan't match algr-   r   r9   r6   )sizeASCIIr7   r8   )rW   r   r[   CURVE_NAMESr   KeyErrorbaselenr   r   pubkeyrC   r6   decoder7   privkeysecret_multiplier)r%   r\   r9   r&   valuekey_sizedatas   &      r)   to_dictECDSAECKey.to_dictz   sR   ~~**<<>J**J**JC''--- + \$*;*;*A*A)BCDD
 $$**22 4??43
 1 1 7 7 9 9 ;(KRRSZ[
 1 1 7 7 9 9 ;(KRRSZ[
 ~~&t'8'8'@'@'R'RYabiijqrDIrE   )r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__hashlibsha256r   sha384r   sha512r   r   curvesNIST256pNIST384pNIST521pr   re   r*   r   rJ   rQ   rW   r\   r_   ro   __static_attributes____classdictcell__)__classdict__s   @r)   r	   r	      s      ^^F^^F^^F 	%%%%%%I 
		(			(			(K&FPP,

AV
* rE   r	   )rv   r   jose.backends.baser   jose.constantsr   jose.exceptionsr   
jose.utilsr   r   r	   r0   rE   r)   <module>r      s%      " % $ 5K KrE   