Thanks for the comments.
On 28/04/2009, at 16.20, Martin Geisler wrote:
Janus Dam Nielsen <[email protected]> writes:
# HG changeset patch
# User Janus Dam Nielsen <[email protected]>
# Date 1240830411 -7200
# Node ID 4397d64715c625445b0170daf5dfed39ac769219
# Parent bdc53480bc8ce7d8074a11d157e74c77c773b9a7
Added methods to GF fields for getting the values represented as
signed and unsigned integers.
Please structure the commit messages like this:
One terse line less than 70 characters in length.
If needed you can put a larger description here in word-wrapped
paragraphs like this one. They wont be shown in 'hg log' unless you
use the -v flag.
I will try and remember that.
def __eq__(self, other):
"""Equality test."""
diff --git a/viff/test/test_signed_field.py b/viff/test/
test_signed_field.py
new file mode 100644
--- /dev/null
+++ b/viff/test/test_signed_field.py
@@ -0,0 +1,91 @@
+#!/usr/bin/python
+# -*- coding: utf-8
+#
+# Copyright 2009 (c) Partisia Market Design.
+#
+# Author: Janus Dam Nielsen
+# Review: need review
+#
This wont fly -- please put in a standard file header with the LGPL
license. Otherwise we cannot distribute the file as part of VIFF.
Right, copied the header from the wrong file, I'll fix that.
+
+# Import system packages.
+import sys
+
+# Import VIFF packages.
+from viff.field import GF
+from viff.comparison import Toft05Runtime
+from viff.test.util import RuntimeTestCase, protocol
+
+p = 30916444023318367583
+Zp = GF(p)
+
+class SignedVsUnsignedTest(RuntimeTestCase):
You don't need the runtime arguments below -- it will just make things
slower. Instead you should make this a normal unit test. Look in
test_field.py for an example -- you should just expand the unit tests
there, add the new ones in a class if you like.
You are right, thanks.
--
Janus Dam Nielsen
R&D Scientist
Alexandra Instituttet
[email protected]
_______________________________________________
viff-patches mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk