summaryrefslogtreecommitdiff
path: root/internal/stupidgcm/chacha.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/chacha.go
parentd598536709db355366e90870c6df3508c71c5884 (diff)
stupidgcm: revamp package documentation
Maybe interesting for people following https://github.com/rfjakob/gocryptfs/issues/452
Diffstat (limited to 'internal/stupidgcm/chacha.go')
-rw-r--r--internal/stupidgcm/chacha.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/stupidgcm/chacha.go b/internal/stupidgcm/chacha.go
index 30d57e3..1117d97 100644
--- a/internal/stupidgcm/chacha.go
+++ b/internal/stupidgcm/chacha.go
@@ -35,6 +35,8 @@ func init() {
// gocryptfs only uses ChaCha20-Poly1305 as a building block for OpenSSL
// XChaCha20-Poly1305. This function is hot because it gets called once for each
// block by XChaCha20-Poly1305.
+//
+// Only 32-bytes keys and 12-byte IVs are supported.
func NewChacha20poly1305(key []byte) *stupidChacha20poly1305 {
if len(key) != chacha20poly1305.KeySize {
log.Panicf("Only %d-byte keys are supported, you passed %d bytes", chacha20poly1305.KeySize, len(key))