Skip to content

discv5: devp2p wire test vectors#34

Merged
ch4r10t33r merged 1 commit into
mainfrom
discv5-wire-test-vectors
May 10, 2026
Merged

discv5: devp2p wire test vectors#34
ch4r10t33r merged 1 commit into
mainfrom
discv5-wire-test-vectors

Conversation

@ch4r10t33r

Copy link
Copy Markdown
Collaborator

Adds src/discv5_wire_test_vectors.zig with unit tests derived from ethereum/devp2p discv5-wire-test-vectors.md:

  • Ordinary PING and WHOAREYOU packet decode; handshake inner PING decrypt with the documented read-key
  • ECDH shared secret, HKDF session keys (initiator/recipient), and v4 identity proof signature verification
  • AES-GCM: roundtrip using the doc key, nonce, AD, and plaintext; ciphertext prefix matches the reference CTR output (see comment in-file for tag vs Go on the isolated example)
  • Deterministic decodeInPlace stress on random 1280-byte inputs

The module is wired from root.zig test block.

Closes #23.

Add unit tests from ethereum/devp2p discv5-wire-test-vectors.md: packet
decode/decrypt (PING, WHOAREYOU, handshake), ECDH, HKDF session keys,
identity proof verify, AES-GCM roundtrip on the doc key/nonce/ad/pt, and
decodeInPlace stress. Register the module from root test block.

Closes #23.
@ch4r10t33r
ch4r10t33r merged commit 398e1d4 into main May 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

discv5: interop and test vectors

1 participant