Skip to content

rlpx::auth::AuthHandshake

Authentication handshake coordinator.

#include <auth_handshake.hpp>

Public Functions

Name
AuthHandshake(const HandshakeConfig & config, socket::SocketTransport transport)
Construct handshake with config and an already-connected transport.
Result< HandshakeResult > execute(boost::asio::yield_context yield)
Execute full handshake (auth + hello exchange).
bool is_initiator() const
State query.
FrameSecrets derive_frame_secrets(const AuthKeyMaterial & keys, bool is_initiator)
Derive RLPx frame secrets from authenticated handshake key material.

Public Functions Documentation

function AuthHandshake

explicit AuthHandshake(
    const HandshakeConfig & config,
    socket::SocketTransport transport
)

Construct handshake with config and an already-connected transport.

Parameters:

  • config Crypto config (keys, peer pubkey, client id).
  • transport Connected TCP socket — ownership transferred in.

function execute

Result< HandshakeResult > execute(
    boost::asio::yield_context yield
)

Execute full handshake (auth + hello exchange).

Parameters:

  • yield Boost.Asio stackful coroutine context.

Return: HandshakeResult on success, SessionError on failure.

function is_initiator

inline bool is_initiator() const

State query.

function derive_frame_secrets

static FrameSecrets derive_frame_secrets(
    const AuthKeyMaterial & keys,
    bool is_initiator
)

Derive RLPx frame secrets from authenticated handshake key material.

Parameters:

  • keys All ECDH, nonce, and wire bytes collected during the handshake.
  • is_initiator True for the connection initiator, false for the responder.

Return: FrameSecrets containing AES/MAC keys and MAC seed byte strings.


Updated on 2026-04-13 at 23:22:46 -0700