1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 func TestEncryptDecrypt(t *testing.T) {
15 // TODO(dgryski): add the rest of the test vectors from the RFC
16 var tests = []struct {
53 "88bca90e90875a7f0f79c384627bafb2",
59 "88bca90e90875a7f0f79c384627bafb2",
65 "88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e",
72 for _, tt := range tests {
73 k, _ := hex.DecodeString(tt.key)
74 p, _ := hex.DecodeString(tt.plain)
75 c, _ := hex.DecodeString(tt.cipher)
83 if !bytes.Equal(dst[:], c) {
84 t.Errorf("encrypt failed: got % 2x wanted % 2x\n", dst, c)
89 if !bytes.Equal(dst[:], p) {
90 t.Errorf("decrypt failed: got % 2x wanted % 2x\n", dst, p)