#include "components/encrypted_messages/message_encrypter.h"
#include <string_view>
#include "base/logging.h"
#include "components/encrypted_messages/encrypted_message.pb.h"
#include "crypto/aead.h"
#include "crypto/hkdf.h"
#include "crypto/random.h"
#include "third_party/boringssl/src/include/openssl/curve25519.h"
namespace encrypted_messages {
namespace {
bool GetHkdfSubkeySecret(size_t subkey_length,
const uint8_t* private_key,
const uint8_t* public_key,
std::string_view hkdf_label,
std::string* secret) { … }
}
bool EncryptSerializedMessage(const uint8_t* server_public_key,
uint32_t server_public_key_version,
std::string_view hkdf_label,
const std::string& message,
EncryptedMessage* encrypted_message) { … }
bool DecryptMessageForTesting(const uint8_t server_private_key[32],
std::string_view hkdf_label,
const EncryptedMessage& encrypted_message,
std::string* decrypted_serialized_message) { … }
}