http://hg.viff.dk/viff/rev/24d0ffe14c3a
changeset: 1110:24d0ffe14c3a
user:      Tord Reistad <[email protected]>
date:      Thu Mar 05 21:17:10 2009 +0100
summary:   Make split return FieldElements instead of integers.

diffstat:

1 file changed, 4 insertions(+), 4 deletions(-)
viff/field.py |    8 ++++----

diffs (25 lines):

diff -r 730c30c4d788 -r 24d0ffe14c3a viff/field.py
--- a/viff/field.py     Thu Mar 05 13:46:19 2009 +0100
+++ b/viff/field.py     Thu Mar 05 21:17:10 2009 +0100
@@ -90,17 +90,17 @@
 
         >>> Zp = GF(29)
         >>> Zp(3).split()
-        [1, 1, 0, 0, 0]
+        [{1}, {1}, {0}, {0}, {0}]
         >>> Zp(28).split()
-        [0, 0, 1, 1, 1]
+        [{0}, {0}, {1}, {1}, {1}]
         >>> GF256(8).split()
-        [0, 0, 0, 1, 0, 0, 0, 0]
+        [[0], [0], [0], [1], [0], [0], [0], [0]]
         """
         length = int(ceil(log(self.modulus,2)))
         result = [0] * length
         temp = self.value
         for i in range(length):
-            result[i] = temp % 2
+            result[i] = self.field(temp % 2)
             temp = temp // 2
         return result
 
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk

Reply via email to