From e5924f79be740e504d677b83358118471aaca0d2 Mon Sep 17 00:00:00 2001 From: tuxxy Date: Wed, 27 Jun 2018 15:23:28 -0600 Subject: [PATCH] Add simple __eq__ method for comparing two Curve objects --- tests/test_curve.py | 1 - umbral/curve.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_curve.py b/tests/test_curve.py index 3c8f68a..3694728 100644 --- a/tests/test_curve.py +++ b/tests/test_curve.py @@ -1,5 +1,4 @@ import pytest - from umbral.curve import Curve, SECP256R1, SECP256K1, SECP384R1 diff --git a/umbral/curve.py b/umbral/curve.py index 614fec6..cadabcd 100644 --- a/umbral/curve.py +++ b/umbral/curve.py @@ -33,6 +33,9 @@ class Curve: def supported_curves(self): return self.__AVAIL_CURVES + def __eq__(self, other): + return self.curve_nid == other.curve_nid + class SECP256R1(Curve): """