chromium/media/cdm/aes_cbc_crypto_unittest.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/cdm/aes_cbc_crypto.h"

#include <memory>
#include <optional>

#include "base/containers/span.h"
#include "base/memory/raw_span.h"
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
#include "media/base/decoder_buffer.h"
#include "media/base/decrypt_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "third_party/boringssl/src/include/openssl/crypto.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/evp.h"

namespace media {

namespace {

// Pattern decryption uses 16-byte blocks.
constexpr size_t kBlockSize =;

// Keys and IV have to be 128 bits.
const uint8_t kKey1[] =;
static_assert;

const uint8_t kKey2[] =;
static_assert;

const uint8_t kIv[] =;
static_assert;

const uint8_t kOneBlock[] =;
static_assert;

std::string MakeString(const std::vector<uint8_t>& chars) {}

// Returns a std::vector<uint8_t> containing |count| copies of |input|.
std::vector<uint8_t> Repeat(const std::vector<uint8_t>& input, size_t count) {}

}  // namespace

class AesCbcCryptoTest : public testing::Test {};

TEST_F(AesCbcCryptoTest, OneBlock) {}

TEST_F(AesCbcCryptoTest, WrongKey) {}

TEST_F(AesCbcCryptoTest, WrongIV) {}

TEST_F(AesCbcCryptoTest, PartialBlock) {}

TEST_F(AesCbcCryptoTest, MultipleBlocks) {}

// As the code in aes_cbc_crypto.cc relies on decrypting the data block by
// block, ensure that the crypto routines work the same way whether it
// decrypts one block at a time or all the blocks in one call.
TEST_F(AesCbcCryptoTest, BlockDecryptionWorks) {}

}  // namespace media