+
    üÐjÜ  ã                   óL   € R t ^ RIHt ^ RIHtHt R]R]R]/tR
R ltR tR	 t	R# )z^
Calculations for HTTP Digest authentication.

@see: U{http://www.faqs.org/rfcs/rfc2617.html}
)Úhexlify)Úmd5Úsha1s   md5ó   md5-sesss   shaNc                óx  € V'       d$   V'       g   V'       g	   V'       d   \        R4      hVf‚   \        V ,          ! 4       pVP                  V4       VP                  R4       VP                  V4       VP                  R4       VP                  V4       \        VP	                  4       4      pMTpV R8X  d�   \        V ,          ! 4       pVP                  V4       VP                  R4       VP                  V4       VP                  R4       VP                  V4       \        VP	                  4       4      pV# )a
  
Compute H(A1) from RFC 2617.

@param pszAlg: The name of the algorithm to use to calculate the digest.
    Currently supported are md5, md5-sess, and sha.
@param pszUserName: The username
@param pszRealm: The realm
@param pszPassword: The password
@param pszNonce: The nonce
@param pszCNonce: The cnonce

@param preHA1: If available this is a str containing a previously
   calculated H(A1) as a hex string.  If this is given then the values for
   pszUserName, pszRealm, and pszPassword must be L{None} and are ignored.
zPpreHA1 is incompatible with the pszUserName, pszRealm, and pszPassword argumentsó   :r   )Ú	TypeErrorÚ
algorithmsÚupdater   Údigest)	ÚpszAlgÚpszUserNameÚpszRealmÚpszPasswordÚpszNonceÚ	pszCNonceÚpreHA1ÚmÚHA1s	   &&&&&&&  Ú6/usr/lib/python3/dist-packages/twisted/cred/_digest.pyÚcalcHA1r   !   sç   € ÷& —;§(¯kÜð2ó
ð 	
ð
 ‚~ä�vÖÓ ˆØ	�‰�ÔØ	�‰�ŒØ	�‰�ÔØ	�‰�ŒØ	�‰�ÔÜ�a—h‘h“jÓ!‰ð ˆà�ÔÜ�vÖÓ ˆØ	�‰�ŒØ	�‰�ŒØ	�‰�ÔØ	�‰�ŒØ	�‰�ÔÜ�a—h‘h“jÓ!ˆà€Jó    c                ó  € \         V ,          ! 4       pVP                  V4       VP                  R4       VP                  V4       VR8X  d#   VP                  R4       VP                  V4       \        VP                  4       4      # )aÉ  
Compute H(A2) from RFC 2617.

@param algo: The name of the algorithm to use to calculate the digest.
    Currently supported are md5, md5-sess, and sha.
@param pszMethod: The request method.
@param pszDigestUri: The request URI.
@param pszQop: The Quality-of-Protection value.
@param pszHEntity: The hash of the entity body or L{None} if C{pszQop} is
    not C{'auth-int'}.
@return: The hash of the A2 value for the calculation of the response
    digest.
r   s   auth-int©r	   r
   r   r   )ÚalgoÚ	pszMethodÚpszDigestUriÚpszQopÚ
pszHEntityr   s   &&&&& r   ÚcalcHA2r   S   sd   € ô 	�4ÖÓ€AØ‡H�HˆYÔØ‡H�HˆT„NØ‡H�Hˆ\ÔØ�ÔØ	�‰�ŒØ	�‰�ÔÜ�1—8‘8“:ÓÐr   c                óò  € \         V,          ! 4       pVP                  V 4       VP                  R4       VP                  V4       VP                  R4       V'       do   V'       dg   VP                  V4       VP                  R4       VP                  V4       VP                  R4       VP                  V4       VP                  R4       VP                  V4       \        VP                  4       4      pV# )aa  
Compute the digest for the given parameters.

@param HA1: The H(A1) value, as computed by L{calcHA1}.
@param HA2: The H(A2) value, as computed by L{calcHA2}.
@param pszNonce: The challenge nonce.
@param pszNonceCount: The (client) nonce count value for this response.
@param pszCNonce: The client nonce.
@param pszQop: The Quality-of-Protection value.
r   r   )	r   ÚHA2r   r   ÚpszNonceCountr   r   r   ÚrespHashs	   &&&&&&&  r   ÚcalcResponser$   k   s¨   € ô 	�4ÖÓ€AØ‡H�HˆS„MØ‡H�HˆT„NØ‡H�HˆXÔØ‡H�HˆT„NßŸØ	�‰�ÔØ	�‰�ŒØ	�‰�ÔØ	�‰�ŒØ	�‰�ÔØ	�‰�ŒØ‡H�HˆS„MÜ�q—x‘x“zÓ"€HØ€Or   )N)
Ú__doc__Úbinasciir   Úhashlibr   r   r	   r   r   r$   © r   r   Ú<module>r)      s<   ðñ
õ ß ð
 ˆCð �Ø
ˆDð€
ô /òdô0r   