summaryrefslogtreecommitdiff
path: root/internal/siv_aead
diff options
context:
space:
mode:
authorValient Gough2016-10-01 21:14:18 -0700
committerJakob Unterwurzacher2016-10-04 23:18:33 +0200
commitb764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch)
tree22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/siv_aead
parent31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff)
lint fixes
Diffstat (limited to 'internal/siv_aead')
-rw-r--r--internal/siv_aead/siv_aead.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/internal/siv_aead/siv_aead.go b/internal/siv_aead/siv_aead.go
index a0ed882..c68ecdb 100644
--- a/internal/siv_aead/siv_aead.go
+++ b/internal/siv_aead/siv_aead.go
@@ -3,6 +3,8 @@
package siv_aead
import (
+ "crypto/cipher"
+
"github.com/jacobsa/crypto/siv"
)
@@ -10,7 +12,10 @@ type sivAead struct {
key []byte
}
-func New(key []byte) *sivAead {
+var _ cipher.AEAD = &sivAead{}
+
+// New returns a new cipher.AEAD implementation.
+func New(key []byte) cipher.AEAD {
return &sivAead{
key: key,
}
@@ -25,7 +30,7 @@ func (s *sivAead) Overhead() int {
return 16
}
-// Seal - encrypt "in" using "nonce" and "authData" and append the result to "dst"
+// Seal encrypts "in" using "nonce" and "authData" and append the result to "dst"
func (s *sivAead) Seal(dst, nonce, plaintext, authData []byte) []byte {
if len(nonce) != 16 {
// SIV supports any nonce size, but in gocryptfs we exclusively use 16.
@@ -43,7 +48,7 @@ func (s *sivAead) Seal(dst, nonce, plaintext, authData []byte) []byte {
return out
}
-// Open - decrypt "in" using "nonce" and "authData" and append the result to "dst"
+// Open decrypts "in" using "nonce" and "authData" and append the result to "dst"
func (s *sivAead) Open(dst, nonce, ciphertext, authData []byte) ([]byte, error) {
if len(nonce) != 16 {
// SIV supports any nonce size, but in gocryptfs we exclusively use 16.