#include "components/sync/test/fake_cryptographer.h"
#include <iterator>
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "components/sync/protocol/encryption.pb.h"
namespace syncer {
namespace {
const char kSeparator[] = …;
}
std::unique_ptr<FakeCryptographer> FakeCryptographer::FromSingleDefaultKey(
const std::string& key_name) { … }
FakeCryptographer::FakeCryptographer() = default;
FakeCryptographer::~FakeCryptographer() = default;
void FakeCryptographer::AddEncryptionKey(const std::string& key_name) { … }
void FakeCryptographer::SelectDefaultEncryptionKey(
const std::string& key_name) { … }
void FakeCryptographer::ClearDefaultEncryptionKey() { … }
bool FakeCryptographer::CanEncrypt() const { … }
bool FakeCryptographer::CanDecrypt(
const sync_pb::EncryptedData& encrypted) const { … }
std::string FakeCryptographer::GetDefaultEncryptionKeyName() const { … }
bool FakeCryptographer::EncryptString(const std::string& decrypted,
sync_pb::EncryptedData* encrypted) const { … }
bool FakeCryptographer::DecryptToString(const sync_pb::EncryptedData& encrypted,
std::string* decrypted) const { … }
const CrossUserSharingPublicPrivateKeyPair&
FakeCryptographer::GetCrossUserSharingKeyPair(uint32_t version) const { … }
std::optional<std::vector<uint8_t>>
FakeCryptographer::AuthEncryptForCrossUserSharing(
base::span<const uint8_t> plaintext,
base::span<const uint8_t> recipient_public_key) const { … }
std::optional<std::vector<uint8_t>>
FakeCryptographer::AuthDecryptForCrossUserSharing(
base::span<const uint8_t> encrypted_data,
base::span<const uint8_t> sender_public_key,
const uint32_t recipient_key_version) const { … }
}