mirror of https://github.com/nucypher/pyUmbral.git
Touching up TODOs.
parent
c0782a2696
commit
0eef0c289c
|
@ -141,12 +141,10 @@ def test_capsule_serialization():
|
||||||
capsule_bytes = capsule.to_bytes()
|
capsule_bytes = capsule.to_bytes()
|
||||||
|
|
||||||
# A Capsule can be represented as the 98 total bytes of two Points (33 each) and a BigNum (32).
|
# 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
|
assert len(capsule_bytes) == 33 + 33 + 32 == 98
|
||||||
|
|
||||||
new_capsule = umbral.Capsule.from_bytes(capsule_bytes,
|
new_capsule = umbral.Capsule.from_bytes(capsule_bytes,
|
||||||
umbral.UmbralParameters().curve)
|
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()
|
assert new_capsule.original_components() == capsule.original_components()
|
||||||
|
|
||||||
def test_reconstructed_capsule_serialization():
|
def test_reconstructed_capsule_serialization():
|
||||||
|
@ -171,7 +169,6 @@ def test_reconstructed_capsule_serialization():
|
||||||
new_rec_capsule = umbral.Capsule.from_bytes(
|
new_rec_capsule = umbral.Capsule.from_bytes(
|
||||||
rec_capsule_bytes,
|
rec_capsule_bytes,
|
||||||
umbral.UmbralParameters().curve, is_reconstructed=True)
|
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_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_eph_v_prime == capsule._point_eph_v_prime
|
||||||
assert new_rec_capsule._point_noninteractive == capsule._point_noninteractive
|
assert new_rec_capsule._point_noninteractive == capsule._point_noninteractive
|
||||||
|
|
|
@ -188,7 +188,7 @@ class Capsule(object):
|
||||||
self.cfrags[cfrag.bn_kfrag_id] = cfrag
|
self.cfrags[cfrag.bn_kfrag_id] = cfrag
|
||||||
|
|
||||||
def open(self, pub_bob, priv_bob, pub_alice, force_reopen=False, pre=None):
|
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:
|
if self.contents and not force_reopen:
|
||||||
newly_opened = True
|
newly_opened = True
|
||||||
else:
|
else:
|
||||||
|
@ -341,7 +341,7 @@ class PRE(object):
|
||||||
return rk_shares, vKeys
|
return rk_shares, vKeys
|
||||||
|
|
||||||
def reencrypt(self, kFrag, capsule):
|
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"
|
assert capsule.verify(self.params), "Generic Umbral Error"
|
||||||
e1 = kFrag.bn_key * capsule._point_eph_e
|
e1 = kFrag.bn_key * capsule._point_eph_e
|
||||||
v1 = kFrag.bn_key * capsule._point_eph_v
|
v1 = kFrag.bn_key * capsule._point_eph_v
|
||||||
|
|
Loading…
Reference in New Issue