| 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 part of dart.crypto; |
| 6 |
| 5 class _HMAC implements HMAC { | 7 class _HMAC implements HMAC { |
| 6 _HMAC(Hash this._hash, List<int> this._key) : _message = []; | 8 _HMAC(Hash this._hash, List<int> this._key) : _message = []; |
| 7 | 9 |
| 8 HMAC update(List<int> data) { | 10 HMAC update(List<int> data) { |
| 9 _message.addAll(data); | 11 _message.addAll(data); |
| 10 return this; | 12 return this; |
| 11 } | 13 } |
| 12 | 14 |
| 13 List<int> digest() { | 15 List<int> digest() { |
| 14 var blockSize = _hash.blockSize; | 16 var blockSize = _hash.blockSize; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 result |= digest[i] ^ computedDigest[i]; | 63 result |= digest[i] ^ computedDigest[i]; |
| 62 } | 64 } |
| 63 return result == 0; | 65 return result == 0; |
| 64 } | 66 } |
| 65 | 67 |
| 66 // HMAC internal state. | 68 // HMAC internal state. |
| 67 Hash _hash; | 69 Hash _hash; |
| 68 List<int> _key; | 70 List<int> _key; |
| 69 List<int> _message; | 71 List<int> _message; |
| 70 } | 72 } |
| OLD | NEW |