encrypt multicast with shared key

This commit is contained in:
2026-07-22 17:25:18 +02:00
parent f9f0df478d
commit 412426fd70
3 changed files with 117 additions and 98 deletions

View File

@@ -5,18 +5,18 @@ import "encoding/binary"
const PROTO_VERSION uint16 = 1
const (
unused uint16 = iota
_ uint16 = iota
// (client -> server) requests an IP
// [ pubkey - 1216 bytes ]
REQ_REGISTER
// (server -> client) assigns an IP
// [ ip - 16 bytes ]
// (server -> client) returns the assigned IP and encapsulated multicast key
// [ ip - 16 bytes ] [ ciphertext - 1168 bytes ]
RESP_REGISTER
// (client -> server -> client2) relays an encrypted packet to a specified peer
// [ destIP - 16 bytes ] [ srcIP - 16 bytes ] [ encrypted pkt ]
ENC_PKT
// (client -> server -> *) broadcasts an unsecured packet
// [ plaintext pkt ]
// (client -> server -> *) broadcasts an encrypted packet
// [ encrypted pkt ]
BROADCAST_PKT
// (client -> server) requests peer's pubkey from the server for encapsulation
// [ ip - 16 bytes ]