zg 0 , d Z dgZddlmZ ddlmZmZ ddlmZ ddl m Z mZ ddlm Z ddlmZ dd lmZmZmZmZmZmZmZ dd lmZ dZd Zd Z e Zd Z e Z G d de Z d Z! e!dd Z" G d de Z#d Z$dS )z Galois/Counter Mode (GCM). GcmMode ) unhexlify)bord_copy_bytes) is_buffer) long_to_bytes bytes_to_long)BLAKE2s)get_random_bytes)load_pycryptodome_raw_libVoidPointercreate_string_bufferget_raw_bufferSmartPointerc_size_tc_uint8_ptr) _cpu_featuresa` int ghash_%imp%(uint8_t y_out[16], const uint8_t block_data[], size_t len, const uint8_t y_in[16], const void *exp_key); int ghash_expand_%imp%(const uint8_t h[16], void **ghash_tables); int ghash_destroy_%imp%(void *ghash_tables); c ddl m} d} |d| } fd|D }n# t $ r d gdz }Y nw xY wt t || } |di |S )Nr ) namedtuple)ghashghash_expand ghash_destroy _GHash_Impc <