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

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

Issue 335463002: [webcrypto] Remove a special case for AES-KW wrapping/unwrapping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Try to placate a compiler warning Created 6 years, 6 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 | « no previous file | content/child/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/platform_crypto.h
diff --git a/content/child/webcrypto/platform_crypto.h b/content/child/webcrypto/platform_crypto.h
index e416c7a33d025e0a69733ccc6573b383a2a6f4a1..9e957301c01a03d7f8feecac67350a9a8c4cc758 100644
--- a/content/child/webcrypto/platform_crypto.h
+++ b/content/child/webcrypto/platform_crypto.h
@@ -272,40 +272,16 @@ Status ExportKeyPkcs8(PrivateKey* key,
const blink::WebCryptoKeyAlgorithm& key_algorithm,
std::vector<uint8>* buffer);
+// Performs AES-KW encryption/decryption on the input |data|.
// Preconditions:
// * |key| is non-null
-// * |wrapping_key| is non-null
-Status WrapSymKeyAesKw(SymKey* key,
- SymKey* wrapping_key,
- std::vector<uint8>* buffer);
-
-// Unwraps (decrypts) |wrapped_key_data| using AES-KW and places the results in
-// a WebCryptoKey. Raw key data remains inside NSS. This function should be used
-// when the input |wrapped_key_data| is known to result in symmetric raw key
-// data after AES-KW decryption.
-// Preconditions:
-// * |wrapping_key| is non-null
-// * |key| is non-null
-// * |wrapped_key_data| is at least 24 bytes and a multiple of 8 bytes
-// * |algorithm.id()| is for a symmetric key algorithm.
-// * usage_mask makes sense for the algorithm.
-Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data,
- SymKey* wrapping_key,
- const blink::WebCryptoAlgorithm& algorithm,
- bool extractable,
- blink::WebCryptoKeyUsageMask usage_mask,
- blink::WebCryptoKey* key);
-
-// Performs AES-KW decryption on the input |data|. This function should be used
-// when the input |data| does not directly represent a key and should instead be
-// interpreted as generic bytes.
-// Preconditions:
-// * |key| is non-null
-// * |data| is at least 24 bytes and a multiple of 8 bytes
+// * |data| is multiple of 8 bytes. If encrypting it is at least 16 bytes, and
+// if decrypting at least 24 bytes.
// * |buffer| is non-null.
-Status DecryptAesKw(SymKey* key,
- const CryptoData& data,
- std::vector<uint8>* buffer);
+Status EncryptDecryptAesKw(EncryptOrDecrypt mode,
+ SymKey* key,
+ const CryptoData& data,
+ std::vector<uint8>* buffer);
} // namespace platform
« no previous file with comments | « no previous file | content/child/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698