aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm/gcm.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-07 17:58:42 +0200
committerJakob Unterwurzacher2021-09-07 18:15:04 +0200
commitf47e287c202ba92e9b48e65bf95e0771c6c4997c (patch)
treed46cfc841c46b82977da1e83dd1be5080edbf8ae /internal/stupidgcm/gcm.go
parentd598536709db355366e90870c6df3508c71c5884 (diff)
stupidgcm: revamp package documentation
Maybe interesting for people following https://github.com/rfjakob/gocryptfs/issues/452
Diffstat (limited to 'internal/stupidgcm/gcm.go')
-rw-r--r--internal/stupidgcm/gcm.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/stupidgcm/gcm.go b/internal/stupidgcm/gcm.go
index 0cadd3c..a9377b1 100644
--- a/internal/stupidgcm/gcm.go
+++ b/internal/stupidgcm/gcm.go
@@ -1,7 +1,5 @@
// +build !without_openssl
-// Package stupidgcm is a thin wrapper for OpenSSL's GCM encryption and
-// decryption functions. It only support 32-byte keys and 16-bit IVs.
package stupidgcm
// #include <openssl/evp.h>
@@ -25,10 +23,9 @@ type stupidGCM struct {
stupidAEADCommon
}
-// Verify that we satisfy the interface
-var _ cipher.AEAD = &stupidGCM{}
-
-// New returns a new cipher.AEAD implementation..
+// New returns a new AES-GCM-256 cipher that satisfies the cipher.AEAD interface.
+//
+// Only 32-bytes keys and 16-byte IVs are supported.
func New(keyIn []byte, forceDecode bool) cipher.AEAD {
if len(keyIn) != keyLen {
log.Panicf("Only %d-byte keys are supported", keyLen)