diff options
| author | Valient Gough | 2016-10-01 21:14:18 -0700 | 
|---|---|---|
| committer | Jakob Unterwurzacher | 2016-10-04 23:18:33 +0200 | 
| commit | b764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch) | |
| tree | 22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/stupidgcm | |
| parent | 31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff) | |
lint fixes
Diffstat (limited to 'internal/stupidgcm')
| -rw-r--r-- | internal/stupidgcm/stupidgcm.go | 10 | 
1 files changed, 7 insertions, 3 deletions
| 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) | 
