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

Unified Diff: content/child/webcrypto/algorithm_implementation.h

Issue 749183004: WebCrypto: Implement crypto.subtle.deriveKey (chromium-side). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ecdh
Patch Set: Created 6 years 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
Index: content/child/webcrypto/algorithm_implementation.h
diff --git a/content/child/webcrypto/algorithm_implementation.h b/content/child/webcrypto/algorithm_implementation.h
index 51321744d7e1419989e99ba2c0c6675887db7b26..52819dcee75ca361fb4fba5604a25b8c8c23f774 100644
--- a/content/child/webcrypto/algorithm_implementation.h
+++ b/content/child/webcrypto/algorithm_implementation.h
@@ -81,10 +81,16 @@ class AlgorithmImplementation {
blink::WebCryptoKeyUsageMask usages,
GenerateKeyResult* result) const;
- // This method corresponds to Web Crypto's "derive bits" operation.
+ // This method corresponds to Web Crypto's "derive bits" operation. It is
+ // essentially crypto.subtle.deriveBits() with the exception that the length
+ // can be "null" (|has_length_bits = true|).
+ //
+ // In cases where the length was not specified, an appropriate default for the
+ // algorithm should be used (as described by the spec).
virtual Status DeriveBits(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& base_key,
- unsigned int length_bits,
+ bool has_optional_length_bits,
+ unsigned int optional_length_bits,
std::vector<uint8_t>* derived_bytes) const;
// This method corresponds with Web Crypto's "Get key length" operation.

Powered by Google App Engine
This is Rietveld 408576698