viff

changeset 860:b6ae408a0b4f

Test of prss_double_share.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 30 Jul 2008 22:45:42 +0200
parents 885a17b767ef
children f0aa454c9b91
files viff/test/test_runtime_prss.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/viff/test/test_runtime_prss.py	Wed Jul 30 22:45:19 2008 +0200
     1.2 +++ b/viff/test/test_runtime_prss.py	Wed Jul 30 22:45:42 2008 +0200
     1.3 @@ -136,6 +136,21 @@
     1.4          return opened_a
     1.5  
     1.6      @protocol
     1.7 +    def test_prss_double_share(self, runtime):
     1.8 +        """Test double-sharing of random numbers using PRSS."""
     1.9 +        r_t, r_2t = runtime.prss_double_share(self.Zp)
    1.10 +
    1.11 +        self.assert_type(r_t, Share)
    1.12 +        self.assertEquals(r_t.field, self.Zp)
    1.13 +        self.assert_type(r_2t, Share)
    1.14 +        self.assertEquals(r_2t.field, self.Zp)
    1.15 +
    1.16 +        result = gather_shares([runtime.open(r_t),
    1.17 +                                runtime.open(r_2t, threshold=2 * runtime.threshold)])
    1.18 +        result.addCallback(lambda (a, b): self.assertEquals(a, b))
    1.19 +        return result
    1.20 +
    1.21 +    @protocol
    1.22      def test_prss_share_bit_double(self, runtime):
    1.23          """Tests sharing a bit over Zp and GF256."""
    1.24          bit_p, bit_b = runtime.prss_share_bit_double(self.Zp)