mirror of https://github.com/nucypher/pyUmbral.git
Have Capsule.get_size return an non-activated capsule size by default
parent
4efbe3ddc7
commit
12bcfe610e
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue