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

Unified Diff: content/child/webcrypto/openssl/aes_cbc_openssl.cc

Issue 491763002: [webcrypto] Implement AES-CTR using BoringSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto master (moves unittest to its own file) Created 6 years, 4 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/child/webcrypto/nss/util_nss.cc ('k') | content/child/webcrypto/openssl/aes_ctr_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/openssl/aes_cbc_openssl.cc
diff --git a/content/child/webcrypto/openssl/aes_cbc_openssl.cc b/content/child/webcrypto/openssl/aes_cbc_openssl.cc
index fcd8e6662b9f31362f5e8bd4b6f68b4cdf8ad19d..f24361f96ed432740485e0787d3fe36d2105e330 100644
--- a/content/child/webcrypto/openssl/aes_cbc_openssl.cc
+++ b/content/child/webcrypto/openssl/aes_cbc_openssl.cc
@@ -11,6 +11,7 @@
#include "content/child/webcrypto/crypto_data.h"
#include "content/child/webcrypto/openssl/aes_key_openssl.h"
#include "content/child/webcrypto/openssl/key_openssl.h"
+#include "content/child/webcrypto/openssl/util_openssl.h"
#include "content/child/webcrypto/status.h"
#include "content/child/webcrypto/webcrypto_util.h"
#include "crypto/openssl_util.h"
@@ -35,10 +36,7 @@ const EVP_CIPHER* GetAESCipherByKeyLength(unsigned int key_length_bytes) {
}
}
-// OpenSSL constants for EVP_CipherInit_ex(), do not change
-enum CipherOperation { kDoDecrypt = 0, kDoEncrypt = 1 };
-
-Status AesCbcEncryptDecrypt(CipherOperation cipher_operation,
+Status AesCbcEncryptDecrypt(EncryptOrDecrypt cipher_operation,
const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key,
const CryptoData& data,
@@ -119,14 +117,14 @@ class AesCbcImplementation : public AesAlgorithm {
const blink::WebCryptoKey& key,
const CryptoData& data,
std::vector<uint8_t>* buffer) const OVERRIDE {
- return AesCbcEncryptDecrypt(kDoEncrypt, algorithm, key, data, buffer);
+ return AesCbcEncryptDecrypt(ENCRYPT, algorithm, key, data, buffer);
}
virtual Status Decrypt(const blink::WebCryptoAlgorithm& algorithm,
const blink::WebCryptoKey& key,
const CryptoData& data,
std::vector<uint8_t>* buffer) const OVERRIDE {
- return AesCbcEncryptDecrypt(kDoDecrypt, algorithm, key, data, buffer);
+ return AesCbcEncryptDecrypt(DECRYPT, algorithm, key, data, buffer);
}
};
« no previous file with comments | « content/child/webcrypto/nss/util_nss.cc ('k') | content/child/webcrypto/openssl/aes_ctr_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698