+
    THi*&                         R t ^ RIHt ^ RIHu Ht ^ RIHt ^ RI	H
t
 RR.tRtRtR	tRtRtRR
 lt ! R R]P$                  ]P&                  4      t ! R R]P*                  ]4      t ! R R]4      tR# )zmd5-crypt algorithm)md5N)repeat_string)h64	md5_cryptapr_md5_crypt    s   $1$s   $apr1$c                \   \        V \        4      '       d   V P                  R4      p \        V \        4      '       g   Q R4       h\        V 9   d$   \
        P                  P                  \        4      h\        V 4      p\        V\        4      '       g   Q R4       hVP                  R4      p\        V4      ^	8  g   Q R4       hV'       d   \        pM\        p\        W,           V ,           4      P                  4       p\        W,           V,           4      pVP                  pV! \        WS4      4       TpV R,          p	V'       d)   T! V^,          '       d   \        MT	4       V^,          pK0  VP                  4       p
W ,           pW,           pWWV ,           W,           W,           .p\          UUu. uF  w  rW,          W,          3NK  	  pppT
p^pV'       dU   V FC  w  r\        V\        VV,           4      P                  4       ,           4      P                  4       pKE  	  V^,          pK\  VR,           FC  w  r\        V\        VV,           4      P                  4       ,           4      P                  4       pKE  	  \"        P$                  ! V\&        4      P)                  R4      # u uppi )ab  perform raw md5-crypt calculation

this function provides a pure-python implementation of the internals
for the MD5-Crypt algorithms; it doesn't handle any of the
parsing/validation of the hash strings themselves.

:arg pwd: password chars/bytes to hash
:arg salt: salt chars to use
:arg use_apr: use apache variant

:returns:
    encoded checksum chars
zutf-8zpwd not str or byteszsalt not strasciizsalt too large:N   N:N   N)
isinstancestrencodebytes_BNULLuhexcNullPasswordErrorr   len
_APR_MAGIC
_MD5_MAGICr   digestupdater   _c_digest_offsetsr   encode_transposed_bytes_transpose_mapdecode)pwdsaltuse_aprpwd_lenmagicdba_ctxa_ctx_updateievenchardapwd_pwdpwd_saltpermsevenodddatadcblockss   &&&                </usr/lib/python3/dist-packages/passlib/handlers/md5_crypt.py_raw_md5_cryptr1   7   s!   , #sjj!c5!!9#99!}ff&&y11#hG dC  0.0 ;;wDt9q=***= 	SZ#		%	%	'Bd"#E<<L r+, 	A2wH
q1uuV(3	a 
B\ iGzH8^TZPE 8II7H)$U[%*%7HDI 
BF
IDS3rDy>00223::<B ! #YY	s29~,,../668 &&r>:AA'JJ Js   0J(c                   v   a  ] tR t^t o RtRt^t]P                  t	^t
]P                  t]R 4       tR tRtV tR# )_MD5_Commonz+common code for md5_crypt and apr_md5_cryptc                \    \         P                  ! WP                  V R 7      w  r#V ! W#R7      # ))handler)r   checksum)r   	parse_mc2ident)clshashr   chks   &&  r0   from_string_MD5_Common.from_string   s#    LLyy#>	++    c                n    \         P                  ! V P                  V P                  V P                  4      # N)r   
render_mc2r8   r   r6   )selfs   &r0   	to_string_MD5_Common.to_string   s!    }}TZZDMMBBr>    N)r   	salt_size)__name__
__module____qualname____firstlineno____doc__setting_kwdschecksum_sizer   HASH64_CHARSchecksum_charsmax_salt_size
salt_charsclassmethodr<   rC   __static_attributes____classdictcell____classdict__s   @r0   r3   r3      sI     5 )LM__NMJ, ,C Cr>   r3   c                   F   a  ] tR t^t o RtR tRtRt]R 4       t	R t
RtV tR# )r   a=  This class implements the MD5-Crypt password hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: str
:param salt:
    Optional salt string.
    If not specified, one will be autogenerated (this is recommended).
    If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

:type salt_size: int
:param salt_size:
    Optional number of characters to use when autogenerating new salts.
    Defaults to 8, but can be any value between 0 and 8.
    (This is mainly needed when generating Cisco-compatible hashes,
    which require ``salt_size=4``).

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z$1$c                <    V P                  V P                  4       R # )T)_set_calc_checksum_backend_calc_checksum_builtin)r9   s   &r0   _load_backend_builtinmd5_crypt._load_backend_builtin   s    &&s'A'ABr>   c                ,    \        WP                  4      # r@   r1   r   rB   secrets   &&r0   rZ    md5_crypt._calc_checksum_builtin   s    fii00r>   rE   N)builtin)rG   rH   rI   rJ   rK   namer8   backendsrR   r[   rZ   rS   rT   rU   s   @r0   r   r      s;     < DE H
  1 1r>   c                   2   a  ] tR tRt o RtR tRtR tRtV t	R# )r   i  a0  This class implements the Apr-MD5-Crypt password hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: str
:param salt:
    Optional salt string.
    If not specified, one will be autogenerated (this is recommended).
    If specified, it must be 0-8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z$apr1$c                0    \        WP                  R R7      # )T)r   r^   r_   s   &&r0   _calc_checksumapr_md5_crypt._calc_checksum  s    fii>>r>   rE   N)
rG   rH   rI   rJ   rK   rc   r8   rg   rS   rT   rU   s   @r0   r   r     s      . DE? ?r>   ))          r
   rl   rj   )r
      rk   rm   r
   rj   )   r
   rm   ro   )rl   ri   rm   ro   rk   )rp   rj   ro   rk   )rl   rn   ro   rk   rm   )      ri         r
         rn      	   rj   rl   
   rp      )F)rK   hashlibr   passlib.utils.handlersutilshandlersr   passlib.utilsr   passlib.utils.binaryr   __all__r   r   r   r   r   r1   HasSaltGenericHandlerr3   HasManyBackendsr   r   rE   r>   r0   <module>r      s      # # ' $  


 2 HKDC"**b// C./1""K /1d?K ?r>   