2022-08-28 11:11:36 +02:00
|
|
|
//go:build !without_openssl
|
2021-09-02 09:30:28 +02:00
|
|
|
// +build !without_openssl
|
|
|
|
|
|
|
|
package stupidgcm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"golang.org/x/crypto/chacha20poly1305"
|
|
|
|
)
|
|
|
|
|
2021-09-02 10:04:38 +02:00
|
|
|
func TestStupidChacha20poly1305(t *testing.T) {
|
2021-09-02 09:30:28 +02:00
|
|
|
key := randBytes(32)
|
2021-09-04 19:18:42 +02:00
|
|
|
c := NewChacha20poly1305(key)
|
2021-09-02 09:57:06 +02:00
|
|
|
ref, err := chacha20poly1305.New(key)
|
2021-09-02 09:30:28 +02:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2021-09-02 10:04:38 +02:00
|
|
|
testCiphers(t, c, ref)
|
2021-09-02 09:30:28 +02:00
|
|
|
}
|