viff

changeset 1098:54a68af0a945

Fixed code example mistakenly marked as a doctest.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 04 Feb 2009 23:06:07 +0100
parents 50056a810951
children cc706ddd9376
files viff/aes.py
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/viff/aes.py	Fri Jan 30 14:50:47 2009 +0100
     1.2 +++ b/viff/aes.py	Wed Feb 04 23:06:07 2009 +0100
     1.3 @@ -58,14 +58,17 @@
     1.4  
     1.5  
     1.6  class AES:
     1.7 -    """AES instantiation:
     1.8 +    """AES instantiation.
     1.9  
    1.10 -    >>> aes = AES(runtime, 192)
    1.11 -    >>> cleartext = [Share(runtime, GF256, GF256(0)) for i in range(128/8)]
    1.12 -    >>> key = [runtime.prss_share_random(GF256) for i in range(192/8)]
    1.13 -    >>> ciphertext = aes.encrypt("abcdefghijklmnop", key)
    1.14 -    >>> ciphertext = aes.encrypt(cleartext, "keykeykeykeykeykeykeykey")
    1.15 -    >>> ciphertext = aes.encrypt(cleartext, key)
    1.16 +    This class is used together with a :class:`viff.runtime.Runtime`
    1.17 +    object::
    1.18 +
    1.19 +        aes = AES(runtime, 192)
    1.20 +        cleartext = [Share(runtime, GF256, GF256(0)) for i in range(128/8)]
    1.21 +        key = [runtime.prss_share_random(GF256) for i in range(192/8)]
    1.22 +        ciphertext = aes.encrypt("abcdefghijklmnop", key)
    1.23 +        ciphertext = aes.encrypt(cleartext, "keykeykeykeykeykeykeykey")
    1.24 +        ciphertext = aes.encrypt(cleartext, key)
    1.25  
    1.26      In every case *ciphertext* will be a list of shares over GF256.
    1.27      """