| Home | Trees | Indices | Help |
|
|---|
|
|
AES instantiation.
This class is used together with a viff.runtime.Runtime object:
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.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
exponentiation_variants =
|
|||
A = Matrix([[1, 0, 0, 0, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 1, 1,
|
|||
C = Matrix(C)
|
|||
i = 3
|
|||
row =
|
|||
|
|||
Initialize Rijndael. AES(runtime, key_size, block_size), whereas key size and block size must be given in bits. Block size defaults to 128. |
ByteSub operation of Rijndael. The first argument should be a matrix consisting of elements of GF(2^8). |
Rijndael ShiftRow. State should be a list of 4 rows. |
Rijndael MixColumn. Input should be a list of 4 rows. |
Rijndael AddRoundKey. State should be a list of 4 rows and round_key a list of 4-byte columns (words). |
Rijndael key expansion. Input and output are lists of 4-byte columns (words). new_length is the round for which the key should be expanded. If ommitted, the key is expanded for all rounds. |
Rijndael encryption. Cleartext and key should be either a string or a list of bytes (possibly shared as elements of GF256). |
|
|||
exponentiation_variants
|
A
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 19 16:43:38 2009 | http://epydoc.sourceforge.net |