select the right null AEAD algorithm depending on the version

This commit is contained in:
Marten Seemann
2017-09-07 20:06:58 +03:00
parent 15e9e3658a
commit 23f3432b9d
4 changed files with 32 additions and 8 deletions

17
crypto/null_aead_test.go Normal file
View File

@@ -0,0 +1,17 @@
package crypto
import (
"github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("NullAEAD", func() {
It("selects the right FVN variant", func() {
Expect(NewNullAEAD(protocol.PerspectiveClient, protocol.Version39)).To(Equal(&nullAEADFNV128a{
perspective: protocol.PerspectiveClient,
version: protocol.Version39,
}))
Expect(NewNullAEAD(protocol.PerspectiveClient, protocol.VersionTLS)).To(Equal(&nullAEADFNV64a{}))
})
})