crypto: remove AES-GCM

This commit is contained in:
Marian Beermann 2017-07-29 12:22:11 +02:00
parent 7d02c7e453
commit d5ee16d676
2 changed files with 3 additions and 22 deletions

View File

@ -67,7 +67,6 @@ cdef extern from "openssl/evp.h":
pass pass
const EVP_CIPHER *EVP_aes_256_ctr() const EVP_CIPHER *EVP_aes_256_ctr()
const EVP_CIPHER *EVP_aes_256_gcm()
const EVP_CIPHER *EVP_aes_256_ocb() const EVP_CIPHER *EVP_aes_256_ocb()
const EVP_CIPHER *EVP_chacha20_poly1305() const EVP_CIPHER *EVP_chacha20_poly1305()
@ -668,18 +667,6 @@ cdef class _CHACHA_BASE(_AEAD_BASE):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
cdef class AES256_GCM(_AES_BASE):
@staticmethod
def requirements_check():
if OPENSSL_VERSION_NUMBER < 0x10001040:
raise ValueError('AES GCM requires OpenSSL >= 1.0.1d. Detected: OpenSSL %08x' % OPENSSL_VERSION_NUMBER)
def __init__(self, mac_key, enc_key, iv=None, header_len=1, aad_offset=1):
self.requirements_check()
self.cipher = EVP_aes_256_gcm
super().__init__(mac_key, enc_key, iv=iv, header_len=header_len, aad_offset=aad_offset)
cdef class AES256_OCB(_AES_BASE): cdef class AES256_OCB(_AES_BASE):
@staticmethod @staticmethod
def requirements_check(): def requirements_check():

View File

@ -1,6 +1,6 @@
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from ..crypto.low_level import AES256_CTR_HMAC_SHA256, AES256_GCM, AES256_OCB, CHACHA20_POLY1305, UNENCRYPTED, \ from ..crypto.low_level import AES256_CTR_HMAC_SHA256, AES256_OCB, CHACHA20_POLY1305, UNENCRYPTED, \
IntegrityError, blake2b_256, hmac_sha256, openssl10 IntegrityError, blake2b_256, hmac_sha256, openssl10
from ..crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes from ..crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes
from ..crypto.low_level import hkdf_hmac_sha512 from ..crypto.low_level import hkdf_hmac_sha512
@ -97,10 +97,7 @@ class CryptoTestCase(BaseTestCase):
data = b'foo' * 10 data = b'foo' * 10
header = b'\x23' header = b'\x23'
tests = [ tests = [
# ciphersuite class, exp_mac, exp_cdata # (ciphersuite class, exp_mac, exp_cdata)
(AES256_GCM,
b'66a438843aa41a087d6a7ed1dc1f3c4c',
b'5bbb40be14e4bcbfc75715b77b1242d590d2bf9f7f8a8a910b4469888689', )
] ]
if not openssl10: if not openssl10:
tests += [ tests += [
@ -144,10 +141,7 @@ class CryptoTestCase(BaseTestCase):
data = b'foo' * 10 data = b'foo' * 10
header = b'\x12\x34\x56' header = b'\x12\x34\x56'
tests = [ tests = [
# ciphersuite class, exp_mac, exp_cdata # (ciphersuite class, exp_mac, exp_cdata)
(AES256_GCM,
b'4fb0e5b0a0bca57527352cc6240e7cca',
b'5bbb40be14e4bcbfc75715b77b1242d590d2bf9f7f8a8a910b4469888689', )
] ]
if not openssl10: if not openssl10:
tests += [ tests += [