From e651b66f9fd2b573ffcaeb910b571b70467fb83d Mon Sep 17 00:00:00 2001 From: jMyles Date: Wed, 3 Jan 2018 12:47:15 -0500 Subject: [PATCH] Type hints for decapsulate. --- umbral/umbral.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/umbral/umbral.py b/umbral/umbral.py index 22c34bd..4b8234b 100644 --- a/umbral/umbral.py +++ b/umbral/umbral.py @@ -284,7 +284,8 @@ class PRE(object): else: # if len(reencrypted_keys) == 1: return ReconstructedCapsule(e_prime=cFrag_0.e1, v_prime=cFrag_0.v1, x=cFrag_0.x) - def decapsulate_reencrypted(self, pub_key, priv_key, capsule, orig_pk, orig_ciphertext, key_length=32): + def decapsulate_reencrypted(self, pub_key: Point, priv_key: BigNum, capsule, orig_pub_key: Point, + orig_ciphertext: Capsule, key_length=32): """Derive the same symmetric key""" xcomp = capsule.x @@ -301,6 +302,6 @@ class PRE(object): s = orig_ciphertext.bn_sig h = self.hash_to_bn([e, v]) inv_d = ~d - assert orig_pk * (s * inv_d) == v_prime + (e_prime * h), "Generic Umbral Error" + assert orig_pub_key * (s * inv_d) == v_prime + (e_prime * h), "Generic Umbral Error" return key