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