Skip to content

Commit

Permalink
Adapt verify_kfrag to simplified API (I missed this in the main commit)
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Jun 5, 2018
1 parent d34fd6e commit fa4375d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 10 additions & 3 deletions umbral/_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,21 @@ def assess_cfrag_correctness(cfrag, capsule: "Capsule"):


def verify_kfrag(kfrag,
delegating_point,
delegating_pubkey: UmbralPublicKey,
signing_pubkey,
receiving_point,
params: UmbralParameters
receiving_pubkey: UmbralPublicKey
):


params = delegating_pubkey.params
if not params == receiving_pubkey.params:
raise ValueError("The delegating and receiving keys must use the same UmbralParameters")

u = params.u

delegating_point = delegating_pubkey.point_key
receiving_point = receiving_pubkey.point_key

id = kfrag._id
key = kfrag._bn_key
u1 = kfrag._point_commitment
Expand Down
8 changes: 1 addition & 7 deletions umbral/fragments.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ def verify(self,
delegating_pubkey: UmbralPublicKey,
receiving_pubkey: UmbralPublicKey):

params = delegating_pubkey.params

return verify_kfrag(self,
delegating_pubkey.point_key,
signing_pubkey,
receiving_pubkey.point_key,
params)
return verify_kfrag(self, delegating_pubkey, signing_pubkey, receiving_pubkey)

def __bytes__(self):
return self.to_bytes()
Expand Down

0 comments on commit fa4375d

Please sign in to comment.