# HG changeset patch
# User Sigurd Meldgaard <[EMAIL PROTECTED]>
# Date 1221574088 -7200
# Node ID 3d1bfa3cb9e2b58a0e47a8fa11c36049762d5a1b
# Parent  6ef6574f9c963a635fd3a1e054c0bb849a272783
Added support for equality to the runtime

diff -r 6ef6574f9c96 -r 3d1bfa3cb9e2 viff/runtime.py
--- a/viff/runtime.py   Mon Sep 15 22:32:39 2008 +0200
+++ b/viff/runtime.py   Tue Sep 16 16:08:08 2008 +0200
@@ -131,6 +131,21 @@
         """Greater-than or equal comparison."""
         # self >= other
         return self.runtime.greater_than_equal(self, other)
+
+    def __eq__(self, other):
+        """
+        Equality testing
+        returns a share of 1 if self == other mod p
+        0 otherwise
+        """
+        return self.runtime.equal(self,other)
+
+    def __neq__(self, other):
+        """
+        Negated equality testing
+        """
+        return 1 - self.runtime.equal(self,other)
+
 
     def clone(self):
         """Clone a share.
_______________________________________________
viff-patches mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk

Reply via email to