This CL updates documentation, reference code, and unit tests to match the OEMCrypto v15.1 API. 1. The design for the Full Decrypt Path Testing application has changed. Instead of reading hashes from an external file, it will use a single key frame and modify it to match the desired size. The test application will then compute the hash and encrypt the frame. For OEMCrypto, this means that there will not be a call to OEMCrypto_InitializeDecryptHash before the frame and OEMCrypto_SetDecryptHash after the frame. Instead, there will be a single call to OEMCrypto_SetDecryptHash before the frame. The function OEMCrypto_InitializeDecryptHash will not be used. 2. The "Shared License" feature is not used by any production server. This functionality is no longer required and OEMCrypto may reject licenses with a nonzero bit 23 in the key control block.
42 lines
1.6 KiB
C++
42 lines
1.6 KiB
C++
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine Master
|
|
// License Agreement.
|
|
|
|
#ifndef WVCDM_UTIL_STRING_CONVERSIONS_H_
|
|
#define WVCDM_UTIL_STRING_CONVERSIONS_H_
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "util_common.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
CORE_UTIL_EXPORT std::vector<uint8_t> a2b_hex(const std::string& b);
|
|
CORE_UTIL_EXPORT std::vector<uint8_t> a2b_hex(const std::string& label,
|
|
const std::string& b);
|
|
CORE_UTIL_EXPORT std::string a2bs_hex(const std::string& b);
|
|
CORE_UTIL_EXPORT std::string b2a_hex(const std::vector<uint8_t>& b);
|
|
CORE_UTIL_EXPORT std::string b2a_hex(const std::string& b);
|
|
CORE_UTIL_EXPORT std::string Base64Encode(
|
|
const std::vector<uint8_t>& bin_input);
|
|
CORE_UTIL_EXPORT std::vector<uint8_t> Base64Decode(
|
|
const std::string& bin_input);
|
|
CORE_UTIL_EXPORT std::string Base64SafeEncode(
|
|
const std::vector<uint8_t>& bin_input);
|
|
CORE_UTIL_EXPORT std::string Base64SafeEncodeNoPad(
|
|
const std::vector<uint8_t>& bin_input);
|
|
CORE_UTIL_EXPORT std::vector<uint8_t> Base64SafeDecode(
|
|
const std::string& bin_input);
|
|
CORE_UTIL_EXPORT std::string HexEncode(const uint8_t* bytes, unsigned size);
|
|
CORE_UTIL_EXPORT std::string IntToString(int value);
|
|
CORE_UTIL_EXPORT int64_t htonll64(int64_t x);
|
|
CORE_UTIL_EXPORT inline int64_t ntohll64(int64_t x) { return htonll64(x); }
|
|
CORE_UTIL_EXPORT std::string BytesToString(const uint8_t* bytes, unsigned size);
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // WVCDM_UTIL_STRING_CONVERSIONS_H_
|