Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements encryption of partial decryptions to enhance security in the threshold cryptography system. The changes ensure that partial decryption results from share servers are encrypted with the user's public key before being transmitted.
Key Changes
- Encrypts partial decryptions with user's public key at the share server level
- Updates protobuf definitions to include user public key in requests and encrypted responses
- Refactors type definitions to use internal PartialDecryption type instead of protobuf
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| protos/vault.proto | Adds user_public_key field to DecryptRequest and changes response to encrypted bytes |
| src/vault/share_server/share_server.py | Encrypts partial decryptions with user's public key before returning |
| src/vault/manager/manager.py | Updates to handle encrypted partial decryptions and pass user public key |
| src/vault/user/user.py | Decrypts received partial decryptions using private key |
| src/vault/crypto/threshold.py | Changes return type to internal PartialDecryption type |
| src/vault/common/types.py | Adds PartialDecryption type definition |
| tests/test_share_server.py | Updates tests to handle encryption and adds key_pairs fixture usage |
| tests/conftest.py | Moves key_pairs fixture to shared location |
| docs/design_implementation.md | Documents the encryption step in the retrieval flow |
Comments suppressed due to low confidence (1)
tests/test_share_server.py:1
- [nitpick] The logic combines two different operations - decrypting server responses and adding local partial decryption - into a single list construction. This makes the code harder to understand. Consider separating these concerns by first processing the encrypted responses, then appending the local partial decryption as a separate step.
from unittest.mock import patch
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.