Updates for the new Umbral API#2612
Merged
KPrasch merged 12 commits intonucypher:mainfrom Jun 23, 2021
Merged
Conversation
fjarri
added a commit
to fjarri/nucypher
that referenced
this pull request
Mar 25, 2021
fjarri
added a commit
to fjarri/nucypher
that referenced
this pull request
Mar 29, 2021
fjarri
added a commit
to fjarri/nucypher
that referenced
this pull request
Jun 1, 2021
cec4044 to
47fe15d
Compare
fjarri
added a commit
to fjarri/nucypher
that referenced
this pull request
Jun 1, 2021
9399521 to
d094b8b
Compare
14937ca to
2f356ae
Compare
derekpierre
approved these changes
Jun 4, 2021
Member
derekpierre
left a comment
There was a problem hiding this comment.
🎸 Looks good - the adapter isolation definitely made it easier to look through.
fjarri
added a commit
to fjarri/nucypher
that referenced
this pull request
Jun 7, 2021
piotr-roslaniec
approved these changes
Jun 8, 2021
cygnusv
reviewed
Jun 11, 2021
derekpierre
reviewed
Jun 11, 2021
This import does not seem to be used, and the docs are built just fine without it.
cygnusv
approved these changes
Jun 22, 2021
jMyles
reviewed
Jun 22, 2021
|
|
||
| print("The policy public key for " | ||
| "label '{}' is {}".format(label.decode("utf-8"), policy_pubkey.to_bytes().hex())) | ||
| "label '{}' is {}".format(label.decode("utf-8"), bytes(policy_pubkey).hex())) |
jMyles
reviewed
Jun 22, 2021
| delegating_power = self._crypto_power.power_ups(DelegatingPower) | ||
| return delegating_power.generate_kfrags(bob_pubkey_enc=bob_encrypting_key, | ||
| signer=self.stamp, | ||
| signer=self.stamp.as_umbral_signer(), |
Contributor
Author
There was a problem hiding this comment.
The signer has to go inside Umbral, so it has to be an Umbral object. We have an arbitrary Python callable inside Rust code
Contributor
There was a problem hiding this comment.
To clarify my question:
Why pass the umbral signer instead of the stamp and then use its __call__ like we were doing? What's the advantage of the signer object that the stamp itself can't satisfy?
Contributor
Author
There was a problem hiding this comment.
It's called inside generate_kfrags(), which is a Rust function. There is no Python available at that level. The signer object is a wrapped Rust object, so it can go through.
vepkenez
approved these changes
Jun 23, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 24, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 24, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 25, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 25, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 25, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 28, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jun 30, 2021
KPrasch
added a commit
to KPrasch/nucypher
that referenced
this pull request
Jul 4, 2021
7 tasks
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.
Type of PR:
Required reviews:
What this does:
Makes
nucypheruse the new Umbral API.umbral_adapter.pyis out in the top commit, although the intermediate commit with the adapter and the minimal changes is still present, for reference.Notable changes on on top of API adjustments:
scrypt-based key generation moved fromumbral(and fromconfig/keyring.py) tocrypto/passwords.py.Capsuleobjects are immutable, keys and cfrags are now accumulated inUmbralMessageKitobjects. Some functions called byBob.retrieve()were modified accordingly (see the changes inlawful.py).Bob._reencrypt()now has a bit of an awkward signature (takes an additionalmessage_kits_dict), which I propose to fix in a separate PR addressing the changes from Define format for re-encryption metadata #259 (and the whole data flow inretrieve())crypto/splitters.pyto use Umbral objects in larger splitters, instead of passing the types directlyecdsa_sign()andverify_ecdsa()removed fromcrypto/api.py(using Umbral'sSignerandSignaturefor that).test_umbral_deserializer.pyThe highperf tests were broken before (see #2715), and now they are probably broken even more - I tried to modify the mocks accordingly, but it's likely I forgot something. I think they should be dealt with separately.