From a00402cc47d245355c6556a17a1cacaf5102a31c Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 4 Oct 2016 00:15:27 +0200 Subject: cryptocore: rename "gcm" variable to generic "aeadCipher" As we now also support AES-SIV the old name is no longer correct. --- internal/cryptocore/cryptocore.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal') diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go index a65ad39..05c0704 100644 --- a/internal/cryptocore/cryptocore.go +++ b/internal/cryptocore/cryptocore.go @@ -55,21 +55,21 @@ func New(key []byte, backend BackendTypeEnum, IVBitLen int) *CryptoCore { panic(err) } - var gcm cipher.AEAD + var aeadCipher cipher.AEAD switch backend { case BackendOpenSSL: if IVLen != 16 { panic("stupidgcm only supports 128-bit IVs") } - gcm = stupidgcm.New(key) + aeadCipher = stupidgcm.New(key) case BackendGoGCM: - gcm, err = goGCMWrapper(blockCipher, IVLen) + aeadCipher, err = goGCMWrapper(blockCipher, IVLen) case BackendAESSIV: // AES-SIV uses 1/2 of the key for authentication, 1/2 for // encryption, so we need a 64-bytes key for AES-256. Derive it from // the master key by hashing it with SHA-512. key64 := sha512.Sum512(key) - gcm = siv_aead.New(key64[:]) + aeadCipher = siv_aead.New(key64[:]) default: panic("unknown backend cipher") } @@ -79,7 +79,7 @@ func New(key []byte, backend BackendTypeEnum, IVBitLen int) *CryptoCore { return &CryptoCore{ BlockCipher: blockCipher, - AEADCipher: gcm, + AEADCipher: aeadCipher, AEADBackend: backend, IVGenerator: &nonceGenerator{nonceLen: IVLen}, IVLen: IVLen, -- cgit v1.2.3