This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Update crypto deps and add a new Cipher
associated type
#15
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nashtare
commented
Oct 17, 2023
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #15 +/- ##
==========================================
- Coverage 78.39% 78.04% -0.36%
==========================================
Files 14 14
Lines 884 929 +45
==========================================
+ Hits 693 725 +32
- Misses 191 204 +13
☔ View full report in Codecov by Sentry. |
Nashtare
changed the title
Update crypto deps and make Cipher an associated type
Update crypto deps and add a new Oct 18, 2023
Cipher
associated type
4l0n50
approved these changes
Oct 23, 2023
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.
Looks good to me
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR generalizes the use of AES to any AEAD, to be used during share encryption, and updates the mode used in testing to be AES-GCM.
Additions and Changes
The outstanding changes are:
CipherSuite
, namelyCipher
, to be used during Dkg / Resharing to encrypt/decrypt secret shares. It must implement theAead
(for (de/en)crypting) andKeyInit
(for Key initialization from the output of the HKDF) traits (+Clone
because that's convenient).nonce
field ofEncryptedSecretShare
: it now is aNonce<C::Cipher>
which conveniently wraps around aGenericArray
to give some guarantees on the expected underlying length, and remove the current hardcoded nonce length.Cipher
for testing is nowAes128Gcm
. The rationale is thataes
crate from v0.7 to v0.8, there's been a big refactor removing among others thectr
modeNote that I didn't go for the
aes-gcm-siv
crate as:Ciphersuite
trait is, as mentioned, only for testing purposesAes128Gcm
was used as internal cipher in production, we'd need over 4 billion encryption over the same initial DH key to have problems...Note that because of the new
C::Cipher
type, and the use ofAes128Gcm
in testing, I had to manually implement several of the previously derived traits forEncryptedSecretShare
. Thenonce
field for (de)serialization requires collecting, though shouldn't be a bottleneck hence I left it as aVec
.PR Checklist: