aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm/xchacha_test.go
blob: bd62c04cb0d11ca98f8955fe4c7ec613c1c7c277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//go:build !without_openssl && cgo
// +build !without_openssl,cgo

package stupidgcm

import (
	"testing"

	"golang.org/x/crypto/chacha20poly1305"
)

func TestStupidXchacha20poly1305(t *testing.T) {
	key := randBytes(32)
	c := NewXchacha20poly1305(key)
	ref, err := chacha20poly1305.NewX(key)
	if err != nil {
		t.Fatal(err)
	}

	testCiphers(t, c, ref)
}