o
    �)%aÉ  ã                   @   s‚   d dl Z d dlmZ d dlmZmZmZmZmZ d dl	m
Z
 dede jeef fdd„Zd	ed
edefdd„ZG dd„ deƒZdS )é    N)Úutils)Ú	DERReaderÚINTEGERÚSEQUENCEÚ
encode_derÚencode_der_integer)ÚhashesÚ	signatureÚreturnc                 C   sV   t | ƒ t¡�}| t¡ ¡ }| t¡ ¡ }||fW  d   ƒ S 1 s$w   Y  d S ©N)r   Úread_single_elementr   Úread_elementr   Ú
as_integer)r	   ÚseqÚrÚs© r   úQ/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/asymmetric/utils.pyÚdecode_dss_signature   s
   $ýr   r   r   c                 C   s    t tt tt| ƒƒt tt|ƒƒƒS r   )r   r   r   r   )r   r   r   r   r   Úencode_dss_signature   s
   ýr   c                   @   s&   e Zd Zdejfdd„Ze d¡ZdS )Ú	PrehashedÚ	algorithmc                 C   s&   t |tjƒs
tdƒ‚|| _|j| _d S )Nz#Expected instance of HashAlgorithm.)Ú
isinstancer   ÚHashAlgorithmÚ	TypeErrorÚ
_algorithmÚdigest_sizeÚ_digest_size)Úselfr   r   r   r   Ú__init__#   s   zPrehashed.__init__r   N)	Ú__name__Ú
__module__Ú__qualname__r   r   r   r   Úread_only_propertyr   r   r   r   r   r   "   s    r   )ÚtypingÚcryptographyr   Úcryptography.hazmat._derr   r   r   r   r   Úcryptography.hazmat.primitivesr   ÚbytesÚTupleÚintr   r   Úobjectr   r   r   r   r   Ú<module>   s   