7#include <noise/protocol.h>
41 [[nodiscard]]
int init(
const psk_t &psk,
const uint8_t *prologue,
size_t prologue_len);
54 [[nodiscard]]
int split(NoiseCipherState *&send_cipher, NoiseCipherState *&recv_cipher);
Sans-IO responder side of a Noise_NNpsk0_25519_ChaChaPoly_SHA256 handshake.
int write_message(uint8_t *out, size_t capacity, size_t &out_len)
Produce the next handshake message into out; out_len receives its size and is zero on error.
~NoiseResponderHandshake()
Action action() const
ACTION_FAILED is the catch-all: returned before init(), after split() has released the state,...
int init(const psk_t &psk, const uint8_t *prologue, size_t prologue_len)
Create and start the handshake with the given PSK and prologue.
NoiseResponderHandshake & operator=(const NoiseResponderHandshake &)=delete
int fail_init_(int err)
Release a half-initialized state so a failed init() leaves the object as if init() was never called.
NoiseHandshakeState * handshake_
int read_message(uint8_t *data, size_t len)
Process one received handshake message.
NoiseResponderHandshake()=default
int split(NoiseCipherState *&send_cipher, NoiseCipherState *&recv_cipher)
Hand out the transport ciphers and free the handshake state.
NoiseResponderHandshake(const NoiseResponderHandshake &)=delete
std::array< uint8_t, 32 > psk_t
uint16_t uint16_t & capacity