#include "services/preferences/tracked/pref_hash_calculator.h"
#include <stdint.h>
#include <memory>
#include <vector>
#include "base/functional/bind.h"
#include "base/json/json_string_value_serializer.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "crypto/hmac.h"
namespace {
std::string GetDigestString(const std::string& key,
const std::string& message) { … }
void RemoveEmptyValueDictEntries(base::Value::Dict& dict);
void RemoveEmptyValueListEntries(base::Value::List& list);
void RemoveEmptyValueDictEntries(base::Value::Dict& dict) { … }
void RemoveEmptyValueListEntries(base::Value::List& list) { … }
bool VerifyDigestString(const std::string& key,
const std::string& message,
const std::string& digest_string) { … }
std::string ValueAsString(const base::Value::Dict* value) { … }
std::string ValueAsString(const base::Value* value) { … }
std::string GetMessage(const std::string& device_id,
const std::string& path,
const std::string& value_as_string) { … }
}
PrefHashCalculator::PrefHashCalculator(const std::string& seed,
const std::string& device_id,
const std::string& legacy_device_id)
: … { … }
PrefHashCalculator::~PrefHashCalculator() { … }
std::string PrefHashCalculator::Calculate(const std::string& path,
const base::Value* value) const { … }
std::string PrefHashCalculator::Calculate(const std::string& path,
const base::Value::Dict* dict) const { … }
PrefHashCalculator::ValidationResult PrefHashCalculator::Validate(
const std::string& path,
const base::Value* value,
const std::string& digest_string) const { … }
PrefHashCalculator::ValidationResult PrefHashCalculator::Validate(
const std::string& path,
const base::Value::Dict* dict,
const std::string& digest_string) const { … }
PrefHashCalculator::ValidationResult PrefHashCalculator::Validate(
const std::string& path,
const std::string& value_as_string,
const std::string& digest_string) const { … }