-
Couldn't load subscription status.
- Fork 289
spec: authenticated udp #2091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
spec: authenticated udp #2091
Conversation
d92cb68 to
2702ae2
Compare
2702ae2 to
3637c04
Compare
3637c04 to
ad4b93d
Compare
ad4b93d to
69ad3bf
Compare
69ad3bf to
80c1a69
Compare
80c1a69 to
f7e7200
Compare
f7e7200 to
dad3184
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive specification for an authenticated peer-to-peer UDP protocol designed to address denial-of-service protection and traffic prioritization in RaptorCast communication. The protocol follows the WireGuard design with modifications to support secp256k1 keys and AEGIS128L encryption for improved performance.
Key changes:
- Defines a complete authenticated UDP protocol using Noise IK handshake pattern with secp256k1, AEGIS128L, and BLAKE3
- Implements DoS protection through cookie-based rate limiting and session management
- Provides integration specifications for RaptorCast and discovery services
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- remove special validators session handling during high load - updated under load rate limit threshold to 2000 rps - more efficient cookie nonce generation - restructured data packet, auth tag is a part of header
b72ae1c to
3b96835
Compare
|
|
||
| ```mermaid | ||
| packet-beta | ||
| 0: "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be Type as in the Field descriptions?
| - MAC1: Authentication of entire packet using initiator's static key hash | ||
| - MAC2: Cookie response MAC, empty unless under load (DoS protection) | ||
|
|
||
| Session establishment follows the Noise IK handshake pattern: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Session establishment follows the Noise IK handshake pattern: | |
| Session establishment follows the NoiseIKpsk2 handshake pattern: |
| ```rust | ||
| let temp = keyed_hash(&chaining_key, &[]); | ||
| let temp2 = keyed_hash(&temp, &[0x1]); | ||
| let send_key = keyed_hash(&temp, &[&temp2, &[0x2]].concat()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In WireGuard, these keys are calculated differently. It should be
let temp = keyed_hash(&chaining_key, &[]);
let send_key = keyed_hash(&temp, &[0x1]);
let recv_key = keyed_hash(&temp, &[&send_key, &[0x2]].concat());
Is it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, i will revert to wireguard specification, i can't recall now if i reused it from somewhere or just mistyped
rendered