diff options
author | Jakob Unterwurzacher | 2018-02-18 16:20:38 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-02-18 16:20:38 +0100 |
commit | 5ad9bda206e476fea866907e2f0545257f74e1f0 (patch) | |
tree | 4762e5c2ee93551ebc2c9c2b463fc8e4c48420b8 /internal | |
parent | 6c6947126d38f8988bcbf59db088c9cddc55b9ab (diff) |
cryptocore: make AEADTypeEnum values explicit
We now print the number in a debug message, so define
the numeric values explicitely instead of using iota.
This way you don't have to understand how iota works
to find out what the number means. Lack of understanding
of how iota works is also the reason why the numbers
start at 3 (to keep the current behavoir).
Diffstat (limited to 'internal')
-rw-r--r-- | internal/cryptocore/cryptocore.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go index 09bab53..bd30029 100644 --- a/internal/cryptocore/cryptocore.go +++ b/internal/cryptocore/cryptocore.go @@ -17,22 +17,23 @@ import ( "github.com/rfjakob/gocryptfs/internal/tlog" ) -// AEADTypeEnum indicates the type of AEAD backend in use. -type AEADTypeEnum int - const ( // 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 +// AEADTypeEnum indicates the type of AEAD backend in use. +type AEADTypeEnum int + +const ( // BackendOpenSSL specifies the OpenSSL backend. - BackendOpenSSL AEADTypeEnum = iota + BackendOpenSSL AEADTypeEnum = 3 // BackendGoGCM specifies the Go based GCM backend. - BackendGoGCM AEADTypeEnum = iota + BackendGoGCM AEADTypeEnum = 4 // BackendAESSIV specifies an AESSIV backend. - BackendAESSIV AEADTypeEnum = iota + BackendAESSIV AEADTypeEnum = 5 ) // CryptoCore is the low level crypto implementation. |