chromium/media/cdm/cbcs_decryptor_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/cbcs_decryptor.h"

#include <algorithm>
#include <array>
#include <memory>
#include <optional>

#include "base/containers/span.h"
#include "base/containers/to_vector.h"
#include "base/time/time.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"

namespace media {

namespace {

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

// Keys and IVs have to be 128 bits.
const std::array<uint8_t, 16> kKey =;

const std::array<uint8_t, 16> kIv =;

const std::array<uint8_t, kBlockSize> kOneBlock =;

const std::array<uint8_t, 6> kPartialBlock =;
static_assert;

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

// Combine multiple std::vector<uint8_t> into one.
std::vector<uint8_t> Combine(const std::vector<std::vector<uint8_t>>& inputs) {}

// Extract the |n|th block of |input|. The first block is number 1.
std::vector<uint8_t> GetBlock(size_t n, const std::vector<uint8_t>& input) {}

// 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 CbcsDecryptorTest : public testing::Test {};

TEST_F(CbcsDecryptorTest, OneBlock) {}

TEST_F(CbcsDecryptorTest, AdditionalData) {}

TEST_F(CbcsDecryptorTest, DifferentPattern) {}

TEST_F(CbcsDecryptorTest, EmptyPattern) {}

TEST_F(CbcsDecryptorTest, PatternTooLarge) {}

TEST_F(CbcsDecryptorTest, NoSubsamples) {}

TEST_F(CbcsDecryptorTest, BadSubsamples) {}

TEST_F(CbcsDecryptorTest, InvalidIv) {}

TEST_F(CbcsDecryptorTest, InvalidKey) {}

TEST_F(CbcsDecryptorTest, PartialBlock) {}

TEST_F(CbcsDecryptorTest, SingleBlockWithExtraData) {}

TEST_F(CbcsDecryptorTest, SkipBlock) {}

TEST_F(CbcsDecryptorTest, MultipleBlocks) {}

TEST_F(CbcsDecryptorTest, PartialPattern) {}

TEST_F(CbcsDecryptorTest, SkipBlocks) {}

TEST_F(CbcsDecryptorTest, MultipleSubsamples) {}

TEST_F(CbcsDecryptorTest, MultipleSubsamplesWithClearBytes) {}

}  // namespace media