Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Library tag to allow the test to run on Dartium. | 5 // Library tag to allow the test to run on Dartium. |
| 6 import "package:crypto/crypto.dart"; | 6 import "package:crypto/crypto.dart"; |
| 7 import "package:test/test.dart"; | 7 import "package:test/test.dart"; |
| 8 | 8 |
| 9 import 'utils.dart'; | 9 import 'utils.dart'; |
| 10 | 10 |
| 11 void main() { | 11 void main() { |
| 12 group("standard vector", () { | 12 group("standard vector", () { |
| 13 for (var i = 0; i < _inputs.length; i++) { | 13 for (var i = 0; i < _inputs.length; i++) { |
| 14 test(_macs[i], () { | 14 test(_macs[i], () { |
| 15 expectHmacEquals(new SHA1(), _inputs[i], _keys[i], _macs[i]); | 15 expectHmacEquals(sha1, _inputs[i], _keys[i], _macs[i]); |
| 16 }); | 16 }); |
| 17 } | 17 } |
| 18 }); | 18 }); |
| 19 } | 19 } |
| 20 | 20 |
| 21 // Standard test vectors from: | 21 // Standard test vectors from: |
| 22 // http://csrc.nist.gov/groups/STM/cavp/documents/mac/hmactestvectors.zip | 22 // http://csrc.nist.gov/groups/STM/cavp/documents/mac/hmactestvectors.zip |
| 23 | 23 |
| 24 const _inputs = const [ | 24 const _inputs = const [ |
| 25 const [ 0xfc, 0xd6, 0xd9, 0x8b, 0xef, 0x45, 0xed, 0x68, 0x50, 0x80, 0x6e, 0x96 , 0xf2, 0x55, 0xfa, 0x0c, 0x81, 0x14, 0xb7, 0x28, 0x73, 0xab, 0xe8, 0xf4, 0x3c, 0x10, 0xbe, 0xa7, 0xc1, 0xdf, 0x70, 0x6f, 0x10, 0x45, 0x8e, 0x6d, 0x4e, 0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 0x73, 0xb5, 0x5d , 0xc9, 0x4d, 0x99, 0xa1, 0x71, 0x37, 0x79, 0x69, 0x23, 0x41, 0x34, 0xe7, 0xda, 0xd1, 0xab, 0x4c, 0x8e, 0x46, 0xd1, 0x8d, 0xf4, 0xdc, 0x01, 0x67, 0x64, 0xcf, 0x 95, 0xa1, 0x1a, 0xc4, 0xb4, 0x91, 0xa2, 0x64, 0x6b, 0xe1 ], |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 922 'd78807f2a69d8e348cbd2c2d745f342397e20a41', | 922 'd78807f2a69d8e348cbd2c2d745f342397e20a41', |
| 923 '9602a3a1fd2dc3c55df5815ac0517001f8c6593b', | 923 '9602a3a1fd2dc3c55df5815ac0517001f8c6593b', |
| 924 'b95df20e4e63936b74af4ceb7ad94d4e4b56ea8d', | 924 'b95df20e4e63936b74af4ceb7ad94d4e4b56ea8d', |
| 925 '5f009c918e2f8d7c9f9087b78af44f54518e1c5a', | 925 '5f009c918e2f8d7c9f9087b78af44f54518e1c5a', |
| 926 'f92f9c4b8d423b14ac7ad924f183a1cc27de6afd', | 926 'f92f9c4b8d423b14ac7ad924f183a1cc27de6afd', |
| 927 'f476bd42bae22e645cedf601511b1ab8f2852b2c', | 927 'f476bd42bae22e645cedf601511b1ab8f2852b2c', |
| 928 '48d48ceb4c1f3e6b1e9c0fb8515f1121b846c19b', | 928 '48d48ceb4c1f3e6b1e9c0fb8515f1121b846c19b', |
| 929 '9e51be58cf2d5c8e85556b8f3d484109fb49553a', | 929 '9e51be58cf2d5c8e85556b8f3d484109fb49553a', |
| 930 '4ac41ab89f625c60125ed65ffa958c6b490ea670' | 930 '4ac41ab89f625c60125ed65ffa958c6b490ea670' |
| 931 ]; | 931 ]; |
| OLD | NEW |