aboutsummaryrefslogtreecommitdiff
path: root/internal/siv_aead
diff options
context:
space:
mode:
Diffstat (limited to 'internal/siv_aead')
-rw-r--r--internal/siv_aead/siv_aead.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/siv_aead/siv_aead.go b/internal/siv_aead/siv_aead.go
index eabb5e2..482efd9 100644
--- a/internal/siv_aead/siv_aead.go
+++ b/internal/siv_aead/siv_aead.go
@@ -19,6 +19,11 @@ const (
// KeyLen is the required key length. The SIV algorithm supports other lengths,
// but we only support 64.
KeyLen = 64
+ // NonceSize is the required nonce/IV length.
+ // SIV supports any nonce size, but in gocryptfs we exclusively use 16.
+ NonceSize = 16
+ // Overhead is the number of bytes added for integrity checking
+ Overhead = 16
)
// New returns a new cipher.AEAD implementation.
@@ -42,11 +47,11 @@ func new2(keyIn []byte) cipher.AEAD {
func (s *sivAead) NonceSize() int {
// SIV supports any nonce size, but in gocryptfs we exclusively use 16.
- return 16
+ return NonceSize
}
func (s *sivAead) Overhead() int {
- return 16
+ return Overhead
}
// Seal encrypts "in" using "nonce" and "authData" and appends the result to "dst"