-
Notifications
You must be signed in to change notification settings - Fork 136
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
Rust docs noise_sv2
#1111
Rust docs noise_sv2
#1111
Conversation
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Bencher
🚨 2 ALERTS: Threshold Boundary Limits exceeded!
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Bencher
🚨 2 ALERTS: Threshold Boundary Limits exceeded!
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
just two minor non blocking things for me:
|
noted, will push these. |
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.
Some typos and grammer corrections and some general questions for my curiousity.
Should generate_key be documented for handshake.rs?
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.
Here is my first pass, mainly focusing on the initiator, responder, and handshake trait. I will leave another review for the remaining modules, but this review is already quite large. Everything you are doing is great! Most of this are just my nits.
- We should add some top level docs in
lib.rs
that follow the same format as this which is from my PR Rust docs forprotocols::v2::codec-sv2
#1040. Please use the sv2-spec/04-Protocol-Security.md for reference when describing what the crate does in this section. - Each module (file) should have the appropriate top level docs.
lib.rs
needs to have doc comments on thePARITY
constant and theNoiseCodec
struct and its implemented methods.- All documentation should span the full 100 character line length instead of 80 characters.
- Avoid including language like "This struct performs ABC" or "This is a trait defining XYZ", just say "Performs ABC" or "Defines XYZ".
which generates this warning:
we could give this link some neat markdown formatting, something like:
|
0c25e92
to
bea943a
Compare
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
4b7be45
to
5144028
Compare
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
5027e63
to
424f8c8
Compare
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
d974208
to
693f638
Compare
693f638
to
aed0ad9
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.
Here is another round of review. I suggested some language in the src/lib.rs
that puts this crate into context with the Sv2 protocol, which @jbesraa also was suggesting in another comment in this PR.
One thing I noticed as well:
We switch between the language "Noise protocol" and "Noise NX protocol". "Noise NX" specifies a particular way the keys are exchanged between the two parties (such as NX, XX, or NN).
When should we be using "Noise protocol" vs "Noise NX protocol" in this crate? Are there specific instance when one is appropriate and the other is not? If not, let's standardize on a single term.
I also think the language of the top level initiator.rs
, responder.rs
, and perhaps the handshake.rs
modules could be cleaned up. Again, adding a bit of context in relation to the Sv2 protocol itself. But I did not leave any direct comments regarding this.
Overall, it is really coming together!
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.
Added come suggestions to clarify the top level module comments for various modules.
/// Manages the state of the initiator during the Noise NX protocol handshake process. It holds the | ||
/// necessary cryptographic keys, handshake state, and intermediate values needed to perform the | ||
/// key exchange and establish a secure connection with the responder. |
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.
Perhaps rephrase or add context to the Initiator
struct comments based on the suggestions for the top level mod comments in this module, given that the top level module doc comments are private and will not render to crates.io, but the Initiator
struct doc comments are public and will render.
73fede5
to
6b48e09
Compare
fcf589f
to
a91cf7d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1111 +/- ##
=======================================
Coverage 19.36% 19.36%
=======================================
Files 164 164
Lines 10811 10811
=======================================
Hits 2094 2094
Misses 8717 8717
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
a91cf7d
to
f633c0a
Compare
fn drop(&mut self) { | ||
self.erase_k(); | ||
} | ||
} | ||
|
||
impl GenericCipher { | ||
// Encrypts the data (`msg`) in place using the underlying cipher. |
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.
Commented previously on this but didn't get a response. why are we using ( X
) to refer to variables?
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.
Rachel suggested these, cc: @rrybarczyk
closes #1013