gdanezis / petlib

A python library that implements a number of Privacy Enhancing Technolgies
BSD 2-Clause "Simplified" License
130 stars 33 forks source link

Returning False in __eq__ if other type differs #26

Closed ravirahman closed 3 years ago

ravirahman commented 3 years ago

In __eq__(self, other) for Bn, EcGroup, and EcPt, the comparison raised an exception if other is not the proper type. Added short-circuiting logic to return False (instead of crashing) if the other type is incorrect. Updated test cases.

gdanezis commented 3 years ago

Nice one!