#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 {
constexpr size_t kBlockSize = …;
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) { … }
std::vector<uint8_t> Repeat(const std::vector<uint8_t>& input, size_t count) { … }
}
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) { … }
TEST_F(AesCbcCryptoTest, BlockDecryptionWorks) { … }
}