+
    —h©j>�  ã                   óü  € R t ^ RIHt ^ RIt^ RIt]P
                  ! ]4      t ^ RIHt	 ]	P                  R8X  d   ]P                  R4       Rt	^ RIt^ RIt^ RIHt ^ RIHt  ^ RIHt ^ RIHt ^ R	IHtHtHtHtHtHt ^ R
IHtH t H!t!H"t"H#t# ^ RI$H%t% . R>Ot&R?t'R@t(. RAOt)RRBRRCRRDRRDRRERRFRRCRRGRRHRRIRRJRRKRRBRRLRRI/t*R t+/ t,R t-R t.RMR  lt/],P`                  ]/n1        RNR! lt2 ! R" R]4      t3Rs4]5! . ROO4      t6RPR# lt7]! ]Pp                  Ps                  R$4      4      '       d   ]7! 4        ]! R% ]! R&4       4       4      t:]! R' ]! R&4       4       4      t;RQR( lt<RRR) lt=]! R*4      P|                  t?RRR+ lt]Pp                  Ps                  R,4      ;'       g    R-t@]"'       d   ]@RS9   d   ^ R/IAHBtB R0 tCR1 tDR.tEM=]@RT9   d   ^ RIHt ^ R3IHFtF ]F^@8¬  tG/ tHR4 tCR2tEM]@RU9   g   Q h^ R6IIHJtK ^ R7IHLtL R8 tCR9 tDR5tE]@]E8X  d   R;tt	]'       d   R:MR]	'       d   R;MRR<]E,           3 U u. uF  p T '       g   K  T NK  	  up tMR:]M9   d   ^tNR# R;]M9   d   R=tNR# ^tNR#   ] d    Rt	 ELi ; i  ] d    Rt ELi ; iu up i )Vzlpasslib.crypto.digest -- crytographic helpers used by the password hashes in passlib

.. versionadded:: 1.7
)ÚdivisionN)Úpbkdf2_hmacÚhashlibz*ignoring pure-python hashlib.pbkdf2_hmac())ÚStruct)Úwarn)Úexc)Ú
join_bytesÚto_native_strÚjoin_byte_valuesÚto_bytesÚSequenceMixinÚas_bool)ÚirangeÚ	int_typesÚunicode_or_bytes_typesÚPY3Ú
error_from)Úmemoized_propertyÚHashInfoÚmd5Úsha1Úsha224Úsha256Úsha384Úsha512Úblake2bÚblake2sÚmd4Úsha3_224Úsha3_256Úsha3_384Úsha3_512Úshake128Úshake256c                 óÊ   € / p \        \        P                  \        R.4      ,          4       F2  p\	        V4      pVP
                  VP                  3WP                  &   K4  	  V # )z‰
internal helper used to generate ``_fallback_info`` dict.
currently only run manually to update the above list;
not invoked at runtime.
r   )Úsortedr   Úalgorithms_availableÚsetÚlookup_hashÚdigest_sizeÚ
block_sizeÚname)ÚoutÚalgÚinfos      ÚP/var/www/html/bestweb/venv/lib/python3.14/site-packages/passlib/crypto/digest.pyÚ_gen_fallback_infor0   z   sU   € ð €CÜ”g×2Ñ2´S¸%¸³\ÕAÖBˆÜ˜3ÓˆØ×*Ñ*¨D¯O©OÐ<ˆ�I‰I‹ñ Cð €Jó    c                óú  € T p\        V \        4      '       g   \        V RR4      p \        P                  ! RRV P                  4       P                  4       4      p V P                  R4      '       d&   V R,          p V P                  R4      '       d   V RR p R	 pV! V 4      pV'       d   V# \        P                  ! R
V 4      pV'       d†   VP                  RRR4      w  rVpV'       d	   WV,          pTpV'       d*   VRV,           ,          pV'       d
   VR,          pW‡,          pV! V4      pV'       d   V# \        P                  RWV4       W…3# T pV P                  RR4      p\        P                  RWV4       W…3# )a!  
internal helper used by :func:`lookup_hash` --
normalize arbitrary hash name to hashlib format.
if name not recognized, returns dummy record and issues a warning.

:arg name:
    unnormalized name

:returns:
    tuple with 2+ elements: ``(hashlib_name, iana_name|None, ... 0+ aliases)``.
zutf-8z	hash namez[_ /]Ú-zscram-:é   NNz-plusNc                 ó4   € \          F  pW9   g   K  Vu # 	  R # ©N)Ú_known_hash_names)r+   Úrows   & r/   Úcheck_tableÚ&_get_hash_aliases.<locals>.check_table¢   s   € ß$ˆCØŽ{Ø’
ó %r1   z8(?i)^(?P<name>[a-z]+)-?(?P<rev>\d)?-?(?P<size>\d{3,4})?$r+   ÚrevÚsizeÚ_z0normalizing unrecognized hash name %r => %r / %rz;normalizing unrecognized hash name and format %r => %r / %réûÿÿÿ)Ú
isinstanceÚstrr	   ÚreÚsubÚstripÚlowerÚ
startswithÚendswithÚmatchÚgroupÚlogr.   ÚreplaceÚwarning)	r+   Úorigr9   ÚresultÚmÚ	iana_namer;   r<   Úhashlib_names	   &        r/   Ú_get_hash_aliasesrQ   Š   s^  € ð €DÜ�dœC× Ò Ü˜T 7¨KÓ8ˆÜ�6Š6�'˜3 §
¡
£× 2Ñ 2Ó 4Ó5€DØ‡��x× Ò Ø�B�xˆØ�=‰=˜×!Ò!Ø˜˜�9ˆDòñ ˜Ó€FßØˆô 	�ŠÐLÈdÓS€Aßð  !Ÿw™w v¨u°fÓ=Ñˆ	˜ßØÕˆIØ ˆßØ˜˜t�Õ#ˆIßØ Õ#�ØÕ ˆLÙ˜YÓ'ˆßØˆMô 	�‰ÐCØ Yô	0ð Ð"Ð"ð ˆ	Ø—|‘| C¨Ó-ˆÜ�‰ÐQØ¨	ô	3ð Ð"Ð"r1   c                óL  a a€ S P                  R4      '       g   S R	9  d    \        \        S 4      # \        P                  o S! S R4       R
V V3R llpS Vn        RVn        RS ,          Vn        V#   \         d     LNi ; i  \         d     Mi ; iS R8X  d	   ^ RI	H
p T# R# )zù
internal helper used by :func:`lookup_hash` --
lookup hash constructor by name

:arg name:
    name (normalized to hashlib format, e.g. ``"sha256"``)

:returns:
    hash constructor, e.g. ``hashlib.sha256()``;
    or None if hash can't be located.
r=   r1   c                 ó   <€ S! SV 4      # r6   © )Úmsgr+   Únew_ssl_hashs   &€€r/   ÚconstÚ_get_hash_const.<locals>.constç   s   ø€ Ù  cÓ*Ð*r1   r   zMwrapper for hashlib.new(%r),
generated by passlib.crypto.digest.lookup_hash()r   )r   N)ÚnewÚ
algorithms©r1   )rE   Úgetattrr   ÚAttributeErrorrY   Ú__name__Ú
__module__Ú__doc__Ú
ValueErrorÚpasslib.crypto._md4r   )r+   rW   r   rV   s   f  @r/   Ú_get_hash_constrc   Ê   s¶   ù€ ð �?‰?˜3×Ò DÐ0EÔ$Eð	Üœ7 DÓ)Ð)ô
 —;‘;€Lðá�T˜3Ô÷	+ð 	+àˆŒØ$ˆÔðLØOSõTˆŒàˆøô' ô 	Ùð	ûô ô Ùðúð ˆu„}Ý+Øˆ
ñ
 s#   ¢A3 Á	B Á3BÂ BÂBÂBFc                ó   a	€ \         p W0,          #   \        \        3 d     Mi ; iT'       d   RpRp\        T \        4      '       dl   \        T 4      pT^ ,          o	S	'       g   Q hS	T 8w  d   \        S	TR7      pYcT &   T# \        S	4      pT'       d    \        '       d   S	\        9  d	   R
T	3R llpM\        T \        4      '       d   T # \        T 4      '       d?   T p\        T! 4       P                  4      pT^ ,          o	\        S	4      pTf   M!Y‡J d   MRpM\        P                  ! T RR4      h\        YuTR7      pTe   YcT&   T'       d>   T F7  o	S	'       g   K  TP                  S	4      RT39   g   Q R	S	,          4       hYcS	&   K9  	  T# )a  
Returns a :class:`HashInfo` record containing information about a given hash function.
Can be used to look up a hash constructor by name, normalize hash name representation, etc.

:arg digest:
    This can be any of:

    * A string containing a :mod:`!hashlib` digest name (e.g. ``"sha256"``),
    * A string containing an IANA-assigned hash name,
    * A digest constructor function (e.g. ``hashlib.sha256``).

    Case is ignored, underscores are converted to hyphens,
    and various other cleanups are made.

:param required:
    By default (True), this function will throw an :exc:`~passlib.exc.UnknownHashError` if no hash constructor
    can be found, or if the hash is not actually available.

    If this flag is False, it will instead return a dummy :class:`!HashInfo` record
    which will defer throwing the error until it's constructor function is called.
    This is mainly used by :func:`norm_hash_name`.

:param return_unknown:

    .. deprecated:: 1.7.3

        deprecated, and will be removed in passlib 2.0.
        this acts like inverse of **required**.

:returns HashInfo:
    :class:`HashInfo` instance containing information about specified digest.

    Multiple calls resolving to the same hash should always
    return the same :class:`!HashInfo` instance.
FT©Úrequiredc                 ó(   <€ \        R S,          4      h)z4%r disabled for fips by passlib set_mock_fips_mode())ra   )Úsourcer+   s   &€r/   rW   Úlookup_hash.<locals>.constA  s   ø€ Ü Ð!WÐZ^Õ!^Ó_Ð_r1   Nzdigest name or constructorÚdigest)rW   Únamesrf   z%r already in cacher[   )Ú_hash_info_cacheÚKeyErrorÚ	TypeErrorr?   r   rQ   r(   rc   Úmock_fips_modeÚ_fips_algorithmsr   Úcallabler+   r   ÚExpectedTypeErrorÚget)
rj   Úreturn_unknownrf   ÚcacheÚcache_by_nameÚ	name_listr.   rW   Úother_constr+   s
   &&&      @r/   r(   r(   ú   sŽ  ø€ ôL €EðØ�}ÐøÜ”iÐ ô áðú÷
 Øˆð €MÜ�&Ô0×1Ò1ä% fÓ-ˆ	Ø˜�|ˆßˆˆtð �6Œ>Ü˜t¨hÔ7ˆDØ �&‰MØˆKô   Ó%ˆ÷ —^“^¨Ô4DÔ(D÷`øô 
�FœH×	%Ò	%àˆä	�&×	Ò	ð ˆÜ%¡e£g§l¡lÓ3ˆ	Ø˜�|ˆÜ% dÓ+ˆØÒð àÓ!ð ð "‰Mô ×#Ò# FÐ,HÈ(ÓSÐSô ˜%¸8ÔD€Dð ÒØˆe‰ßÛˆDß‰tØ—y‘y “¨4°¨,Ô6ÐTÐ8MÐPTÕ8TÓTÐ6Ø"�d“ñ ð €Ks   ‰ ‘%¤%c                ó   € \        V RR7      pVP                  '       d,   \        RVP                  ,           \        P
                  4       VR8X  d   VP                  # VR8X  d   VP                  # \        RV: 24      h)aü  Normalize hash function name (convenience wrapper for :func:`lookup_hash`).

:arg name:
    Original hash function name.

    This name can be a Python :mod:`~hashlib` digest name,
    a SCRAM mechanism name, IANA assigned hash name, etc.
    Case is ignored, and underscores are converted to hyphens.

:param format:
    Naming convention to normalize to.
    Possible values are:

    * ``"hashlib"`` (the default) - normalizes name to be compatible
      with Python's :mod:`!hashlib`.

    * ``"iana"`` - normalizes name to IANA-assigned hash function name.
      For hashes which IANA hasn't assigned a name for, this issues a warning,
      and then uses a heuristic to return a "best guess" name.

:returns:
    Hash name, returned as native :class:`!str`.
Fre   znorm_hash_name(): r   Úianazunknown format: )	r(   Úunknownr   Ú
error_textr   ÚPasslibRuntimeWarningr+   rO   ra   )r+   Úformatr.   s   && r/   Únorm_hash_namer   s  se   € ô0 �t eÔ,€DØ‡|‡|€|ÜÐ! D§O¡OÕ3´S×5NÑ5NÔOØ�ÔØ�y‰yÐØ	�6Ô	Ø�~‰~Ðå²Ð9Ó:Ð:r1   c                   óŠ   a € ] tR tRt o RtRtRtRtRtRt	Rt
RtRtRR ltR tR t]R 4       t]R	 4       t]R
 4       tRtV tR# )r   i–  a·  
Record containing information about a given hash algorithm, as returned :func:`lookup_hash`.

This class exposes the following attributes:

.. autoattribute:: const
.. autoattribute:: digest_size
.. autoattribute:: block_size
.. autoattribute:: name
.. autoattribute:: iana_name
.. autoattribute:: aliases
.. autoattribute:: supported

This object can also be treated a 3-element sequence
containing ``(const, digest_size, block_size)``.
NFc                óH  a aa€ V^ ,          ;oS n         V^,          S n        VR,          S n        VVV 3R lpVf0   V\        9   d   RS,          pMRS,          pRS n        V! V4       R#  V! 4       pTS n
        TP                  S n        TP                  S n        \        TP                  4       4      TP                  8w  d   \        RS P                   ,          4      hTP                   S P                   8w  d=   \!        RS P                   : RT: RTP                   : 2\"        P$                  4       R# R#   \
         d^   pR\        T4      P                  4       9   d   RS,          pM"R	S: R
\        T4      P                  : RT: R2pT! T4        Rp?R# Rp?ii ; i)zÐ
initialize new instance.
:arg const:
    hash constructor
:arg names:
    list of 2+ names. should be list of ``(name, iana_name, ... 0+ aliases)``.
    names must be lower-case. only iana name may be None.
:é   NNc                ó²   <a € RV V3R llpS'       d	   V! 4         S Sn         VSn         \        S,          w  Sn        Sn        R#   \
         d     R# i ; i)zK
helper that installs stub constructor which throws specified error <msg>.
c                 ó2   <€ \         P                  ! SS4      hr6   )r   ÚUnknownHashError)rh   rU   r+   s   &€€r/   rW   Ú8HashInfo.__init__.<locals>.use_stub_const.<locals>.constÜ  s   ø€ Ü×*Ò*¨3°Ó5Ð5r1   Nr[   )r|   rW   Ú_fallback_infor)   r*   rm   )rU   rW   r+   rf   Úselfs   f €€€r/   Úuse_stub_constÚ)HashInfo.__init__.<locals>.use_stub_constØ  sS   ù€ ÷6ð 6çñ ”Ø+Ø!ˆDŒOØˆDŒJðÜ4BÀ4Õ4HÑ1�Ô  $¦/øÜô Úðús   «A ÁAÁANzunsupported hash: %rzunknown hash: %rTzdisabled for fipsz%r hash disabled for fipszinternal error in z constructor
(z: Ú)z"%r constructor failed sanity checkzinconsistent digest name: z resolved to z, which reports name as )r+   rO   Úaliasesr7   r{   ra   r@   rD   Útyper^   rW   r)   r*   Úlenrj   ÚRuntimeErrorr   r   r}   )	rˆ   rW   rk   rf   r‰   rU   ÚhashÚerrr+   s	   f&&f    @r/   Ú__init__ÚHashInfo.__init__É  s^  ú€ ð ! �8Ð#ˆˆtŒyØ˜q�ˆŒØ˜R•yˆŒ÷	ð& Š=ØÔ)Ô)Ø,¨tÕ3‘à(¨4Õ/�Ø#�”Ù˜3Ôáð	Ù“7ˆDð ˆŒ
Ø×+Ñ+ˆÔØŸ/™/ˆŒô ˆt�{‰{‹}Ó ×!1Ñ!1Ô1ÜÐCÀdÇiÁiÕOÓPÐPð �9‰9˜Ÿ	™	Ô!ÝØ—)”)›U D§I£Ið/Ü03×0IÑ0IöKñ "øô- ô 
	ð
 #¤c¨#£h§n¡nÓ&6Ô6Ø1°DÕ8‘ð 7ó GKÌDÐQTËI×L^ÔL^Ó`cÐd�Ù˜3ÔÝûð
	ús   Á,D9 Ä9F!ÅAFÆF!c                ó\   € R V P                   : RV P                  : RV P                  : R2# )z<lookup_hash(z): digest_size=z block_size=r‹   )r+   r)   r*   ©rˆ   s   &r/   Ú__repr__ÚHashInfo.__repr__  s!   � à—	”	˜4×+Ô+¨T¯_¬_ð>ð 	>r1   c                óH   € V P                   V P                  V P                  3# r6   )rW   r)   r*   r•   s   &r/   Ú	_as_tupleÚHashInfo._as_tuple  s   € Ø�z‰z˜4×+Ñ+¨T¯_©_Ð<Ð<r1   c                ó   € V P                   RJ # )za
whether hash is available for use
(if False, constructor will throw UnknownHashError if called)
N)r|   r•   s   &r/   Ú	supportedÚHashInfo.supported  s   € ð �‰ $Ð&Ð&r1   c                óx   € \         '       g   R#  \        V P                  RR^4       R#   \         d     R# i ; i)z5helper to detect if hash is supported by fastpbkdf2()Nó   pó   sTF)Ú_fast_pbkdf2_hmacr+   ra   r•   s   &r/   Úsupported_by_fastpbkdf2Ú HashInfo.supported_by_fastpbkdf2$  s9   € ÷ !Ó Ùð	Ü˜dŸi™i¨¨t°QÔ7ÙøÜô 	âð	úó   �* ª9¸9c                óx   € \         '       g   R#  \        V P                  RR^4       R#   \         d     R# i ; i)z>helper to detect if hash is supported by hashlib.pbkdf2_hmac()NrŸ   r    TF)Ú_stdlib_pbkdf2_hmacr+   ra   r•   s   &r/   Úsupported_by_hashlib_pbkdf2Ú$HashInfo.supported_by_hashlib_pbkdf20  s9   € ÷ #Ó"Ùð	Ü §	¡	¨4°°qÔ9ÙøÜô 	âð	úr¤   )rŒ   r*   rW   r)   r|   rO   r+   r{   rT   ©T)r^   r_   Ú__qualname__Ú__firstlineno__r`   r+   rO   rŒ   rW   r)   r*   r|   r{   r’   r–   r™   r   rœ   r¢   r§   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r/   r   r   –  s�   ø‡ € ñð* €Dð €Ið €Gð €Eð €Kð €Jð €Jð €GôGKòX>ò=ð ñ'ó ð'ð ñ	ó ð	ð ñ	ó ö	r1   c                ó2   € V s \        P                  4        R# )zO
UT helper which monkeypatches lookup_hash() internals to replicate FIPS mode.
N)ro   r(   Úclear_cache)Úenables   &r/   Ú_set_mock_fips_moder²   _  s   € ð
 €NÜ×ÑÖr1   ÚPASSLIB_MOCK_FIPS_MODEc              #   ó2   "  € T F  q^\,          x € K  	  R# 5i)é\   NrT   ©Ú.0Úxs   & r/   Ú	<genexpr>r¹   q  ó   é € Ð=±¨A $Ÿhšh³ùó   ‚é   c              #   ó2   "  € T F  q^6,          x € K  	  R# 5i)é6   NrT   r¶   s   & r/   r¹   r¹   r  rº   r»   c                óä  a	a
€ \        V 4      pVw  rEpV^8¼  g   Q R4       h\        V\        4      '       g   \        VRR7      p\	        V4      pWv8”  d   V! V4      P                  4       pTpWv8  d   VRWg,
          ,          ,          pV! VP                  \        4      4      P                  o	V! VP                  \        4      4      P                  o
V'       d	   V	V
3R lpMV	V
3R lpW8n
        V# )a^  
This function returns an efficient HMAC function, hardcoded with a specific digest & key.
It can be used via ``hmac = compile_hmac(digest, key)``.

:arg digest:
    digest name or constructor.

:arg key:
    secret key as :class:`!bytes` or :class:`!unicode` (unicode will be encoded using utf-8).

:param multipart:
    request a multipart constructor instead (see return description).

:returns:
    By default, the returned function has the signature ``hmac(msg) -> digest output``.

    However, if ``multipart=True``, the returned function has the signature
    ``hmac() -> update, finalize``, where ``update(msg)`` may be called multiple times,
    and ``finalize() -> digest_output`` may be repeatedly called at any point to
    calculate the HMAC digest so far.

    The returned object will also have a ``digest_info`` attribute, containing
    a :class:`lookup_hash` instance for the specified digest.

This function exists, and has the weird signature it does, in order to squeeze as
provide as much efficiency as possible, by omitting much of the setup cost
and features of the stdlib :mod:`hmac` module.
zblock size too smallÚkey©Úparamó    c                 ó>   <a€ S! 4       oVV3R lp SP                   V 3# )z)generated by compile_hmac(multipart=True)c                  óp   <€ S! 4       p V P                  SP                  4       4       V P                  4       # r6   ©Úupdaterj   )ÚouterÚ_outer_copyÚinners    €€r/   ÚfinalizeÚ,compile_hmac.<locals>.hmac.<locals>.finalize­  s(   ø€ Ù#›�Ø—‘˜UŸ\™\›^Ô,Ø—|‘|“~Ð%r1   )rÇ   )rË   rÊ   Ú_inner_copyrÉ   s    @€€r/   ÚhmacÚcompile_hmac.<locals>.hmacª  s    ù€ á“MˆEö&ð —<‘< Ð)Ð)r1   c                ó    <€ S! 4       pVP                  V 4       S! 4       pVP                  VP                  4       4       VP                  4       # )zgenerated by compile_hmac()rÆ   )rU   rÊ   rÈ   rÍ   rÉ   s   &  €€r/   rÎ   rÏ   µ  s;   ø€ á“MˆEØ�L‰L˜ÔÙ“MˆEØ�L‰L˜Ÿ™›Ô(Ø—<‘<“>Ð!r1   )r(   r?   Úbytesr   rŽ   rj   Ú	translateÚ	_TRANS_36ÚcopyÚ	_TRANS_5CÚdigest_info)rj   rÀ   Ú	multipartrÖ   rW   r)   r*   ÚklenrÎ   rÍ   rÉ   s   &&&      @@r/   Úcompile_hmacrÙ   t  sÕ   ù€ ô@ ˜fÓ%€KØ%0Ñ"€E˜
Ø˜ÔÐ3Ð3Ó3Ðô �cœ5×!Ò!Ü�s %Ô(ˆÜˆs‹8€DØÔÙ�C‹j×ÑÓ!ˆØˆØÔØˆw˜*Õ+Õ,Õ,ˆñ ˜Ÿ™¤iÓ0Ó1×6Ñ6€KÙ˜Ÿ™¤iÓ0Ó1×6Ñ6€Kç÷	*ö	"ð #ÔØ€Kr1   c                óü  € \        V 4      w  rVp\        VRR7      p\        VRR7      p\        V\        4      '       g   \        P
                  ! VRR4      hV^8  d   \        R4      hVf   TpMY\        V\        4      '       g   \        P
                  ! VRR	4      hV^ 8  d   \        R
4      hWF8”  d   \        RV: RV: 24      hW,           p\        V4       F  p	V! V4      P                  4       pK  	  VRV # )aç  pkcs#5 password-based key derivation v1.5

:arg digest:
    digest name or constructor.
    
:arg secret:
    secret to use when generating the key.
    may be :class:`!bytes` or :class:`unicode` (encoded using UTF-8).
    
:arg salt:
    salt string to use when generating key.
    may be :class:`!bytes` or :class:`unicode` (encoded using UTF-8).

:param rounds:
    number of rounds to use to generate key.

:arg keylen:
    number of bytes to generate (if omitted / ``None``, uses digest's native size)

:returns:
    raw :class:`bytes` of generated key

.. note::

    This algorithm has been deprecated, new code should use PBKDF2.
    Among other limitations, ``keylen`` cannot be larger
    than the digest size of the specified hash.
ÚsecretrÁ   ÚsaltÚintÚroundsúrounds must be at least 1Núint or NoneÚkeylenzkeylen must be at least 0z keylength too large for digest: z > )	r(   r   r?   r   r   rr   ra   r   rj   )
rj   rÛ   rÜ   rÞ   rá   rW   r)   r*   Úblockr=   s
   &&&&&     r/   Úpbkdf1rã   Ä  s÷   € ô< &1°Ó%8Ñ"€E˜
ô �f HÔ-€FÜ�D Ô'€Dô �fœi×(Ò(Ü×#Ò# F¨E°8Ó<Ð<Ø�„zÜÐ4Ó5Ð5ð ‚~Ø‰Ü˜¤	×*Ò*Ü×#Ò# F¨M¸8ÓDÐDØ	�!ŒÜÐ4Ó5Ð5Ø	Ô	ÝÛ ¢+ð/ó 0ð 	0ð �M€EÜ�FŽ^ˆÙ�e“×#Ñ#Ó%Šñ à��&ˆ>Ðr1   z>Lc                ó  aaaa	€ \        VRR7      p\        SRR7      o\        V 4      pVP                  p\        S\        4      '       g   \
        P                  ! SRR4      hS^8  d   \        R4      hVf   TpM@\        V\        4      '       g   \
        P                  ! VRR	4      hV^8  d   \        R
4      hWF,           ^,
          V,          pV\        8”  d   \        R4      hVP                  '       d   \        VP                  VSSV4      # VP                  '       d   \        VP                  VSSV4      # \        W4      o	\!        V4      o\#        VV	VV3R l\%        ^V^,           4       4       4      RV # )aÂ  pkcs#5 password-based key derivation v2.0 using HMAC + arbitrary digest.

:arg digest:
    digest name or constructor.

:arg secret:
    passphrase to use to generate key.
    may be :class:`!bytes` or :class:`unicode` (encoded using UTF-8).

:arg salt:
    salt string to use when generating key.
    may be :class:`!bytes` or :class:`unicode` (encoded using UTF-8).

:param rounds:
    number of rounds to use to generate key.

:arg keylen:
    number of bytes to generate.
    if omitted / ``None``, will use digest's native output size.

:returns:
    raw bytes of generated key

.. versionchanged:: 1.7

    This function will use the first available of the following backends:

    * `fastpbk2 <https://pypi.python.org/pypi/fastpbkdf2>`_
    * :func:`hashlib.pbkdf2_hmac` (only available in py2 >= 2.7.8, and py3 >= 3.4)
    * builtin pure-python backend

    See :data:`passlib.crypto.digest.PBKDF2_BACKENDS` to determine
    which backend(s) are in use.
rÛ   rÁ   rÜ   rÝ   rÞ   rß   Nrà   rá   zkeylen must be at least 1zkeylen too long for digestc           
   3   ód   <"  € T F%  pS! SS! S\        V4      ,           4      S4      x € K'  	  R # 5ir6   )Ú_pack_uint32)r·   ÚiÚ
calc_blockÚ
keyed_hmacrÞ   rÜ   s   & €€€€r/   r¹   Úpbkdf2_hmac.<locals>.<genexpr>c  s2   øé € ð á+ˆAñ 	�:™z¨$´¸a³Õ*@ÓAÀ6×JÐJÛ+ùs   ƒ-0)r   r(   r)   r?   r   r   rr   ra   Ú
MAX_UINT32ÚOverflowErrorr¢   r¡   r+   r§   r¦   rÙ   Ú_get_pbkdf2_looperr   r   )
rj   rÛ   rÜ   rÞ   rá   rÖ   r)   Úblock_countrè   ré   s
   &&ff&   @@r/   r   r     sn  û€ ôH �f HÔ-€FÜ�D Ô'€Dô ˜fÓ%€KØ×)Ñ)€Kô �fœi×(Ò(Ü×#Ò# F¨E°8Ó<Ð<Ø�„zÜÐ4Ó5Ð5ð ‚~Ø‰Ü˜¤	×*Ò*Ü×#Ò# F¨M¸8ÓDÐDØ	�!ŒäÐ4Ó5Ð5ð Õ'¨!Õ+°Õ;€KØ”ZÔÜÐ8Ó9Ð9ð ×*×*Ð*Ü  ×!1Ñ!1°6¸4ÀÈÓPÐPð
 ×.×.Ð.Ü" ;×#3Ñ#3°V¸TÀ6È6ÓRÐRô ˜fÓ-€Jô $ KÓ0€Jô ÷ ä˜˜;¨�?Ô+óó ð €vðð r1   ÚPASSLIB_PBKDF2_BACKENDÚanyú
from-bytes)Úpartialc                 ó"   € \        \        V 4      # r6   )rò   Ú_pbkdf2_looper©r)   s   &r/   rí   rí   r  s   € Ü”~ {Ó3Ð3r1   c                ó¶   € \         P                  pRpV! W%4      p\        V^,
          4       F  pV! V4      pWd! W%4      ,          pK  	  VP                  W4      # )zS
py3-only implementation of pbkdf2 inner loop;
uses 'int.from_bytes' + integer XOR
Úbig)rÝ   Ú
from_bytesr   r   )r)   ré   rj   rÞ   rø   ÚBIGÚaccumr=   s   &&&&    r/   rô   rô   u  sY   € ô
 —^‘^ˆ
ØˆÙ˜6Ó'ˆÜ˜ �
Ö#ˆAÙ Ó'ˆFØ�Z Ó,Õ,ŠEñ $ð �~‰~˜kÓ/Ð/r1   Úunpack)Úsys_bitsc           
     ó<  €  \         V ,          #   \         d     Mi ; i\        '       d#   T ^,          '       g   T ^,	          pRT,          pM\T ^,          '       g<   \        '       d   T ^,	          pRT,          pT^,          pM%T ^,	          pRT,          pM\        RT ,          4      h\	        T4      p\        T RP                  R \        T4       4       4      RP                  R \        T4       4       4      R7      pR	P                  ! R/ TB p\        T4       F  pTR
Yf3,          ,          pK  	  TRP                  ! R/ TB ,          p\        TRR4      p\        \        TR7      p\        4       p	\        YxT	4       T	R,          p
 YZn        T
\         T &   T
# )a‰  
We want a helper function which performs equivalent of the following::

  def helper(keyed_hmac, digest, rounds):
      accum = digest
      for _ in irange(rounds - 1):
          digest = keyed_hmac(digest)
          accum ^= digest
      return accum

However, no efficient way to implement "bytes ^ bytes" in python.
Instead, using approach where we dynamically compile a helper function based
on digest size.  Instead of a single `accum` var, this helper breaks the digest
into a series of integers.

It stores these in a series of`accum_<i>` vars, and performs `accum ^= digest`
by unpacking digest and perform xor for each "accum_<i> ^= digest_<i>".
this keeps everything in locals, avoiding excessive list creation, encoding or decoding,
etc.

:param digest_size:
    digest size to compile for, in bytes. (must be multiple of 4).

:return:
    helper function with call signature outlined above.
z=%dQz=%dQIz=%dIzunsupported digest size: %dz, c              3   ó4   "  € T F  pR V,          x € K  	  R# 5i)zacc_%dNrT   ©r·   rç   s   & r/   r¹   Ú%_get_pbkdf2_looper.<locals>.<genexpr>Ì  s   é € Ð E±}°! ¨A§¢³}ùó   ‚c              3   ó4   "  € T F  pR V,          x € K  	  R# 5i)zdig_%dNrT   rÿ   s   & r/   r¹   r   Í  s   é € Ð!F¹°1 (¨Q§,¢,»ùr  )r)   Ú
accum_varsÚdigest_varsa   def helper(keyed_hmac, digest, rounds):
    '''pbkdf2 loop helper for digest_size={digest_size}'''
    unpack_digest = struct.unpack
    {accum_vars} = unpack_digest(digest)
    for _ in irange(1, rounds):
        digest = keyed_hmac(digest)
        {digest_vars} = unpack_digest(digest)
z        acc_%d ^= dig_%d
z%    return struct.pack({accum_vars})
z9<generated by passlib.crypto.digest._get_pbkdf2_looper()>Úexec)r   ÚstructÚhelperrT   )Ú_looper_cacherm   Ú_have_64_bitÚNotImplementedErrorr   ÚdictÚjoinr   r~   ÚcompileÚevalÚ
__source__)r)   ÚcountÚfmtr  Útdictrh   rç   ÚcodeÚgdictÚldictr  s   &          r/   rí   rí   �  s’  € ð<	Ü  Õ-Ð-øÜô 	Ùð	ú÷ ‹< ¨c× 1Ô 1à  AÕ%ˆEØ˜5•.‰CØ˜s×"Ô"ß‹|à$¨Õ)�Ø •o�Ø˜•
‘ð %¨Õ)�Ø˜u•n‘ô &Ð&CÀkÕ&QÓRÐRÜ˜“ˆô
 Ø#Ø—y‘yÑ E´v¸e´}Ó EÓEØŸ	™	Ñ!F¼¸u¼Ó!FÓFô
ˆðJ÷ ‰&ðñ ð ñˆô ˜–ˆAØÐ4¸°vÕ=Õ=ŠFñ ð 	Ð@×GÒGÑPÈ%ÑPÕPˆô
 �vÐZÐ\bÓcˆÜœF¨6Ô2ˆÜ“ˆÜˆT˜%Ô Ø�x•ˆØØ &Ôð
 &,Œ�kÑ"Øˆs   ‚ �œÚhexlify)r  )Úint_to_bytesc                 ó   € \         # r6   )rô   rõ   s   &r/   rí   rí   þ  s   € ÜÐr1   c                 óÐ   € \         p\        V! V4      ^4      p\        V^,
          4       F$  pV ! V4      pV\        V! V4      ^4      ,          pK&  	  \        V\	        V4      4      # )é   )Ú_hexlifyrÝ   r   r  rŽ   )ré   rj   rÞ   r  rú   r=   s   &&&   r/   rô   rô     s\   € ÜˆÜ‘G˜F“O RÓ(ˆÜ˜ �
Ö#ˆAÙ Ó'ˆFØ”S™ ›¨"Ó-Õ-ŠEñ $ô ˜E¤3 v£;Ó/Ð/r1   Ú
fastpbkdf2zhashlib-sslzbuiltin-gffffffö?)r(   r   r   rÙ   rã   r   l   ÿÿ l   ÿÿÿÿ ))Úmd2r  )r   r   )r   zsha-1)r   zsha-224zsha2-224)r   zsha-256zsha2-256)r   zsha-384zsha2-384)r   zsha-512zsha2-512)r   zblake-2b)r   zblake-2s)r   r   )Ú	ripemd160z
ripemd-160Úripemd)é@   é€   )é    r   )r  r   )é   r   )é   r   )é0   r!  )r$  é�   )r"  éˆ   )r%  éh   )r   éH   )r  é¨   )FT)r   )r   r   r   r   r   r   r   r    r!   Ú	shake_128Ú	shake_256r©   )Fr6   )rð   rñ   )rð   rû   rñ   )rð   r  )Or`   Ú
__future__r   r   ÚloggingÚ	getLoggerr^   rI   r   r¦   r_   ÚdebugÚImportErrorrA   Úosr  r   Úwarningsr   r  r¡   Úpasslibr   Úpasslib.utilsr   r	   r
   r   r   r   Úpasslib.utils.compatr   r   r   r   r   Úpasslib.utils.decorr   Ú__all__rë   Ú
MAX_UINT64r7   r‡   r0   rl   rQ   rc   r(   Úclearr°   r   r   ro   r'   rp   r²   Úenvironrs   rÕ   rÓ   rÙ   rã   Úpackræ   Ú_force_backendÚ	functoolsrò   rí   rô   Ú_builtin_backendrü   r	  r  Úbinasciir  r  r  ÚPBKDF2_BACKENDSÚPBKDF2_SPEED_FACTOR)Úbs   0r/   Ú<module>rD     s  ðñõ  ã Û �g×'Ò'¨Ó1�ð	å:Ø×%Ñ%¨Ô2ð 	�	‰	Ð>Ô?Ø"Ðó 
Û 	Ý Ý ðå;õ ÷1÷ 1ç [Õ [Ý 1ò€ð& €
ð €
òÐ ðH ˆyØˆxØ	ˆ8Ø	ˆ8Ø
ˆHØˆhØˆhØˆiØ�	Ø�	Ø�	Ø�ØˆiØ�	Ø�	ð!€ò(
ð Ð ò=#ò@-ô`sðl +×0Ñ0€Ô ô ;ôFdˆ}ô dð` €ñ
 ò ó Ð ô(ñ ˆ2�:‰:�>‰>Ð2Ó3×4Ò4ÙÔñ Ñ=±¸´Ó=Ó=€	ÙÑ=±¸´Ó=Ó=€	ôKô`9ñ~ �d‹|× Ñ €ôaðP —‘—‘Ð 8Ó9×BÐB¸U€çˆ>Ð2Ô2Ý!ò4ò0ð $ÑàÐ6Ô6ÝÝ&à ‘N€Lð €MòdðL  Ñð Ð/Ô/Ð/Ð/õ
 -Ý*òò0ð !Ðð Ð%Ô%Ø.2Ð2ÐÐ+÷ &�L¨4ß(�M¨dØÐ!Õ!ñó ñ ˜ô ÷	 �1ñ ñ €ð �?Ô"ØÒØ�oÔ%ØÒð ÒøðS  ô ØÓðûð ô ØÓðüòds/   ¤*I Á#I) È'
I9È6I9É	I&É%I&É)	I6É5I6