From 92ec0f2a8cdb51e84884eb9a1f057b00473a25b0 Mon Sep 17 00:00:00 2001 From: tuxxy Date: Tue, 24 Apr 2018 16:52:09 -0600 Subject: [PATCH] Use better method for determining keysize in bytes (thanks @cygnusv) --- umbral/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/umbral/utils.py b/umbral/utils.py index 71e10ec..c132e65 100644 --- a/umbral/utils.py +++ b/umbral/utils.py @@ -41,6 +41,4 @@ def kdf(ecpoint, key_length): def get_curve_keysize_bytes(curve): - # We use the ceil operation to fit all bytes on curve sizes where eight is - # not evenly divisible. - return int(math.ceil(curve.key_size / 8.00)) + return (curve.key_size + 7) // 8