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 "net/base/hash_value.h" | 5 #include "net/base/hash_value.h" |
6 | 6 |
| 7 #include <stdlib.h> |
| 8 |
7 #include "base/base64.h" | 9 #include "base/base64.h" |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/sha1.h" | 11 #include "base/sha1.h" |
10 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
11 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
12 #include "crypto/sha2.h" | 14 #include "crypto/sha2.h" |
13 | 15 |
14 namespace net { | 16 namespace net { |
15 | 17 |
16 namespace { | 18 namespace { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 bool IsSHA256HashInSortedArray(const SHA256HashValue& hash, | 126 bool IsSHA256HashInSortedArray(const SHA256HashValue& hash, |
125 const uint8_t* array, | 127 const uint8_t* array, |
126 size_t array_byte_len) { | 128 size_t array_byte_len) { |
127 DCHECK_EQ(0u, array_byte_len % crypto::kSHA256Length); | 129 DCHECK_EQ(0u, array_byte_len % crypto::kSHA256Length); |
128 const size_t arraylen = array_byte_len / crypto::kSHA256Length; | 130 const size_t arraylen = array_byte_len / crypto::kSHA256Length; |
129 return NULL != bsearch(hash.data, array, arraylen, crypto::kSHA256Length, | 131 return NULL != bsearch(hash.data, array, arraylen, crypto::kSHA256Length, |
130 CompareSHA1Hashes); | 132 CompareSHA1Hashes); |
131 } | 133 } |
132 | 134 |
133 } // namespace net | 135 } // namespace net |
OLD | NEW |