Merge "Break Decrypt Buffers Into 100KiB Blocks As Needed"

This commit is contained in:
John Bruce
2017-01-19 19:48:00 +00:00
committed by Android (Google) Code Review
3 changed files with 238 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
#include <map>
#include <string>
#include <vector>
#include "lock.h"
#include "oemcrypto_adapter.h"
@@ -143,6 +144,18 @@ class CryptoSession {
CdmEncryptionAlgorithm algorithm);
size_t GenericEncryptionBlockSize(CdmEncryptionAlgorithm algorithm);
// These methods are used when a subsample exceeds the maximum buffer size
// that the device can handle.
OEMCryptoResult CopyBufferInChunks(
const CdmDecryptionParameters& params,
OEMCrypto_DestBufferDesc buffer_descriptor);
OEMCryptoResult DecryptInChunks(
const CdmDecryptionParameters& params,
const OEMCrypto_DestBufferDesc& full_buffer_descriptor,
const OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor,
size_t max_chunk_size);
static void IncrementIV(uint64_t increase_by, std::vector<uint8_t>* iv_out);
static const size_t kAes128BlockSize = 16; // Block size for AES_CBC_128
static const size_t kSignatureSize = 32; // size for HMAC-SHA256 signature
static Lock crypto_lock_;