viff

changeset 764:6377495664f8

Test case for prss_shamir_share_bit_double.
author Martin Geisler <mg@daimi.au.dk>
date Tue, 20 May 2008 12:53:57 +0200
parents 216660f40d01
children 563bcc37fe47
files viff/test/test_runtime_prss.py
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/viff/test/test_runtime_prss.py	Tue May 20 12:53:22 2008 +0200
     1.2 +++ b/viff/test/test_runtime_prss.py	Tue May 20 12:53:57 2008 +0200
     1.3 @@ -128,3 +128,17 @@
     1.4          result = gather_shares([runtime.open(bit_p), runtime.open(bit_b)])
     1.5          result.addCallback(lambda (a, b): self.assertEquals(a.value, b.value))
     1.6          return result
     1.7 +
     1.8 +    @protocol
     1.9 +    def test_prss_shamir_share_bit_double(self, runtime):
    1.10 +        """Tests Shamir sharing a bit over Zp and GF256."""
    1.11 +        bit_p, bit_b = runtime.prss_shamir_share_bit_double(self.Zp)
    1.12 +
    1.13 +        self.assert_type(bit_p, Share)
    1.14 +        self.assertEquals(bit_p.field, self.Zp)
    1.15 +        self.assert_type(bit_b, Share)
    1.16 +        self.assertEquals(bit_b.field, GF256)
    1.17 +
    1.18 +        result = gather_shares([runtime.open(bit_p), runtime.open(bit_b)])
    1.19 +        result.addCallback(lambda (a, b): self.assertEquals(a.value, b.value))
    1.20 +        return result