-
Notifications
You must be signed in to change notification settings - Fork 127
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
New noise and framing DO NOT MERGE UNTIL TP IMPLEMENT IT #601
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #601 +/- ##
==========================================
+ Coverage 40.28% 40.65% +0.36%
==========================================
Files 152 156 +4
Lines 14535 14588 +53
==========================================
+ Hits 5856 5931 +75
+ Misses 8679 8657 -22
☔ View full report in Codecov by Sentry. |
All the type that implement utils/buffer::Buffer now also implement aead::Buffer so that if a type is Buffer now can be passeed to aead::AeadInPlace::decrypt_in_place and aead::AeadInPlace::encrypt_in_place
The new noise protocol used by SRI deprecate elliptic curve signing algorithm and replace it with secp256k1, so that can be compatible with bitcoind. Key utils will replace noise_sv1::formats, and can be used to serialize and deserialize secp256k1 keypairs in base58. It can also be used as an utility to generate a random keypair.
Updated the SRI encryption and authentication algoritm with a different flavore of noise. It: * replace enterly the noise_sv2 crate * update codec_sv2 to use the new noise and remove the possibility to have fragmented noise frames (now a sv2 frame can not be split between more sv2 frame that means that sv2 frame max size is 2^24) * update netwrok_helpers to use the new noise, and improve it that change the library API so all the roles need to be updated * update all the examples, tests and roles to use the improved netwrok_helpers * update the MG to use the improved netwrok_helpers * updated all the test and config file to use the new format for private and public keys.
New Sv2 framing consists of two or more encrypted messages. The first message is the encrypted header, while the others are payload chunks, each split into 65,535-byte segments and encrypted. To build a buffer that can be deserialized into an Sv2 message (header + payload), we need to call the decrypt function at least twice on the same buffer: first for the header and then for the payload chunks. When passing a buffer to the decrypt function, it will attempt to decrypt the entire buffer starting from the first byte. This behavior is correct only when decrypting the header. In other cases, we need to "trick" the decrypt function by making it see a buffer that starts from an index other than 0. For this, the `danger_set_start` function is used. Note: This function is currently unreliable and should be used with caution for the following reasons: 1. It has not been fuzz-tested yet. 2. Users must remember to call `danger_set_start(0)` after decryption is complete. 3. While it works as expected with `as_ref` and `as_mut` methods, other specific methods still see the buffer starting at index 0.
No description provided.