aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/utils.py b/tests/utils.py
index ca3245b0..7e79830b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -7,7 +7,6 @@ from __future__ import absolute_import, division, print_function
import binascii
import collections
import json
-import math
import os
import re
from contextlib import contextmanager
@@ -744,15 +743,15 @@ def load_x963_vectors(vector_data):
vector["key_data_length"] = key_data_len
elif line.startswith("Z"):
vector["Z"] = line.split("=")[1].strip()
- assert math.ceil(shared_secret_len / 8) * 2 == len(vector["Z"])
+ assert ((shared_secret_len + 7) // 8) * 2 == len(vector["Z"])
elif line.startswith("SharedInfo"):
if shared_info_len != 0:
vector["sharedinfo"] = line.split("=")[1].strip()
silen = len(vector["sharedinfo"])
- assert math.ceil(shared_info_len / 8) * 2 == silen
+ assert ((shared_info_len + 7) // 8) * 2 == silen
elif line.startswith("key_data"):
vector["key_data"] = line.split("=")[1].strip()
- assert math.ceil(key_data_len / 8) * 2 == len(vector["key_data"])
+ assert ((key_data_len + 7) // 8) * 2 == len(vector["key_data"])
vectors.append(vector)
vector = {}