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   