Removed random from test imports. Also some linting.

pull/40/head
jMyles 2018-01-28 10:28:31 -08:00
parent 68c9c27bbb
commit 3311bb6b8e
1 changed files with 7 additions and 10 deletions

View File

@ -1,14 +1,12 @@
import pytest
from umbral import umbral, keys
import random
# (N,threshold)
from umbral.umbral import Capsule
from umbral.point import Point
from umbral.bignum import BigNum
from umbral.point import Point
from umbral.umbral import Capsule
parameters = [
# (N,threshold)
(1, 1),
(6, 1),
(6, 4),
@ -84,7 +82,6 @@ def test_m_of_n(N, threshold):
priv_bob = pre.gen_priv()
pub_bob = pre.priv2pub(priv_bob)
sym_key, capsule = pre._encapsulate(pub_alice)
kfrags, vkeys = pre.split_rekey(priv_alice, pub_bob, threshold, N)
@ -101,7 +98,6 @@ def test_m_of_n(N, threshold):
# assert capsule.is_openable_by_bob() # TODO: Is it possible to check here if >= m cFrags have been attached?
capsule.open(pub_bob, priv_bob, pub_alice)
sym_key_2 = pre._decapsulate_reencrypted(pub_bob, priv_bob, pub_alice, capsule)
assert sym_key == capsule.contents
@ -167,6 +163,7 @@ def test_capsule_serialization():
umbral.UmbralParameters().curve)
assert new_capsule.original_components() == capsule.original_components()
def test_reconstructed_capsule_serialization():
pre = umbral.PRE(umbral.UmbralParameters())