cascada.primitives.rectangle module

RECTANGLE cipher.

class cascada.primitives.rectangle.SboxLut(**kwargs)[source]

Bases: cascada.bitvector.secondaryop.LutOperation

The 4-bit S-box of RECTANGLE.

linear_model

alias of cascada.linear.opmodel.get_wdt_model.<locals>.MyWDTModel

xor_model

alias of cascada.differential.opmodel.get_wdt_model.<locals>.MyWDTModel

cascada.primitives.rectangle.transpose(list_bv)[source]

Transpose a list of bit-vectors.

Given a list x of bit-vectors, return another list of bit-vectors y such as the bit-matrix representation of y is the transpose of that of x (x[i][j] == y[j][i]).

class cascada.primitives.rectangle.RECTANGLEEncryption(*args, **options)[source]

Bases: cascada.primitives.blockcipher.Encryption, cascada.bitvector.ssa.RoundBasedFunction

RECTANGLE encryption function.

classmethod set_num_rounds(new_num_rounds)[source]

Set RoundBasedFunction.num_rounds and update input_widths and output_widths if necessary.

classmethod eval(*x)[source]

Evaluate the function (internal method).

class cascada.primitives.rectangle.RECTANGLE80KeySchedule(*args, **options)[source]

Bases: cascada.bitvector.ssa.RoundBasedFunction

RECTANGLE-80 key schedule function.

classmethod set_num_rounds(new_num_rounds)[source]

Set RoundBasedFunction.num_rounds and update input_widths and output_widths if necessary.

classmethod eval(*master_key)[source]

Evaluate the function (internal method).

class cascada.primitives.rectangle.RECTANGLE128KeySchedule(*args, **options)[source]

Bases: cascada.bitvector.ssa.RoundBasedFunction

RECTANGLE-128 key schedule function.

classmethod set_num_rounds(new_num_rounds)[source]

Set RoundBasedFunction.num_rounds and update input_widths and output_widths if necessary.

classmethod eval(*master_key)[source]

Evaluate the function (internal method).

class cascada.primitives.rectangle.RECTANGLE80Cipher(plaintext, masterkey, **options)[source]

Bases: cascada.primitives.blockcipher.Cipher

RECTANGLE-80 cipher.

key_schedule

alias of cascada.primitives.rectangle.RECTANGLE80KeySchedule

encryption

alias of cascada.primitives.rectangle.RECTANGLEEncryption

classmethod set_num_rounds(new_num_rounds)[source]

Call RoundBasedFunction.set_num_rounds of key_schedule and encryption (if iterated).

classmethod test()[source]

Test RECTANGLE-80 test vectors.

class cascada.primitives.rectangle.RECTANGLE128Cipher(plaintext, masterkey, **options)[source]

Bases: cascada.primitives.blockcipher.Cipher

RECTANGLE-128 cipher.

key_schedule

alias of cascada.primitives.rectangle.RECTANGLE128KeySchedule

encryption

alias of cascada.primitives.rectangle.RECTANGLEEncryption

classmethod set_num_rounds(new_num_rounds)[source]

Call RoundBasedFunction.set_num_rounds of key_schedule and encryption (if iterated).

classmethod test()[source]

Test RECTANGLE-128 test vectors.