OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "rlz/lib/crc8.h" | 5 #include "rlz/lib/crc8.h" |
6 | 6 |
7 namespace { | 7 namespace { |
8 | 8 |
9 // The CRC lookup table used for ATM HES (Polynomial = 0x07). | 9 // The CRC lookup table used for ATM HES (Polynomial = 0x07). |
10 // These are 256 unique 8-bit values. | 10 // These are 256 unique 8-bit values. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 unsigned char calculated_crc; | 81 unsigned char calculated_crc; |
82 if (!Generate(data, length, &calculated_crc)) | 82 if (!Generate(data, length, &calculated_crc)) |
83 return false; | 83 return false; |
84 | 84 |
85 *matches = check_sum == calculated_crc; | 85 *matches = check_sum == calculated_crc; |
86 | 86 |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 } // namespace rlz_lib | 90 } // namespace rlz_lib |
OLD | NEW |