// Copyright 2020 Google LLC. All Rights Reserved. #ifndef WHITEBOX_API_GOLDEN_DATA_H_ #define WHITEBOX_API_GOLDEN_DATA_H_ #include #include #include #include "cdm/protos/license_protocol.pb.h" namespace widevine { class GoldenData { public: struct Content { std::vector plaintext; std::vector ciphertext; std::vector key; std::vector iv; }; struct Key { video_widevine::License_KeyContainer_SecurityLevel level; std::vector id; const Content* content; }; GoldenData(); const Content& CBCContent() const { return cbc_content_; } const Key& CBCCryptoKey() const { return cbc_crypto_key_; } const Key& CBCDecodeKey() const { return cbc_decode_key_; } const Key& CBCHardwareKey() const { return cbc_hardware_key_; } const Content& CTRContent() const { return ctr_content_; } const Key& CTRCryptoKey() const { return ctr_crypto_key_; } const Key& CTRDecodeKey() const { return ctr_decode_key_; } const Key& CTRHardwareKey() const { return ctr_hardware_key_; } // When a test needs to define a key id that does not conflict with any key // ids defined in the golden data, it should use this to update their key id // by prepending a single byte to ensure it won't collide with any of the // internal key ids. void MakeKeyIdDifferent(std::vector* key_id) const; private: Content cbc_content_; Key cbc_crypto_key_; Key cbc_decode_key_; Key cbc_hardware_key_; Content ctr_content_; Key ctr_crypto_key_; Key ctr_decode_key_; Key ctr_hardware_key_; }; } // namespace widevine #endif // WHITEBOX_API_GOLDEN_DATA_H_