summaryrefslogtreecommitdiff
path: root/internal/cryptocore/cryptocore.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-04 00:15:27 +0200
committerJakob Unterwurzacher2016-10-04 00:17:09 +0200
commita00402cc47d245355c6556a17a1cacaf5102a31c (patch)
tree2f4854b0b331ad929091bfb01503ab971f21b297 /internal/cryptocore/cryptocore.go
parentbb52937834e8adb8e746a1951aba633e02dc87f2 (diff)
cryptocore: rename "gcm" variable to generic "aeadCipher"
As we now also support AES-SIV the old name is no longer correct.
Diffstat (limited to 'internal/cryptocore/cryptocore.go')
-rw-r--r--internal/cryptocore/cryptocore.go10
1 files changed, 5 insertions, 5 deletions
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,