http://hg.viff.dk/viff/rev/e5bb773fb1fe
changeset: 1095:e5bb773fb1fe
user:      Marcel Keller <[email protected]>
date:      Fri Jan 30 12:33:30 2009 +0100
summary:   Integrated and improved documentation of the AES module.

diffstat:

3 files changed, 20 insertions(+), 1 deletion(-)
doc/aes.txt            |    6 ++++++
doc/implementation.txt |    1 +
viff/aes.py            |   14 +++++++++++++-

diffs (49 lines):

diff -r bdab6f30511a -r e5bb773fb1fe doc/aes.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/aes.txt       Fri Jan 30 12:33:30 2009 +0100
@@ -0,0 +1,6 @@
+
+AES Module
+==========
+
+.. automodule:: viff.aes
+   :members:
diff -r bdab6f30511a -r e5bb773fb1fe doc/implementation.txt
--- a/doc/implementation.txt    Thu Jan 29 16:19:49 2009 +0100
+++ b/doc/implementation.txt    Fri Jan 30 12:33:30 2009 +0100
@@ -18,3 +18,4 @@
    comparison
    prss
    config
+   aes
diff -r bdab6f30511a -r e5bb773fb1fe viff/aes.py
--- a/viff/aes.py       Thu Jan 29 16:19:49 2009 +0100
+++ b/viff/aes.py       Fri Jan 30 12:33:30 2009 +0100
@@ -58,6 +58,18 @@
 
 
 class AES:
+    """AES instantiation:
+
+    >>> aes = AES(runtime, 192)
+    >>> cleartext = [Share(runtime, GF256, GF256(0)) for i in range(128/8)]
+    >>> key = [runtime.prss_share_random(GF256) for i in range(192/8)]
+    >>> ciphertext = aes.encrypt("abcdefghijklmnop", key)
+    >>> ciphertext = aes.encrypt(cleartext, "keykeykeykeykeykeykeykey")
+    >>> ciphertext = aes.encrypt(cleartext, key)
+
+    In every case *ciphertext* will be a list of shares over GF256.
+    """
+
     def __init__(self, runtime, key_size, block_size=128, 
                  use_exponentiation=False):
         """Initialize Rijndael.
@@ -158,7 +170,7 @@
                                     [bits[j] * 2**j for j in range(len(bits))])
 
     def shift_row(self, state):
-        """AES ShiftRow.
+        """Rijndael ShiftRow.
 
         State should be a list of 4 rows."""
 
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk

Reply via email to