changeset 858:2d2c641a2762

Tests for the new prss_share_zero method.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 30 Jul 2008 22:13:11 +0200
parents f89875736767
children 885a17b767ef
files viff/test/test_runtime_prss.py
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/viff/test/test_runtime_prss.py	Wed Jul 30 22:12:45 2008 +0200
+++ b/viff/test/test_runtime_prss.py	Wed Jul 30 22:13:11 2008 +0200
@@ -116,6 +116,26 @@
         return opened_a
 
     @protocol
+    def test_prss_share_zero_bit(self, runtime):
+        """Tests the sharing of a zero GF256 element using PRSS."""
+        a = runtime.prss_share_zero(GF256)
+        self.assert_type(a, Share)
+
+        opened_a = runtime.open(a, threshold=2*runtime.threshold)
+        opened_a.addCallback(self.assertEquals, GF256(0))
+        return opened_a
+
+    @protocol
+    def test_prss_share_zero_int(self, runtime):
+        """Tests the sharing of a zero Zp element using PRSS."""
+        a = runtime.prss_share_zero(self.Zp)
+        self.assert_type(a, Share)
+
+        opened_a = runtime.open(a, threshold=2*runtime.threshold)
+        opened_a.addCallback(self.assertEquals, self.Zp(0))
+        return opened_a
+
+    @protocol
     def test_prss_share_bit_double(self, runtime):
         """Tests sharing a bit over Zp and GF256."""
         bit_p, bit_b = runtime.prss_share_bit_double(self.Zp)