+
    THi[                         R t ^ RIHt ^ RIHu Ht ^ RIHt R.t	 ! R R]P                  ]P                  ]P                  ]P                  4      tR# )zPHPass Portable Crypt

phppass located - http://www.openwall.com/phpass/
algorithm described - http://www.openwall.com/articles/PHP-Users-Passwords

phpass context - blowfish, bsdi_crypt, phpass
)md5N)h64phpassc                      a  ] tR t^t o RtR tRt]P                  t	^;t
t]P                  t^t^t^tRtRtRtRRRR/t]R 4       tR tR	 tR
tV tR# )r   a  This class implements the PHPass Portable Hash, and follows the :ref:`password-hash-api`.

It supports a fixed-length salt, and a variable number of rounds.

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 8 characters, drawn from the regexp range ``[./0-9A-Za-z]``.

:type rounds: int
:param rounds:
    Optional number of rounds to use.
    Defaults to 19, must be between 7 and 30, inclusive.
    This value is logarithmic, the actual number of iterations used will be :samp:`2**{rounds}`.

:type ident: str
:param ident:
    phpBB3 uses ``H`` instead of ``P`` for its identifier,
    this may be set to ``H`` in order to generate phpBB3 compatible hashes.
    it defaults to ``P``.

: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 ``rounds``
    that are too small or too large, and ``salt`` strings that are too long.

    .. versionadded:: 1.6
log2$P$$H$PHc                    V P                  V4      w  r#V^ ,          VR,          VR,          repT ! T\        P                  ! VP                  R4      4      TT;'       g    RR7      # )    :   	   N:r   NNasciiN)identroundssaltchecksum)_parse_identr   decode_int6encode)clshashr   datar   r   chks   &&     9/usr/lib/python3/dist-packages/passlib/handlers/phpass.pyfrom_stringphpass.from_stringQ   s\    &&t, GT#YRc??6==#9:[[D	
 	
    c                    R P                  V P                  \        P                  ! V P                  4      P                  R4      V P                  V P                  ;'       g    R4      # )z{}{}{}{}r    )formatr   r   encode_int6r   decoder   r   )selfs   &r   	to_stringphpass.to_string\   sM      JJOODKK(//8IIMMR	
 	
r   c                   \        V\        4      '       d   VP                  R 4      p^V P                  ,          p\	        V P
                  P                  R4      V,           4      P                  4       p^ pWB8  d+   \	        W1,           4      P                  4       pV^,          pK0  \        P                  ! V4      P                  R4      # )zutf-8r   )

isinstancestrr   r   r   r   digestr   encode_bytesr#   )r$   secretreal_roundsresultrs   &&   r   _calc_checksumphpass._calc_checksumd   s    fc""]]7+F4;;&TYY%%g.78??Ao)002FFA'..w77r    N)r   r   r   )r   r   )__name__
__module____qualname____firstlineno____doc__namesetting_kwdsuhHASH64_CHARSchecksum_charsmin_salt_sizemax_salt_size
salt_charsdefault_rounds
min_rounds
max_roundsrounds_costdefault_identident_valuesident_aliasesclassmethodr   r%   r0   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     !H D.L__N %&%MMJ NJJK M!L%e,M 
 


8 
8r   )r7   hashlibr   passlib.utils.handlersutilshandlersr:   passlib.utils.binaryr   __all__HasManyIdents	HasRoundsHasSaltGenericHandlerr   r2   r   r   <module>rU      sL     # # $ 
[8Rr||RZZ9J9J [8r   