-
Notifications
You must be signed in to change notification settings - Fork 5
v4: AES, remove covert frames #29
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?
Conversation
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 pull request revives version-based cipher selection in the v3 API, enabling switching between ChaCha20-Poly1305 (version 3) and AES-GCM (version 4+) for encryption. The PR also removes support for covert frames throughout the codebase. The main motivation is performance: AES-GCM with hardware acceleration (AES-NI) provides approximately 4x speedup compared to ChaCha20-Poly1305.
Changes:
- Adds
peerVersionparameter to v3 API functions for cipher selection - Implements
newAEAD()function to choose between ChaCha20-Poly1305 (v3) and AES-GCM (v4+) - Removes all covert stream functionality including
DialCovertStream(), related buffer management, and padding logic - Updates package-level API to default to version 4
- Adds test coverage for multiple versions (3, 4, 5, 255)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| mux.go | Updates version negotiation from 3 to 4, passes negotiated version to v3 layer |
| v3/handshake.go | Implements cipher selection logic based on version, adds newAEAD() function, fixes typo |
| v3/mux.go | Adds peerVersion parameter to handshake functions, removes covert stream methods and buffer management |
| v3/frame.go | Removes covert frame handling logic, updates constant names for generality, uses modern range syntax |
| v3/mux_test.go | Adds version selection test, removes covert stream tests and benchmarks, removes unused imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
peterjan
left a comment
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.
README.md still mentions covert streams
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.
It's a bit unfortunate that we once again have protocol v4, in v3/*.go, but it makes sense.
There's only ~5% performance loss on my Mac going with AES-256. Since it's fairly negligible, we have the key material, and it's an easy boost I'd probably lean towards 256. I'm good either way and we can always revisit it later.
Alrighttt
left a comment
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.
LGTM;
Tested this manually, and everything works as expected. The only nit I have is that we now have v4 code within the v3 directory.
|
Perhaps we should rename to |
a79e6ae
|
Some additional benchmarks from my Proxmox server. All benchmarks used 1 core but different CPU settings: The difference between the
|
Revives the
versionargument the v3 API, allowing the handshake to switch between AES and ChaCha. Benchmarks show a ~4x speedup (how fitting). Also dropped support for covert frames andDialStreamContext; they were previously removed from the package-level API, but not the underlyingv3/implementation.Implements #28