Skip to content

Encrypting partial decryptions#22

Merged
jonco5555 merged 7 commits into
mainfrom
fixes
Sep 27, 2025
Merged

Encrypting partial decryptions#22
jonco5555 merged 7 commits into
mainfrom
fixes

Conversation

@jonco5555

Copy link
Copy Markdown
Owner

No description provided.

@jonco5555 jonco5555 requested a review from Copilot September 26, 2025 11:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/vault/crypto/threshold.py
Comment thread src/vault/manager/manager.py Outdated
Comment thread docs/assets/retrieve.excalidraw.png
@jonco5555 jonco5555 merged commit 0fba8b7 into main Sep 27, 2025
1 check passed
@jonco5555 jonco5555 deleted the fixes branch September 27, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants