Ë
    V.jy  ã            	       óè   — d Z ddlmZmZmZ ddedededefd„ZdgZ	e
d	k(  rQ ed
«       ddlZ ed«      D ]1  Z ej                  «       \  ZZer nedz  dk(  sŒ$esŒ' edez  «       Œ3  ed«       yy)z¿Functions for PKCS#1 version 2 encryption and signing

This module implements certain functionality from PKCS#1 version 2. Main
documentation is RFC 2437: https://tools.ietf.org/html/rfc2437
é    )ÚcommonÚpkcs1Ú	transformÚseedÚlengthÚhasherÚreturnc                 óÔ  ‡ ‡— 	 t        j                  ‰   «       j                  }|d|z  kD  rt        dj                  |‰¬«      «      ‚dj                  ˆˆ fd	„t        t        j                  ||«      d
z   «      D «       «      }|d| S # t        $ rU}t	        dj                  dj                  t        t         j                  j                  «       «      «      ¬«      «      |‚d}~ww xY w)aˆ  
    MGF1 is a Mask Generation Function based on a hash function.

    A mask generation function takes an octet string of variable length and a
    desired output length as input, and outputs an octet string of the desired
    length. The plaintext-awareness of RSAES-OAEP relies on the random nature of
    the output of the mask generation function, which in turn relies on the
    random nature of the underlying hash.

    :param bytes seed: seed from which mask is generated, an octet string
    :param int length: intended length in octets of the mask, at most 2^32(hLen)
    :param str hasher: hash function (hLen denotes the length in octets of the hash
        function output)

    :return: mask, an octet string of length `length`
    :rtype: bytes

    :raise OverflowError: when `length` is too large for the specified `hasher`
    :raise ValueError: when specified `hasher` is invalid
    z=Invalid `hasher` specified. Please select one of: {hash_list}z, )Ú	hash_listNl        zmDesired length should be at most 2**32 times the hasher's output length ({hash_length} for {hasher} function))Úhash_lengthr   ó    c              3   ó|   •K  — | ]3  }t        j                  ‰t        j                  |d ¬«      z   ‰¬«      –— Œ5 y­w)é   )Ú	fill_size)Úmethod_nameN)r   Úcompute_hashr   Ú	int2bytes)Ú.0Úcounterr   r   s     €€úNC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\rsa/pkcs1_v2.pyÚ	<genexpr>zmgf1.<locals>.<genexpr>H   sG   øè ø€ ð ñ
 GˆGô	 	×ÑØ”9×&Ñ& w¸!Ô<Ñ<Ø÷	
ð 	
ñ Gùs   ƒ9<é   )r   ÚHASH_METHODSÚdigest_sizeÚKeyErrorÚ
ValueErrorÚformatÚjoinÚsortedÚkeysÚOverflowErrorÚranger   Úceil_div)r   r   r   r   ÚexÚoutputs   ` `   r   Úmgf1r&      sò   ù€ ð,Ü×(Ñ(¨Ñ0Ó2×>Ñ>ˆð �˜;Ñ&Ò'Üð;ß;A¹6Ø'Øð <Bó <ó
ð 	
ð �X‰Xô ô
 œVŸ_™_¨V°[ÓAÀAÑEÔFóó €Fð �'�6ˆ?Ðøô; ò ÜØK×RÑRØŸ)™)¤F¬5×+=Ñ+=×+BÑ+BÓ+DÓ$EÓFð Só ó
ð ð		ûðús   „!B	 Â		C'ÂAC"Ã"C'r&   Ú__main__z'Running doctests 1000x or until failureNiè  éd   z%i timeszDoctests done)zSHA-1)Ú__doc__Úrsar   r   r   ÚbytesÚintÚstrr&   Ú__all__Ú__name__ÚprintÚdoctestr"   ÚcountÚtestmodÚfailuresÚtests© r   r   Ú<module>r7      s©   ðñ÷ñ ñ5ˆuð 5˜cð 5¨3ð 5¸Uó 5ðr ð€ð ˆzÒÙ	Ð
3Ô4Ûá�t–ˆØ+˜GŸO™OÓ-Ñˆ�5ÙÙà�3‰;˜!Ó¢Ù�*˜uÑ$Õ%ð ñ 
ˆ/Õð r   