Touching up TODOs.

pull/40/head
jMyles 2018-01-26 21:48:00 -08:00
parent c0782a2696
commit 0eef0c289c
2 changed files with 2 additions and 5 deletions

View File

@ -141,12 +141,10 @@ def test_capsule_serialization():
capsule_bytes = capsule.to_bytes()
# A Capsule can be represented as the 98 total bytes of two Points (33 each) and a BigNum (32).
# TODO: Do we want to include the cfrags as well? See #20.
assert len(capsule_bytes) == 33 + 33 + 32 == 98
new_capsule = umbral.Capsule.from_bytes(capsule_bytes,
umbral.UmbralParameters().curve)
# TODO: Have method that gives us these attributes instead of needing to access them directly.
assert new_capsule.original_components() == capsule.original_components()
def test_reconstructed_capsule_serialization():
@ -171,7 +169,6 @@ def test_reconstructed_capsule_serialization():
new_rec_capsule = umbral.Capsule.from_bytes(
rec_capsule_bytes,
umbral.UmbralParameters().curve, is_reconstructed=True)
# TODO: Have method that gives us these attributes instead of needing to access them directly.
assert new_rec_capsule._point_eph_e_prime == capsule._point_eph_e_prime
assert new_rec_capsule._point_eph_v_prime == capsule._point_eph_v_prime
assert new_rec_capsule._point_noninteractive == capsule._point_noninteractive

View File

@ -188,7 +188,7 @@ class Capsule(object):
self.cfrags[cfrag.bn_kfrag_id] = cfrag
def open(self, pub_bob, priv_bob, pub_alice, force_reopen=False, pre=None):
# TODO: Raise an error here if Bob has gathered enough cFrags.
# TODO: Raise an error here if Bob has gathered enough cFrags? See #22.
if self.contents and not force_reopen:
newly_opened = True
else:
@ -341,7 +341,7 @@ class PRE(object):
return rk_shares, vKeys
def reencrypt(self, kFrag, capsule):
# TODO: Put the assert at the end, but exponentiate by a randon number when false?
# TODO: Put the assert at the end, but exponentiate by a randon number when false? See #39.
assert capsule.verify(self.params), "Generic Umbral Error"
e1 = kFrag.bn_key * capsule._point_eph_e
v1 = kFrag.bn_key * capsule._point_eph_v