aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm
diff options
context:
space:
mode:
Diffstat (limited to 'internal/stupidgcm')
-rw-r--r--internal/stupidgcm/chacha.go2
-rw-r--r--internal/stupidgcm/chacha_test.go2
-rw-r--r--internal/stupidgcm/xchacha.go4
3 files changed, 4 insertions, 4 deletions
diff --git a/internal/stupidgcm/chacha.go b/internal/stupidgcm/chacha.go
index 37f7e1f..2e6e6e6 100644
--- a/internal/stupidgcm/chacha.go
+++ b/internal/stupidgcm/chacha.go
@@ -21,7 +21,7 @@ type stupidChacha20poly1305 struct {
// Verify that we satisfy the cipher.AEAD interface
var _ cipher.AEAD = &stupidChacha20poly1305{}
-func newChacha20poly1305(key []byte) *stupidChacha20poly1305 {
+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))
}
diff --git a/internal/stupidgcm/chacha_test.go b/internal/stupidgcm/chacha_test.go
index 513b68f..5f803aa 100644
--- a/internal/stupidgcm/chacha_test.go
+++ b/internal/stupidgcm/chacha_test.go
@@ -10,7 +10,7 @@ import (
func TestStupidChacha20poly1305(t *testing.T) {
key := randBytes(32)
- c := newChacha20poly1305(key)
+ c := NewChacha20poly1305(key)
ref, err := chacha20poly1305.New(key)
if err != nil {
t.Fatal(err)
diff --git a/internal/stupidgcm/xchacha.go b/internal/stupidgcm/xchacha.go
index 3bf3b5b..055b7f7 100644
--- a/internal/stupidgcm/xchacha.go
+++ b/internal/stupidgcm/xchacha.go
@@ -67,7 +67,7 @@ func (x *stupidXchacha20poly1305) Seal(dst, nonce, plaintext, additionalData []b
}
hKey, _ := chacha20.HChaCha20(x.key[:], nonce[0:16])
- c := newChacha20poly1305(hKey)
+ c := NewChacha20poly1305(hKey)
defer c.Wipe()
// The first 4 bytes of the final nonce are unused counter space.
@@ -92,7 +92,7 @@ func (x *stupidXchacha20poly1305) Open(dst, nonce, ciphertext, additionalData []
}
hKey, _ := chacha20.HChaCha20(x.key[:], nonce[0:16])
- c := newChacha20poly1305(hKey)
+ c := NewChacha20poly1305(hKey)
defer c.Wipe()
// The first 4 bytes of the final nonce are unused counter space.