+
     hl  c                   s    ^ RI t ^ RIHtHtHtHtHtHtHt ^ RI	H
t
HtHt ^ RIHt ]'       d   ^ RI Ht Rt. ROt ! R R4      t ! R	 R
]4      tR# )i    N)TYPE_CHECKINGBinaryIODictIterableListNoReturnOptional)HashMismatchHashMissingInstallationError)read_chunks)_Hashsha256c                   s
  a  ] tR t^t o RtRV 3R lR lltV 3R lR lt]V 3R lR l4       tV 3R	 lR
 lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )HasheszYA wrapper that builds multiple hashes at once and checks them against
known-good values

Nc                sZ   < V ^8  d   QhRS[ S[S[S[S[,          3,          ,          RR/# )   hashesreturnN)r   r   strr   Zformat__classdict__   "?/usr/lib/python3.14/site-packages/pip/_internal/utils/hashes.py__annotate__Hashes.__annotate__   s-     
  
 xS$s)^(<= 
  
     c                s    / pVeD   VP                  4        F/  w  r4\        V4       Uu. uF  qUP                  4       NK  	  upW#&   K1  	  W n        R# u upi )zW
:param hashes: A dict of algorithm names pointing to lists of allowed
    hex digests
N)itemssortedZlower_allowed)selfr   ZallowedalgkeysZk   &&    r   __init__ZHashes.__init__   sL    
 #\\^	39$<@<a	<@ ,    As   Ac                s"   < V ^8  d   QhRRRR/# )r   otherr   r    r   r   r   r   r   '   s      X ( r   c                sJ   \        V\        4      '       g   \        # V'       g   V # V '       g   V# / pVP                  P	                  4        FD  w  r4W0P                  9  d   K  V Uu. uF  qUV P                  V,          9   g   K  VNK   	  upW#&   KF  	  \        V4      # u upi N)
isinstancer   NotImplementedr   r   )r   r!   newr   valuesZvr   r   __and__ZHashes.__and__'   s    %((!! KL  >>//1KC--'#)E6a$--2D-D6ECH 2 c{ Fs   (B B c                    < V ^8  d   QhRS[ /# r   r   Zintr   r   r   r   r   ;   s     G Gc Gr   c                sV    \        R  V P                  P                  4        4       4      # )c              3   s8   "   T F  p\        V4      x  K  	  R # 5ir#   )Zlen).0Zdigestss   & r   	<genexpr>Z&Hashes.digest_count.<locals>.<genexpr><   s     F/EG3w<</Es   )Zsumr   r'   r      &r   digest_countZHashes.digest_count:   s     Ft}}/C/C/EFFFr   c                s,   < V ^8  d   QhRS[ RS[ RS[/# )r   	hash_name
hex_digestr   )r   boolr   r   r   r   r   >   s"     > > ># >$ >r   c                s>    W P                   P                  V. 4      9   # )z/Return whether the given hex digest is allowed.)r   Zget)r   r1   r2   s   &&&r   is_hash_allowedZHashes.is_hash_allowed>   s    ]]..y"===r   c                s4   < V ^8  d   QhRS[ S[,          RR/# )r   chunksr   N)r   Zbytesr   r   r   r   r   B   s      8E? t r   c                s   / pV P                   P                  4        F  p \        P                  ! V4      W#&   K  	  V F+  pVP                  4        F  pVP                  V4       K  	  K-  	  VP                  4        F.  w  r6VP                  4       V P                   V,          9   g   K-   R# 	  V P                  V4       R#   \        \
        3 d    \        RT 24      hi ; i)zjCheck good hashes against ones built from iterable of chunks of
data.

Raise HashMismatch if none match.

zUnknown hash name: N)r   r   hashlibr&   Z
ValueErrorZ	TypeErrorr	   r'   Zupdater   	hexdigest_raise)r   r5   gotsr1   ZchunkhashZgots   &&     r   check_against_chunksZHashes.check_against_chunksB   s     ++-IK")++i"8 . EE" &  #jjlNI}}$--	":: + 	D 	* K'*=i[(IJJKs   C C#c                8   < V ^8  d   QhRS[ S[R3,          RR/# r   r9   r   r   r   r   r   r   r   r   r   r   Y   s$     0 04W- 0* 0r   c                s.    \        V P                  V4      hr#   )r   r   r   r9      &&r   r8   ZHashes._raiseY   s    4==$//r   c                $   < V ^8  d   QhRS[ RR/# )r   filer   N)r   r   r   r   r   r   \   s     < <x <D <r   c                s6    V P                  \        V4      4      # )zQCheck good hashes against a file-like object

Raise HashMismatch if none match.

)r;   r
   )r   rB   r@   r   check_against_fileZHashes.check_against_file\   s     ((T):;;r   c                rA   )r   pathr   N)r   r   r   r   r   r   d   s     1 1s 1t 1r   c                s    \        VR 4      ;_uu_ 4       pV P                  V4      uuRRR4       #   + '       g   i     R# ; i)ZrbN)ZopenrC   )r   rD   rB   s   && r   check_against_pathZHashes.check_against_pathd   s.    $**40 s	   1A	c                s<   < V ^8  d   QhRS[ S[S[3,          RS[/# )r   r   r   )r   r   r3   r   r   r   r   r   h   s#      c3h D r   c                sl    VP                  4        F  w  r#V P                  W#4      '       g   K   R# 	  R# )z3Return whether any of the given hashes are allowed.TF)r   r4   )r   r   r1   r2   s   &&  r   
has_one_ofZHashes.has_one_ofh   s.    %+\\^!I##I:: &4 r   c                r)   r*   )r3   r   r   r   r   r   o   s     # #$ #r   c                s,    \        V P                  4      # )z,Return whether I know any known-good hashes.)r3   r   r.   r/   r   __bool__ZHashes.__bool__o   s    DMM""r   c                s&   < V ^8  d   QhRS[ RS[/# )r   r!   r   )Zobjectr3   r   r   r   r   r   s   s     / /F /t /r   c                sl    \        V\        4      '       g   \        # V P                  VP                  8H  # r#   )r$   r   r%   r   )r   r!   r@   r   __eq__ZHashes.__eq__s   s(    %((!!}}..r   c                r)   r*   r+   r   r   r   r   r   x   s     	
 	
# 	
r   c           	     s    \        R P                  \        R V P                  P	                  4        4       4      4      4      # )Z,c              3   s\   "   T F"  w  rV F  pR P                  W34      x  K  	  K$  	  R# 5i)Z:N)join)r,   r   Zdigest_listZdigests   &   r   r-   Z"Hashes.__hash__.<locals>.<genexpr>{   s5      ,A("- HHc]++"- ,,As   *,)r:   rI   r   r   r   r.   r/   r   __hash__ZHashes.__hash__x   s=    HH ,0MM,?,?,A 
 	
r   )r   r#   )__name__
__module____qualname____firstlineno____doc__r    r(   Zpropertyr0   r4   r;   r8   rC   rE   rF   rG   rH   rJ   __static_attributes____classdictcell__)r   s   @r   r   r      s     

  
  & G G> > .0 0< <1 1 # #/ /
	
 	
r   r   c                   sT   a a ] tR t^t oRtV3R lV 3R lltV3R lR ltRtVtV ;t	# )MissingHasheszA workalike for Hashes used when we're missing a hash for a requirement

It computes the actual hash of the requirement and raises a HashMissing
exception showing it to the user.

c                s   < V ^8  d   QhRR/# )r   r   Nr"   r   r   r   r   MissingHashes.__annotate__   s     5 5$ 5r   c                s4   < \         SV `  \        . /R7       R# )z!Don't offer the ``hashes`` kwarg.)r   N)Zsuperr    FAVORITE_HASH)r   	__class__s   &r   r    ZMissingHashes.__init__   s     	 34r   c                r<   r=   r>   r   r   r   r   rS      s$     ; ;4W- ;* ;r   c                sJ    \        V\        ,          P                  4       4      hr#   )r   rT   r7   r?   r@   r   r8   ZMissingHashes._raise   s    $}-779::r   r"   )
rK   rL   rM   rN   rO   r    r8   rP   rQ   Z__classcell__)rU   r   s   @@r   rR   rR      s#     5 5; ; ;r   rR   )r   Zsha384Zsha512)r6   Ztypingr    r   r   r   r   r   r   Zpip._internal.exceptionsr   r   r	   Zpip._internal.utils.miscr
   r   rT   ZSTRONG_HASHESr   rR   r"   r   r   <module>rV      sG     T T T Q Q 0
 
 /l
 l
^;F ;r   