Rounds

class Rounds

Bases: object

add_component(component)
add_round()
are_there_not_forbidden_components(forbidden_types, forbidden_descriptions)
component_from(round_number, position)

Use this function to get a certain component from a certain round.

INPUT:

  • round_numberinteger; the round number of the component

  • positioninteger; position of the component in a round

EXAMPLES:

sage: from claasp.rounds import Rounds
sage: from claasp.component import Component
sage: from claasp.input import Input
sage: rounds = Rounds()
sage: rounds.add_round()
sage: component_input = Input(4, ["input","input"], [[0,1],[2,3]])
sage: xor_0_0 = Component("xor_0_0", "xor", component_input, 2, "xor_0_0")
sage: xor_0_1 = Component("xor_0_1", "xor", component_input, 2, "xor_0_1")
sage: rounds.add_component(xor_0_0)
sage: rounds.add_component(xor_0_1)
sage: rounds.add_round()
sage: xor_1_0 = Component("xor_1_0", "xor", component_input, 2, "xor_1_0")
sage: xor_1_1 = Component("xor_1_1", "xor", component_input, 2, "xor_1_1")
sage: rounds.add_component(xor_1_0)
sage: rounds.add_component(xor_1_1)
sage: component_0_0 = rounds.component_from(0, 0)
sage: component_0_0.print()
    id = xor_0_0
    type = xor
    input_bit_size = 4
    input_id_link = ['input', 'input']
    input_bit_positions = [[0, 1], [2, 3]]
    output_bit_size = 2
    description = xor_0_0
sage: component_1_0 = rounds.component_from(1, 0)
sage: component_1_0.print()
    id = xor_1_0
    type = xor
    input_bit_size = 4
    input_id_link = ['input', 'input']
    input_bit_positions = [[0, 1], [2, 3]]
    output_bit_size = 2
    description = xor_1_0
components_in_round(round_number)
property current_round
property current_round_number
property current_round_number_of_components
get_all_components()
get_all_components_ids()
get_component_from_id(component_id)
get_round_from_component_id(component_id)
is_power_of_2_word_based()
number_of_components(round_number)
property number_of_rounds
print_rounds()
print_rounds_as_python_dictionary()
remove_round_component(round_number, component)
remove_round_component_from_id(round_number, component_id)
round_at(round_number)
property rounds
rounds_as_python_dictionary()