From b764917cd5c1b1d61b8ce08e7af0b29793fbbb80 Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Sat, 1 Oct 2016 21:14:18 -0700 Subject: lint fixes --- internal/cryptocore/cryptocore.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'internal/cryptocore/cryptocore.go') diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go index 05c0704..7cb5c95 100644 --- a/internal/cryptocore/cryptocore.go +++ b/internal/cryptocore/cryptocore.go @@ -12,18 +12,25 @@ import ( "github.com/rfjakob/gocryptfs/internal/stupidgcm" ) +// BackendTypeEnum indicates the type of backend in use. type BackendTypeEnum int const ( - KeyLen = 32 // AES-256 + // KeyLen is the cipher key length in bytes. 32 for AES-256. + KeyLen = 32 + // AuthTagLen is the length of a GCM auth tag in bytes. AuthTagLen = 16 - _ = iota // Skip zero + _ = iota // Skip zero + // BackendOpenSSL specifies the OpenSSL backend. BackendOpenSSL BackendTypeEnum = iota - BackendGoGCM BackendTypeEnum = iota - BackendAESSIV BackendTypeEnum = iota + // BackendGoGCM specifies the Go based GCM backend. + BackendGoGCM BackendTypeEnum = iota + // BackendAESSIV specifies an AESSIV backend. + BackendAESSIV BackendTypeEnum = iota ) +// CryptoCore is the low level crypto implementation. type CryptoCore struct { // AES-256 block cipher. This is used for EME filename encryption. BlockCipher cipher.Block @@ -36,7 +43,7 @@ type CryptoCore struct { IVLen int } -// "New" returns a new CryptoCore object or panics. +// New returns a new CryptoCore object or panics. // // Even though the "GCMIV128" feature flag is now mandatory, we must still // support 96-bit IVs here because they are used for encrypting the master -- cgit v1.2.3