#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/reporting/encryption/primitives.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <string_view>
#include "base/check_op.h"
#include "crypto/aead.h"
#include "third_party/boringssl/src/include/openssl/curve25519.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/hkdf.h"
namespace reporting {
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
bool ComputeSharedSecret(const uint8_t peer_public_value[kKeySize],
uint8_t shared_secret[kKeySize],
uint8_t generated_public_value[kKeySize]) { … }
bool ProduceSymmetricKey(const uint8_t shared_secret[kKeySize],
uint8_t symmetric_key[kKeySize]) { … }
bool PerformSymmetricEncryption(const uint8_t symmetric_key[kKeySize],
std::string_view input_data,
std::string* output_data) { … }
bool VerifySignature(const uint8_t verification_key[kKeySize],
std::string_view message,
const uint8_t signature[kSignatureSize]) { … }
}