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

Unified Diff: content/renderer/webcrypto/webcrypto_impl.cc

Issue 138343008: Add content implementation of digestSynchcronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes from eroman Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/webcrypto_impl.cc
diff --git a/content/renderer/webcrypto/webcrypto_impl.cc b/content/renderer/webcrypto/webcrypto_impl.cc
index 4cb77d58bea9024b63a25c23465ba2ce631f7bc7..3eddb7f7d6d6b11acc0982f3001b4fd2a785413d 100644
--- a/content/renderer/webcrypto/webcrypto_impl.cc
+++ b/content/renderer/webcrypto/webcrypto_impl.cc
@@ -194,4 +194,16 @@ void WebCryptoImpl::verifySignature(const blink::WebCryptoAlgorithm& algorithm,
result.completeWithBoolean(signature_match);
}
+bool WebCryptoImpl::digestSynchronous(
+ const blink::WebCryptoAlgorithmId algorithm_id,
+ const unsigned char* data,
+ unsigned int data_size,
+ blink::WebArrayBuffer& result) {
+ blink::WebCryptoAlgorithm algorithm =
+ blink::WebCryptoAlgorithm::adoptParamsAndCreate(algorithm_id, NULL);
+ return (webcrypto::Digest(
+ algorithm, webcrypto::CryptoData(data, data_size), &result))
+ .IsSuccess();
+}
+
} // namespace content
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698