Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: Source/platform/Crypto.h

Issue 235893003: Remove use of WebCrypto digestSynchronous in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed ASSERT_WITH_SECURITY_IMPLICATIONS to RELEASE_ASSERT Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/websockets/WebSocketHandshake.cpp ('k') | Source/platform/Crypto.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
(...skipping 13 matching lines...) Expand all
24 typedef Vector<uint8_t, kMaxDigestSize> DigestValue; 24 typedef Vector<uint8_t, kMaxDigestSize> DigestValue;
25 25
26 const size_t sha1HashSize = 20; 26 const size_t sha1HashSize = 20;
27 enum HashAlgorithm { 27 enum HashAlgorithm {
28 HashAlgorithmSha1, 28 HashAlgorithmSha1,
29 HashAlgorithmSha256, 29 HashAlgorithmSha256,
30 HashAlgorithmSha384, 30 HashAlgorithmSha384,
31 HashAlgorithmSha512 31 HashAlgorithmSha512
32 }; 32 };
33 33
34 PLATFORM_EXPORT void computeDigest(HashAlgorithm, const char* digestable, size_t length, DigestValue& digestResult); 34 PLATFORM_EXPORT bool computeDigest(HashAlgorithm, const char* digestable, size_t length, DigestValue& digestResult);
35 PLATFORM_EXPORT PassOwnPtr<blink::WebCryptoDigestor> createDigestor(HashAlgorith m); 35 PLATFORM_EXPORT PassOwnPtr<blink::WebCryptoDigestor> createDigestor(HashAlgorith m);
36 PLATFORM_EXPORT void finishDigestor(blink::WebCryptoDigestor*, DigestValue& dige stResult); 36 PLATFORM_EXPORT void finishDigestor(blink::WebCryptoDigestor*, DigestValue& dige stResult);
37 37
38 } // namespace WebCore 38 } // namespace WebCore
39 39
40 namespace WTF { 40 namespace WTF {
41 41
42 struct DigestValueHash { 42 struct DigestValueHash {
43 static unsigned hash(const WebCore::DigestValue& v) 43 static unsigned hash(const WebCore::DigestValue& v)
44 { 44 {
(...skipping 13 matching lines...) Expand all
58 template <> 58 template <>
59 struct DefaultHash<WebCore::HashAlgorithm> { 59 struct DefaultHash<WebCore::HashAlgorithm> {
60 typedef IntHash<WebCore::HashAlgorithm> Hash; 60 typedef IntHash<WebCore::HashAlgorithm> Hash;
61 }; 61 };
62 template <> 62 template <>
63 struct HashTraits<WebCore::HashAlgorithm> : UnsignedWithZeroKeyHashTraits<WebCor e::HashAlgorithm> { 63 struct HashTraits<WebCore::HashAlgorithm> : UnsignedWithZeroKeyHashTraits<WebCor e::HashAlgorithm> {
64 }; 64 };
65 65
66 } // namespace WTF 66 } // namespace WTF
67 #endif // SOURCE_PLATFORM_CRYPTO_H_ 67 #endif // SOURCE_PLATFORM_CRYPTO_H_
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocketHandshake.cpp ('k') | Source/platform/Crypto.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698