3 l_@sHddlmZmZmZddlmZddlmZmZm Z Gddde Z dS))absolute_importdivisionprint_function)utils)AlreadyFinalizedUnsupportedAlgorithm_Reasonsc@sDeZdZddZddZddZddZed d Zed d Z d S)Poly1305cCs0ddlm}|js tdtj|j||_dS)Nr)backendz5poly1305 is not supported by this version of OpenSSL.)Z,cryptography.hazmat.backends.openssl.backendr Zpoly1305_supportedrrZUNSUPPORTED_MACZcreate_poly1305_ctx_ctx)selfkeyr r /usr/lib64/python3.6/poly1305.py__init__s  zPoly1305.__init__cCs.|jdkrtdtjd||jj|dS)NzContext was already finalized.data)r rrZ_check_byteslikeupdate)r rrrrrs  zPoly1305.updatecCs&|jdkrtd|jj}d|_|S)NzContext was already finalized.)r rfinalize)r Zmacrrrr!s   zPoly1305.finalizecCs:tjd||jdkrtd|jd}|_|j|dS)NtagzContext was already finalized.)r _check_bytesr rverify)r rZctxrrrr(s   zPoly1305.verifycCst|}|j||jS)N)r rr)clsr rprrr generate_tag0s zPoly1305.generate_tagcCs t|}|j||j|dS)N)r rr)rr rrrrrr verify_tag6s zPoly1305.verify_tagN) __name__ __module__ __qualname__rrrr classmethodrrrrrrr s   r N) Z __future__rrrZ cryptographyrZcryptography.exceptionsrrrobjectr rrrrs