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/stupidgcm/stupidgcm.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'internal/stupidgcm/stupidgcm.go') diff --git a/internal/stupidgcm/stupidgcm.go b/internal/stupidgcm/stupidgcm.go index db9e6ef..58027f8 100644 --- a/internal/stupidgcm/stupidgcm.go +++ b/internal/stupidgcm/stupidgcm.go @@ -9,6 +9,7 @@ package stupidgcm import "C" import ( + "crypto/cipher" "fmt" "log" "unsafe" @@ -28,7 +29,10 @@ type stupidGCM struct { key []byte } -func New(key []byte) stupidGCM { +var _ cipher.AEAD = &stupidGCM{} + +// New returns a new cipher.AEAD implementation.. +func New(key []byte) cipher.AEAD { if len(key) != keyLen { log.Panicf("Only %d-byte keys are supported", keyLen) } @@ -43,7 +47,7 @@ func (g stupidGCM) Overhead() int { return tagLen } -// Seal - encrypt "in" using "iv" and "authData" and append the result to "dst" +// Seal encrypts "in" using "iv" and "authData" and append the result to "dst" func (g stupidGCM) Seal(dst, iv, in, authData []byte) []byte { if len(iv) != ivLen { log.Panicf("Only %d-byte IVs are supported", ivLen) @@ -114,7 +118,7 @@ func (g stupidGCM) Seal(dst, iv, in, authData []byte) []byte { return append(dst, buf...) } -// Open - decrypt "in" using "iv" and "authData" and append the result to "dst" +// Open decrypts "in" using "iv" and "authData" and append the result to "dst" func (g stupidGCM) Open(dst, iv, in, authData []byte) ([]byte, error) { if len(iv) != ivLen { log.Panicf("Only %d-byte IVs are supported", ivLen) -- cgit v1.2.3