From 12bcfe610eaee2b408477574aadd3a0a8d9331c1 Mon Sep 17 00:00:00 2001 From: tuxxy Date: Wed, 23 May 2018 04:49:04 -0600 Subject: [PATCH] Have Capsule.get_size return an non-activated capsule size by default --- umbral/pre.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/umbral/pre.py b/umbral/pre.py index 35604ac..dfa1acf 100644 --- a/umbral/pre.py +++ b/umbral/pre.py @@ -63,7 +63,7 @@ class Capsule(object): self._attached_cfrags = list() @classmethod - def get_size(cls, curve: ec.EllipticCurve=None): + def get_size(cls, curve: ec.EllipticCurve=None, activated=False): """ Returns the size (in bytes) of a Capsule given the curve. If no curve is provided, it will use the default curve. @@ -72,7 +72,10 @@ class Capsule(object): bn_size = CurveBN.get_size(curve) point_size = Point.get_size(curve) - return (bn_size * 1) + (point_size * 2) + if not activated: + return (bn_size * 1) + (point_size * 2) + else: + return (bn_size * 1) + (point_size * 5) class NotValid(ValueError): """