LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2013 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // ECB AES test vectors. | 5 // ECB AES test vectors. |
6 | 6 |
7 // See U.S. National Institute of Standards and Technology (NIST) | 7 // See U.S. National Institute of Standards and Technology (NIST) |
8 // Special Publication 800-38A, ``Recommendation for Block Cipher | 8 // Special Publication 800-38A, ``Recommendation for Block Cipher |
9 // Modes of Operation,'' 2001 Edition, pp. 24-29. | 9 // Modes of Operation,'' 2001 Edition, pp. 24-29. |
10 | 10 |
11 package cipher_test | 11 package cipher_test |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 decrypter := cipher.NewECBDecrypter(c) | 79 decrypter := cipher.NewECBDecrypter(c) |
80 p := make([]byte, len(d)) | 80 p := make([]byte, len(d)) |
81 decrypter.CryptBlocks(p, d) | 81 decrypter.CryptBlocks(p, d) |
82 if !bytes.Equal(tt.in, p) { | 82 if !bytes.Equal(tt.in, p) { |
83 t.Errorf("%s: ECBDecrypter\nhave %x\nwant %x", test, d,
tt.in) | 83 t.Errorf("%s: ECBDecrypter\nhave %x\nwant %x", test, d,
tt.in) |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
LEFT | RIGHT |