#include "components/sync/nigori/nigori_state.h"
#include <cstdint>
#include <vector>
#include "base/base64.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/base/time.h"
#include "components/sync/engine/nigori/cross_user_sharing_public_key.h"
#include "components/sync/engine/nigori/key_derivation_params.h"
#include "components/sync/engine/sync_encryption_handler.h"
#include "components/sync/nigori/cryptographer_impl.h"
#include "components/sync/nigori/keystore_keys_cryptographer.h"
#include "components/sync/protocol/nigori_local_data.pb.h"
#include "components/sync/protocol/nigori_specifics.pb.h"
namespace syncer {
namespace {
BASE_FEATURE(…);
enum class CrossUserSharingKeyPairState { … };
sync_pb::CustomPassphraseKeyDerivationParams
CustomPassphraseKeyDerivationParamsToProto(const KeyDerivationParams& params) { … }
KeyDerivationParams CustomPassphraseKeyDerivationParamsFromProto(
const sync_pb::CustomPassphraseKeyDerivationParams& proto) { … }
bool EncryptEncryptionKeys(const CryptographerImpl& cryptographer,
sync_pb::EncryptedData* encrypted) { … }
void UpdateSpecificsFromKeyDerivationParams(
const KeyDerivationParams& params,
sync_pb::NigoriSpecifics* specifics) { … }
std::optional<CrossUserSharingPublicKey> PublicKeyFromProto(
const sync_pb::CrossUserSharingPublicKey& public_key) { … }
sync_pb::CrossUserSharingPublicKey PublicKeyToProto(
const CrossUserSharingPublicKey& public_key,
uint32_t key_pair_version) { … }
CrossUserSharingKeyPairState GetCrossUserSharingPublicKeyState(
const NigoriState& state) { … }
}
NigoriState NigoriState::CreateFromLocalProto(
const sync_pb::NigoriModel& proto) { … }
NigoriState::NigoriState()
: … { … }
NigoriState::NigoriState(NigoriState&& other) = default;
NigoriState::~NigoriState() = default;
NigoriState& NigoriState::operator=(NigoriState&& other) = default;
sync_pb::NigoriModel NigoriState::ToLocalProto() const { … }
sync_pb::NigoriSpecifics NigoriState::ToSpecificsProto() const { … }
NigoriState NigoriState::Clone() const { … }
bool NigoriState::NeedsKeystoreReencryption() const { … }
DataTypeSet NigoriState::GetEncryptedTypes() const { … }
bool NigoriState::NeedsGenerateCrossUserSharingKeyPair() const { … }
}