+
    @i,                     	   ^ RI HtHt ^ RIt ^ RIHt ] U u. uF  p V R.9  g   K  V NK  	  up t^ RIHt ^ RIt^ RI	t	^ RI
Ht ^ RIHtHtHtHtHt ^RIHt ^RIHt ^RIHtHt ^R	IHtHt ^R
IHtHtHt ^RIHtH t H!t!H"t"H#t#H$t$ ^RI%H&t& Rt' ] Uu. uF  q]PQ                  V4      PR                  3NK!  	  upt* R]	PV                  9   d   ]].t. t, ]-! ]R R7       F  t.]-! ]*R R7       UUu. uF&  w  r^ Tu;8  d   ].P^                  8:  g   K   M K$  VNK(  	  upp Fg  t0]Pb                  ! ].]! ]PP                  ]04      R7      t2],Pg                  RPi                  ].]04      ]2Pj                  ]2Pm                  ]']R7      34       Ki  	  K  	  ]Pn                  Pq                  R], UUUu. uF  w  rp]Ps                  W4VR7      NK  	  uppp4      R 4       t:]Pv                  R 4       t</ t=]	P|                  R/8  d2   ^ RIH?t? R]=R&   ]?P                  ]?P                  ]?P                  .]=R&   R]	PV                  9   d   ^]=R&   ]C! ]=4      tDR]	PV                  9   d   ^]DR&   M^
]DR&   ]! R0/ ]DB ]! ]<! ],4      4      R 4       4       tE]Pv                  R 4       tF]! R0/ ]DB ]! ]F! 4       4      R  4       4       tGR! tH]Pv                  R" 4       tIR# tJR$ tK]Pv                  R% 4       tLR& tM]! R0/ ]DB ]! ]P                  ! ],4      ]M! 4       4      R' 4       4       tO]! R0/ ]DB ]! ]P                  ! ],4      ]P                  ! R1R(7      4      ]! ],^ ,          ]#! ]! ^ 4      ]! ^ 4      4      4      ]! ],^ ,          ]#! ]! ^4      ]! ^4      4      R),           4      ]! ],^ ,          ]#! ]! ^4      .^,          !  4      R* 4       4       4       4       4       tQ], UUUu. uFd  w  rp]R! VP\                  P\                  ]&4      '       d   K+  VV]! ]! WEP\                  P                  4      R+VP\                  P                  / 3NKf  	  uppptT ]T], UUUu. uF0  w  rp]R! VP\                  P\                  ]&4      '       g   K+  VVV3NK2  	  uppp,          tT]! R0/ ]DB ]! ]<! ]T4      4      R, 4       4       tUR#   ] d	    . R-Ot ELi ; iu up i u upi u uppi u upppi u upppi u upppi )2    )with_statementdivisionN)algorithms_available)partial)noteassumegivensettingsexample)
SigningKey)BadSignatureError)sigencode_dersigencode_string)sigdecode_dersigdecode_string)curves	SECP112r2	SECP128r1)encode_integerencode_bitstringencode_octet_string
encode_oidencode_sequenceencode_constructed)	CurveEdTws   some data to signz--fastc                     V P                   # N)baselenxs   &W/var/www/html/photoedit/myenv/lib/python3.14/site-packages/ecdsa/test_malformed_sigs.py<lambda>r"   C   s    !))    )keyc                     V ^,          # )    r   s   &r!   r"   r"   F   s    adr#   )hashfuncz{0} {1})	sigencodezverifying_key,signature)idc                 N    V P                  V\        \        R 7      '       g   Q hR# 	sigdecodeN)verifyexample_datar   )verifying_key	signatures   &&r!   test_signaturesr3   W   s-    
 <=      r#   c           
     <   V ! \         P                  ! V4      4      w  r#p\        RP                  V4      4       \	        V4      pV ! \         P
                  ! \         P                  ! ^ \        V4      ^,
          R7      RR7      4      pVP                  4        \        V4       F  pWW K  	  \        RP                  V4      4       RpV'       d   V ! \         P                  ! \         P                  ! ^ \        V4      ^,
          R7      \         P                  ! ^^R7      4      4      pVP                  4        F  w  ryWW;;,          V	,          uu&   K  	  \        RP                  V4      4       V ! \         P                  ! ^ \        V4      R7      4      p
V ! \         P                  ! RR	7      4      pVRV
 V,           WZR ,           p\        R
P                  W4      4       \        V4      p\        T;'       g    T;'       g    T4       \        WT8g  4       W53# )z|
Hypothesis strategy that generates pairs of VerifyingKey and malformed
signatures created by fuzzing of a valid signature.
Configuration: {0}	min_value	max_valueT)uniquezRemove bytes: {0}Nz	xors: {0}   max_sizez%Inserted at position {0} bytes: {1!r})stsampled_fromr   format	bytearraylistsintegerslensortreverseddictionariesitemsbinarybytesr   )drawkeys_and_sigsnamer1   old_sigsig	to_removeixorsval
insert_posinsert_datas   &&          r!   st_fuzzed_sigrU   a   s    $((F#G D		$	$T	*+
G
C 
qCHqLA$OI NNi F !		#	#I	./ D
OOa3s8a<@a37
 jjlFAFcMF #[%& bkkASBCJryy#./K
kz
[
(3{+;
;C/66zO *C
9++++,
3>r#   )HealthChecki  deadlinesuppress_health_checkmax_examplesc                     V w  r\         P                  ! \        4      ;_uu_ 4        VP                  V\        \
        R 7       RRR4       R#   + '       g   i     R# ; ir,   pytestraisesr   r/   r0   r   )argsr1   rN   s   &  r!   test_fuzzed_der_signaturesr_      s@     M	(	)	)S,-H 
*	)	)	)   AA	c                <   V ! \         P                  ! \        4      4      w  rp\        RP	                  V4      4       \        VP                  P                  4      pV ! \         P                  ! ^ V^,          R7      \         P                  ! V^,	          V^,           R7      ,          4      pV ! \         P                  ! ^ V^,          R7      \         P                  ! V^,	          V^,           R7      ,          4      p\        \        V4      \        V4      4      pW'3# )z
Hypothesis strategy for selecting random values and encoding them
to ECDSA-Sig-Value object::

    ECDSA-Sig-Value ::= SEQUENCE {
        r INTEGER,
        s INTEGER
    }
r5   r6   )r=   r>   rK   r   r?   intcurveorderrB   r   r   )rJ   rL   r1   _rd   rsrN   s   &       r!   st_random_der_ecdsa_sig_valuerh      s     ""//-"@AD		$	$T	*+##))*E 	
a5A:6
++
eai
@	A	A 	
a5A:6
++
eai
@	A	A
 .+^A->
?Cr#   c                    V w  r\         P                  ! \        4      ;_uu_ 4        VP                  V\        \
        R7       RRR4       R#   + '       g   i     R# ; i)zX
Check if random values encoded in ECDSA-Sig-Value structure are rejected
as signature.
r-   Nr[   paramsr1   rN   s   &  r!   test_random_der_ecdsa_sig_valuerl      s@      M	(	)	)S,-H 
*	)	)	)r`   c                 x    RV9  d   ^ VR&   \         P                  ! \        \         P                  ! V / VB 4      # )z
Hypothesis strategy that returns a random positive integer as DER
INTEGER.
Parameters are passed to hypothesis.strategy.integer.
r7   )r=   buildsr   rB   r^   kwargss   *,r!   st_der_integerrq      s5     & {99^R[[$%A&%ABBr#   c                   V ! \         P                  ! V/ VB 4      pV'       dS   V ! \         P                  ! ^ ^R7      4      p\        V4      pVR;;,          ^V,          ) ,          uu&   \	        V4      pM^ p\        W44      # )zp
Hypothesis strategy that returns a random DER BIT STRING.
Parameters are passed to hypothesis.strategy.binary.
r6   )r=   rH   rB   r@   rI   r   )rJ   r^   rp   dataunuseds   &*,  r!   st_der_bit_stringrv      sj     		4*6*+DbkkA;<RaiL T{D))r#   c                 `    \         P                  ! \        \         P                  ! V / VB 4      # )zx
Hypothesis strategy that returns a random DER OCTET STRING object.
Parameters are passed to hypothesis.strategy.binary
)r=   rn   r   rH   ro   s   *,r!   st_der_octet_stringrx      s$    
 99("))T*DV*DEEr#   c                 .    \         P                  ! R4      # )z3
Hypothesis strategy that returns DER NULL object.
s    )r=   justr'   r#   r!   st_der_nullr{     s     77;r#   c           	     d   V ! \         P                  ! ^ ^R7      4      pV^8  d    V ! \         P                  ! ^ ^'R7      4      pM%V ! \         P                  ! ^ ^R,          R7      4      pV ! \         P                  ! \         P                  ! ^ ^R,          R7      ^2R7      4      p\        W.VO5!  # )zA
Hypothesis strategy that returns DER OBJECT IDENTIFIER objects.
r6   i   r;   )r=   rB   rA   r   )rJ   firstsecondrests   &   r!   
st_der_oidr     s    
 qA67EqybkkA<=bkkAC@A
qAsF;bID e+d++r#   c                    \         P                  ! \         P                  ! R4      \        ^R,          R7      ,          \	        RR7      ,          \        RR7      ,          \        4       ,          \        4       ,          R ^(R7      # )z
Hypothesis strategy that returns random DER structures.

A valid DER structure is any primitive object, an octet encoding
of a valid DER structure, sequence of valid DER objects or a constructed
encoding of any of the above.
r#   i   )r8   r;   c           	         \         P                  ! \        \         P                  ! V 4      4      \         P                  ! R  \         P                  ! V 4      4      ,          \         P                  ! R \         P                  ! V ^R7      4      ,          \         P                  ! \
        \         P                  ! ^ ^?R7      \         P                  ! V 4      4      ,          # )c                     \        V ^ 4      # )r   )r   r   s   &r!   r"   *st_der.<locals>.<lambda>.<locals>.<lambda>.  s    .q!4r#   c                     \        V !  # r   )r   r   s   &r!   r"   r   0  s	    oq)r#   r;   r6   )r=   rn   r   one_ofrA   r   rB   )childrens   &r!   r"   st_der.<locals>.<lambda>-  s    #6		(8KL
))4bii6I
JK
)))288Hs+K


 ))KK!t4IIh
	
r#   )
max_leaves   )r=   	recursiverz   rq   rv   rx   r{   r   r'   r#   r!   st_derr     so     <<

1d7
+	,
W
-	. w
/	0 -		
 ,			
 # r#   c                    V w  r#p\         P                  ! \        4      ;_uu_ 4        VP                  V\        \
        R7       RRR4       R#   + '       g   i     R# ; i)z8Check if random DER structures are rejected as signaturer-   Nr[   rk   derrL   r1   re   s   &&   r!   test_random_der_as_signaturer   ;  sB     $D	(	)	)S,-H 
*	)	)	)   AA 	r;       c                    V w  r#p\         P                  ! \        4      ;_uu_ 4        VP                  V\        \
        R7       RRR4       R#   + '       g   i     R# ; i)z/Check if random bytes are rejected as signaturer-   Nr[   r   s   &&   r!   test_random_bytes_as_signaturer   E  sB     $D	(	)	)S,-H 
*	)	)	)r   rd   c                     V w  r\         P                  ! \        4      ;_uu_ 4        VP                  V\        \
        R 7       RRR4       R#   + '       g   i     R# ; ir,   )r\   r]   r   r/   r0   r   rj   s   &  r!   test_fuzzed_string_signaturesr   t  sA      M	(	)	)S,:JK 
*	)	)	)r`   )md5sha1sha224sha256sha384sha512)mdc2md2md4	whirlpool	ripemd160)      r'   r   )V
__future__r   r   hashlibr   ImportError	functoolsr   r\   syshypothesis.strategies
strategiesr=   
hypothesisr   r   r	   r
   r   keysr   r   utilr   r   r   r   r   r   r   r   r   r   r   r   r   r   ellipticcurver   r0   newdigest_sizehash_and_sizeargvrK   sortedrc   r   hash_alggenerateskappendr?   r1   signmarkparametrizeparamr3   	compositerU   rk   version_inforV   data_too_largefilter_too_muchtoo_slowdictslow_paramsr_   rh   rl   rq   rv   rx   r{   r   r   r>   r   rH   r   
isinstancerd   keys_and_string_sigsr   )rP   rL   sizevkrN   r1   s   000000r!   <module>r      ss   / 
, "!@@ A! 
   
 " = =  # 1 1 0 0  % $ I 7K6Jd7;;t(()6J&
 sxx#F  I F 34E !NCCJDt$u}}$ 	$ 	C
   GGKK:
 	  1  >	
 5( 9FG#V\\"d\#G	 0 0f 
v& F:""##'F"#
 sxxF>6lsxx"#K"$K 
K}]#$I % I  B 
K$&'I ( IC * * F  , ,: 
Kr}%vx0I 1 I 
Kr}%ryy''BC!onQ&79JK 	!N1%~a'89GC 	q	?^A->,?!,CDEI F	 D I" %2 %2 Sm))//;3 3 3 9 9:	
%%++	
 %2   %2 %2 S-%%++Y7
 %2   
K})*+L , L_  >$* H|$sQ   R* 	R<R<%S1SSS,S(S>=S(S
5	S
*R98R9