Skip to content

AccessControlPolicy (ACP) and ThresholdMessageKit#3194

Merged
KPrasch merged 24 commits intonucypher:developmentfrom
derekpierre:acp
Aug 27, 2023
Merged

AccessControlPolicy (ACP) and ThresholdMessageKit#3194
KPrasch merged 24 commits intonucypher:developmentfrom
derekpierre:acp

Conversation

@derekpierre
Copy link
Member

@derekpierre derekpierre commented Jul 25, 2023

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:

High-level idea of the changes introduced in this PR.
List relevant API changes (if any), as well as related PRs and issues.

Issues fixed/closed:
Related to:

Closes:

Depends on:

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network.
E.g., if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:

What should reviewers focus on?
Is there a particular commit/function/section of your PR that requires more attention from reviewers?

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #3194 (a9cce0b) into development (44d36df) will increase coverage by 0.00%.
Report is 1 commits behind head on development.
The diff coverage is 91.66%.

@@             Coverage Diff              @@
##           development    #3194   +/-   ##
============================================
  Coverage        78.59%   78.60%           
============================================
  Files              112      112           
  Lines            11616    11624    +8     
============================================
+ Hits              9130     9137    +7     
- Misses            2486     2487    +1     
Flag Coverage Δ
acceptance 87.66% <100.00%> (+0.06%) ⬆️
integration 71.54% <90.47%> (+0.04%) ⬆️
unit 57.42% <26.31%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
nucypher/crypto/powers.py 86.63% <ø> (ø)
nucypher/blockchain/eth/agents.py 54.52% <50.00%> (-0.02%) ⬇️
nucypher/network/server.py 76.47% <83.33%> (+0.22%) ⬆️
nucypher/blockchain/eth/actors.py 81.81% <100.00%> (-0.12%) ⬇️
nucypher/characters/chaotic.py 99.02% <100.00%> (ø)
nucypher/characters/lawful.py 84.38% <100.00%> (+0.05%) ⬆️
nucypher/crypto/ferveo/dkg.py 86.11% <100.00%> (ø)
tests/acceptance/actors/test_dkg_ritual.py 96.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@derekpierre derekpierre force-pushed the acp branch 2 times, most recently from b8aec5e to dfbacd7 Compare July 25, 2023 18:42
return message_kit

def encrypt_for_dkg(self, plaintext: bytes, conditions: Lingo) -> Ciphertext:
def encrypt_for_dkg(self, plaintext: bytes, conditions: Lingo) -> DkgMessageKit:
Copy link
Member

@KPrasch KPrasch Jul 25, 2023

Choose a reason for hiding this comment

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

I also want to take a pause here to build on my above comment and revisit the discussion about keeping the developer/user-facing abstraction Ciphertext. Perhaps we don't need a new name here, just a new format?

@piotr-roslaniec
Copy link
Contributor

Is the progress of this issue blocked by anything?

AFAIK ThresholdMessageKit will be rewritten into nucypher-core. There are also some references to possible changes in ferveo. Would it be helpful if we scoped them, maybe finalizing this issue?

@derekpierre
Copy link
Member Author

Is the progress of this issue blocked by anything?

AFAIK ThresholdMessageKit will be rewritten into nucypher-core. There are also some references to possible changes in ferveo. Would it be helpful if we scoped them, maybe finalizing this issue?

Resolving nucypher/ferveo#154 / nucypher/ferveo#155 would help. Once those are nailed down then the ideas from that can be incorporated here to see what nucypher-core could look like. Then just transfer the changes to nucypher-core. It's simpler when things are clearer on the python side.

… ThresholdDecryptionRequest, to check whether the data is encrypted by an authorized party.

Stub method added to CoordinatorAgent for now.
…encrypted data was produced by an authorized party.
…eo - fake it for now by using the same ciphertext for both. ThresholdMessageKit includes both ciphertexts, but the ThresholdDecryptionRequest only requires the kem_ciphertext.
… - the AAD can be controlled by versioning but the TMK dictates the AAD and so must be linked somehow with the ACP.aad() function. For now this is done via a compatibility check function.
…ling in Python space and not `nucypher-core`.
…w that they are available via associated nucypher-core PR.
… key encapsulation so that only encrypted symmetric key and associated data (CiphertextHeader) are included in ThresholdDecryptionRequest.
Add TODO for actually calling contract to determine allow logic authorization.
…hat Ciphertext is not needlessly copied between python layer and Rust later.

Allow ciphertext header to be directly obtained without needing to first get the Ciphertext.
Move decryption of ferveo encrypted data into a method on ThresholdMessageKit so that the Ciphertext data can be used directly in Rust layer, and not pulled into python to then pass
it back into the Rust layer for decryption.
@KPrasch
Copy link
Member

KPrasch commented Aug 27, 2023

rebased @ 2fc713b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

3 participants