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 "crypto/secure_hash.h" | 5 #include "crypto/secure_hash.h" |
6 | 6 |
7 #include <openssl/mem.h> | |
8 #include <openssl/sha.h> | |
9 #include <stddef.h> | 7 #include <stddef.h> |
10 | 8 |
11 #include "base/logging.h" | 9 #include "base/logging.h" |
12 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
13 #include "base/pickle.h" | 11 #include "base/pickle.h" |
14 #include "crypto/openssl_util.h" | 12 #include "crypto/openssl_util.h" |
| 13 #include "third_party/boringssl/src/include/openssl/mem.h" |
| 14 #include "third_party/boringssl/src/include/openssl/sha.h" |
15 | 15 |
16 namespace crypto { | 16 namespace crypto { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class SecureHashSHA256 : public SecureHash { | 20 class SecureHashSHA256 : public SecureHash { |
21 public: | 21 public: |
22 SecureHashSHA256() { | 22 SecureHashSHA256() { |
23 SHA256_Init(&ctx_); | 23 SHA256_Init(&ctx_); |
24 } | 24 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 switch (algorithm) { | 57 switch (algorithm) { |
58 case SHA256: | 58 case SHA256: |
59 return base::MakeUnique<SecureHashSHA256>(); | 59 return base::MakeUnique<SecureHashSHA256>(); |
60 default: | 60 default: |
61 NOTIMPLEMENTED(); | 61 NOTIMPLEMENTED(); |
62 return nullptr; | 62 return nullptr; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 } // namespace crypto | 66 } // namespace crypto |
OLD | NEW |