Skip to content

rlpx::auth

Classes

Name
struct rlpx::auth::HandshakeConfig
struct rlpx::auth::HandshakeResult
class rlpx::auth::AuthHandshake
Authentication handshake coordinator.
struct rlpx::auth::AuthKeyMaterial
struct rlpx::auth::FrameSecrets
struct rlpx::auth::EciesEncryptParams
struct rlpx::auth::EciesDecryptParams
class rlpx::auth::EciesCipher

Functions

Name
FrameSecrets derive_frame_secrets(const AuthKeyMaterial & keys, bool is_initiator)
Derive RLPx frame secrets from authenticated handshake key material.

Attributes

Name
size_t kAuthSize
size_t kAckSize
ack plaintext = eph_pubkey(64) + nonce(32) + ver(1) = 97

Functions Documentation

function derive_frame_secrets

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 (dialer), false for the responder.

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

Exposed as a free function for unit testing against go-ethereum test vectors.

Attributes Documentation

variable kAuthSize

static size_t kAuthSize = 307;

Plain RLPx v4 fixed wire sizes (ECIES overhead + plaintext) auth plaintext = sig(65) + eph_hash(32) + pubkey(64) + nonce(32) + ver(1) = 194 ECIES overhead = pubkey(65) + iv(16) + mac(32) = 113 ECIES( 194-byte auth body )

variable kAckSize

static size_t kAckSize = 210;

ack plaintext = eph_pubkey(64) + nonce(32) + ver(1) = 97

ECIES( 97-byte ack body )


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