go_chacha20poly1305_openssh/consts_test.go

21 lines
447 B
Go
Raw Normal View History

package cc20p1305ssh
import (
`testing`
`golang.org/x/crypto/chacha20`
)
func TestFixedNonceSize(t *testing.T) {
if NonceSize != chacha20.NonceSize {
t.Error(
"Mismatched ChaCha20 nonce sizes;\n" +
"\tgolang.org/x/crypto/chacha20 only supports 12 or 24 bytes nonce size,\n\t" +
"the chacha20poly1305@openssh.com variant only supports a nonce of 16 bytes.",
)
t.Fail()
}
t.Log("The nonce size modification is correct.")
}