OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // TODO(jww) The original Blink-style header guard for this file conflicts with | 5 // TODO(jww) The original Blink-style header guard for this file conflicts with |
6 // the header guard in Source/modules/crypto/Crypto.h, so this is a | 6 // the header guard in Source/modules/crypto/Crypto.h, so this is a |
7 // Chromium-style header guard instead. There is now a bug | 7 // Chromium-style header guard instead. There is now a bug |
8 // (https://crbug.com/360121) to track a proposal to change all header guards | 8 // (https://crbug.com/360121) to track a proposal to change all header guards |
9 // to a similar style. Thus, whenever that is resolved, this header guard | 9 // to a similar style. Thus, whenever that is resolved, this header guard |
10 // should be changed to whatever style is agreed upon. | 10 // should be changed to whatever style is agreed upon. |
11 #ifndef SOURCE_PLATFORM_CRYPTO_H_ | 11 #ifndef SOURCE_PLATFORM_CRYPTO_H_ |
12 #define SOURCE_PLATFORM_CRYPTO_H_ | 12 #define SOURCE_PLATFORM_CRYPTO_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include "platform/PlatformExport.h" | 15 #include "platform/PlatformExport.h" |
15 #include "public/platform/WebCrypto.h" | 16 #include "public/platform/WebCrypto.h" |
16 #include "wtf/Allocator.h" | 17 #include "wtf/Allocator.h" |
17 #include "wtf/HashSet.h" | 18 #include "wtf/HashSet.h" |
18 #include "wtf/StringHasher.h" | 19 #include "wtf/StringHasher.h" |
19 #include "wtf/Vector.h" | 20 #include "wtf/Vector.h" |
20 #include <memory> | |
21 | 21 |
22 namespace blink { | 22 namespace blink { |
23 | 23 |
24 static const size_t kMaxDigestSize = 64; | 24 static const size_t kMaxDigestSize = 64; |
25 typedef Vector<uint8_t, kMaxDigestSize> DigestValue; | 25 typedef Vector<uint8_t, kMaxDigestSize> DigestValue; |
26 | 26 |
27 const size_t sha1HashSize = 20; | 27 const size_t sha1HashSize = 20; |
28 enum HashAlgorithm { | 28 enum HashAlgorithm { |
29 HashAlgorithmSha1, | 29 HashAlgorithmSha1, |
30 HashAlgorithmSha256, | 30 HashAlgorithmSha256, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 typedef IntHash<blink::HashAlgorithm> Hash; | 68 typedef IntHash<blink::HashAlgorithm> Hash; |
69 }; | 69 }; |
70 template <> | 70 template <> |
71 struct HashTraits<blink::HashAlgorithm> | 71 struct HashTraits<blink::HashAlgorithm> |
72 : UnsignedWithZeroKeyHashTraits<blink::HashAlgorithm> { | 72 : UnsignedWithZeroKeyHashTraits<blink::HashAlgorithm> { |
73 STATIC_ONLY(HashTraits); | 73 STATIC_ONLY(HashTraits); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace WTF | 76 } // namespace WTF |
77 #endif // SOURCE_PLATFORM_CRYPTO_H_ | 77 #endif // SOURCE_PLATFORM_CRYPTO_H_ |
OLD | NEW |