Sigurd Meldgaard <[EMAIL PROTECTED]> writes: > +def legendre_mod_p(a): > + """ > + Returns the legendre symbol legendre(a, p) where p is > + the order of the field of a. > + > + Precondition: p must be odd. > + > + Input: > + a -- a field element > + Output: > + int: -1 if a is not a square mod p, > + 0 if gcd(a,p) is not 1 > + 1 if a is a square mod p. > + > + Examples: > + >>> legendre(GF(5)(2)) > + -1 > + >>> legendre(GF(3)(3)) > + 0 > + >>> legendre(GF(2003)(7)) > + -1
You should make a file like test_shamir.py which makes Trial run the doctests as part of the normal test suite. It only has to contain: #: Declare doctests for Trial. __doctests__ = ['viff.equal'] -- Martin Geisler VIFF (Virtual Ideal Functionality Framework) brings easy and efficient SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/. _______________________________________________ viff-patches mailing list [email protected] http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk
