viff

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 diff
     1.1 --- a/viff/test/test_runtime_prss.py	Wed Jul 30 22:12:45 2008 +0200
     1.2 +++ b/viff/test/test_runtime_prss.py	Wed Jul 30 22:13:11 2008 +0200
     1.3 @@ -116,6 +116,26 @@
     1.4          return opened_a
     1.5  
     1.6      @protocol
     1.7 +    def test_prss_share_zero_bit(self, runtime):
     1.8 +        """Tests the sharing of a zero GF256 element using PRSS."""
     1.9 +        a = runtime.prss_share_zero(GF256)
    1.10 +        self.assert_type(a, Share)
    1.11 +
    1.12 +        opened_a = runtime.open(a, threshold=2*runtime.threshold)
    1.13 +        opened_a.addCallback(self.assertEquals, GF256(0))
    1.14 +        return opened_a
    1.15 +
    1.16 +    @protocol
    1.17 +    def test_prss_share_zero_int(self, runtime):
    1.18 +        """Tests the sharing of a zero Zp element using PRSS."""
    1.19 +        a = runtime.prss_share_zero(self.Zp)
    1.20 +        self.assert_type(a, Share)
    1.21 +
    1.22 +        opened_a = runtime.open(a, threshold=2*runtime.threshold)
    1.23 +        opened_a.addCallback(self.assertEquals, self.Zp(0))
    1.24 +        return opened_a
    1.25 +
    1.26 +    @protocol
    1.27      def test_prss_share_bit_double(self, runtime):
    1.28          """Tests sharing a bit over Zp and GF256."""
    1.29          bit_p, bit_b = runtime.prss_share_bit_double(self.Zp)