Add support for crypto HAL on L3 devices DO NOT MERGE
Includes widevine library release version 4.5.0.7571 Change-Id: I9e574d5606576aab376d0524a4bf1a81e5a61678 related-to-bug: 6427322 related-to-bug: 6427274
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <media/hardware/CryptoAPI.h>
|
||||
#include <utils/threads.h>
|
||||
#include <openssl/aes.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
@@ -27,14 +28,16 @@ struct WVCryptoPlugin : public CryptoPlugin {
|
||||
WVCryptoPlugin(const void *data, size_t size);
|
||||
virtual ~WVCryptoPlugin();
|
||||
|
||||
const static size_t kAES128BlockSize = 16;
|
||||
|
||||
status_t initCheck() const;
|
||||
|
||||
virtual bool requiresSecureDecoderComponent(const char *mime) const;
|
||||
|
||||
virtual status_t decrypt(
|
||||
bool secure,
|
||||
const uint8_t key[16],
|
||||
const uint8_t iv[16],
|
||||
const uint8_t key[kAES128BlockSize],
|
||||
const uint8_t iv[kAES128BlockSize],
|
||||
Mode mode,
|
||||
const void *srcPtr,
|
||||
const SubSample *subSamples, size_t numSubSamples,
|
||||
@@ -42,9 +45,13 @@ struct WVCryptoPlugin : public CryptoPlugin {
|
||||
AString *errorDetailMsg);
|
||||
|
||||
private:
|
||||
status_t decryptSW(const uint8_t *key, uint8_t *out, const uint8_t *in, size_t length);
|
||||
|
||||
Mutex mLock;
|
||||
|
||||
status_t mInitCheck;
|
||||
AES_KEY mAesKey;
|
||||
uint8_t mEncKey[kAES128BlockSize];
|
||||
|
||||
WVCryptoPlugin(const WVCryptoPlugin &);
|
||||
WVCryptoPlugin &operator=(const WVCryptoPlugin &);
|
||||
|
||||
Reference in New Issue
Block a user