Beispiel #1
0
 def __init__(self, hash_subkey, block_size, table_size='64K'):
     _SmoothMAC.__init__(self, block_size, None, 0)
     if table_size == '64K':
         self._hash_subkey = galois._ghash_expand(hash_subkey)
     else:
         self._hash_subkey = hash_subkey
     self._last_y = bchr(0) * 16
     self._mac = galois._ghash
Beispiel #2
0
 def __init__(self, hash_subkey, block_size, table_size='64K'):
     _SmoothMAC.__init__(self, block_size, None, 0)
     if table_size == '64K':
         self._hash_subkey = galois._ghash_expand(hash_subkey)
     else:
         self._hash_subkey = hash_subkey
     self._last_y = bchr(0) * 16
     self._mac = galois._ghash
Beispiel #3
0
    def __init__(self, hash_subkey, block_size):
        _SmoothMAC.__init__(self, block_size, None, 0)

        self._key = hash_subkey
        self._exp_key = VoidPointer()
        expect_byte_string(self._key)
        result = _raw_galois_lib.ghash_expand(self._key,
                                              self._exp_key.address_of())
        if result:
            raise ValueError("Error %d while expanding the GMAC key" % result)
        self._exp_key = SmartPointer(self._exp_key.get(),
                                     _raw_galois_lib.ghash_destroy)

        self._last_y = create_string_buffer(16)
        for i in xrange(16):
            self._last_y[i] = bchr(0)
        self._mac = _raw_galois_lib.ghash
Beispiel #4
0
    def __init__(self, hash_subkey, block_size):
        _SmoothMAC.__init__(self, block_size, None, 0)

        self._key = hash_subkey
        self._exp_key = VoidPointer()
        expect_byte_string(self._key)
        result = _raw_galois_lib.ghash_expand(self._key,
                                              self._exp_key.address_of())
        if result:
            raise ValueError("Error %d while expanding the GMAC key" % result)
        self._exp_key = SmartPointer(self._exp_key.get(),
                                     _raw_galois_lib.ghash_destroy)

        self._last_y = create_string_buffer(16)
        for i in xrange(16):
            self._last_y[i] = bchr(0)
        self._mac = _raw_galois_lib.ghash
 def __init__(self, hash_subkey, block_size):
     _SmoothMAC.__init__(self, block_size, None, 0)
     self._hash_subkey = _galois.ghash_expand(hash_subkey)
     self._last_y = bchr(0) * 16
     self._mac = _galois.ghash
 def __init__(self, key, ciphermod):
     _SmoothMAC.__init__(self, ciphermod.block_size, None, 0)
     self._key = key
     self._factory = ciphermod
Beispiel #7
0
 def __init__(self, key, ciphermod):
     _SmoothMAC.__init__(self, ciphermod.block_size, None, 0)
     self._key = key
     self._factory = ciphermod
 def __init__(self, key, cipher_factory, cipher_params):
     _SmoothMAC.__init__(self, cipher_factory.block_size, None, 0)
     self._key = key
     self._factory = cipher_factory
     self._cipher_params = dict(cipher_params)
Beispiel #9
0
 def __init__(self, hash_subkey, block_size):
     _SmoothMAC.__init__(self, block_size, None, 0)
     self._hash_subkey = _galois.ghash_expand(hash_subkey)
     self._last_y = bchr(0) * 16
     self._mac = _galois.ghash
     return
Beispiel #10
0
 def __init__(self, key, cipher_factory, cipher_params):
     _SmoothMAC.__init__(self, cipher_factory.block_size, None, 0)
     self._key = key
     self._factory = cipher_factory
     self._cipher_params = dict(cipher_params)