#include "components/sync/engine/nigori/cross_user_sharing_public_private_key_pair.h"
#include <array>
#include <cstdint>
#include <optional>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/logging.h"
#include "third_party/boringssl/src/include/openssl/hpke.h"
namespace syncer {
CrossUserSharingPublicPrivateKeyPair::CrossUserSharingPublicPrivateKeyPair(
CrossUserSharingPublicPrivateKeyPair&& other) = default;
CrossUserSharingPublicPrivateKeyPair&
CrossUserSharingPublicPrivateKeyPair::operator=(
CrossUserSharingPublicPrivateKeyPair&& other) = default;
CrossUserSharingPublicPrivateKeyPair::~CrossUserSharingPublicPrivateKeyPair() =
default;
CrossUserSharingPublicPrivateKeyPair
CrossUserSharingPublicPrivateKeyPair::GenerateNewKeyPair() { … }
std::optional<CrossUserSharingPublicPrivateKeyPair>
CrossUserSharingPublicPrivateKeyPair::CreateByImport(
base::span<const uint8_t> private_key) { … }
CrossUserSharingPublicPrivateKeyPair::CrossUserSharingPublicPrivateKeyPair(
base::span<const uint8_t> private_key) { … }
CrossUserSharingPublicPrivateKeyPair::CrossUserSharingPublicPrivateKeyPair() { … }
std::array<uint8_t, X25519_PRIVATE_KEY_LEN>
CrossUserSharingPublicPrivateKeyPair::GetRawPrivateKey() const { … }
std::array<uint8_t, X25519_PUBLIC_VALUE_LEN>
CrossUserSharingPublicPrivateKeyPair::GetRawPublicKey() const { … }
std::optional<std::vector<uint8_t>>
CrossUserSharingPublicPrivateKeyPair::HpkeAuthEncrypt(
base::span<const uint8_t> plaintext,
base::span<const uint8_t> recipient_public_key,
base::span<const uint8_t> authenticated_info) const { … }
std::optional<std::vector<uint8_t>>
CrossUserSharingPublicPrivateKeyPair::HpkeAuthDecrypt(
base::span<const uint8_t> encrypted_data,
base::span<const uint8_t> sender_public_key,
base::span<const uint8_t> authenticated_info) const { … }
}