nucypher / nucypher-core

Core structures for Nucypher network in Rust
6 stars 11 forks source link

Introduce encrypted threshold decryption request/response functionality #52

Closed derekpierre closed 1 year ago

derekpierre commented 1 year ago

Use Umbral keys for now for encryption/decryption - similar to the TreasureMap/EncryptedTreasureMap work; we'll move away from Umbral when the time comes i.e. we determine the appropriate crypto scheme to use.

First foray into Rust ⚙️ 🥳 .

Builds ontop of #48.

Introduces:

  1. EncryptedThresholdDecryptionRequest - encrypted version of the ThresholdDecryptionRequest
  2. E2EThresholdDecryptionRequest - intermediate struct that stores the ThresholdDecryptionRequest and the response_encrypting_key i.e. the key Ursula will use to encrypt the ThresholdDecryptionResponse. Using an intermediary allows for a single ThresholdDecryptionRequest object to be reused for different response_encrypting_keys and encrypted for different Ursulas.
  3. EncryptedThresholdDecryptionResponse - encrypted version of the ThresholdDecryptionResponse

For reviewers:

codecov-commenter commented 1 year ago

Codecov Report

Merging #52 (9cb7921) into main (198085b) will increase coverage by 8.22%. The diff coverage is 57.89%.

@@            Coverage Diff            @@
##            main      #52      +/-   ##
=========================================
+ Coverage   7.01%   15.24%   +8.22%     
=========================================
  Files         16       16              
  Lines       2523     2841     +318     
=========================================
+ Hits         177      433     +256     
- Misses      2346     2408      +62     
Impacted Files Coverage Δ
nucypher-core-python/src/lib.rs 0.11% <0.00%> (-0.01%) :arrow_down:
nucypher-core-wasm/src/lib.rs 0.12% <0.00%> (-0.02%) :arrow_down:
nucypher-core/src/lib.rs 100.00% <ø> (ø)
nucypher-core/src/dkg.rs 92.50% <98.42%> (+92.50%) :arrow_up:

... and 1 file with indirect coverage changes

fjarri commented 1 year ago

Btw, heads up, wasm-bindgen 0.2.85 broke wasm-bindgen-derive, so I had to update it. If you see WASM tests failing, that may be it.