Fsr component¶
- class FSR(current_round_number, current_round_number_of_components, input_id_links, input_bit_positions, output_bit_size, description)¶
Bases:
Component- algebraic_polynomials(model)¶
Return a list of polynomials for the feedback shift registers.
INPUT:
model– model object; a model instance
EXAMPLES:
sage: from claasp.ciphers.stream_ciphers.a5_1_stream_cipher import A51StreamCipher sage: from claasp.cipher_modules.models.algebraic.algebraic_model import AlgebraicModel sage: a51 = A51StreamCipher() sage: fsr_component = a51.get_component_from_id("fsr_1_0") sage: algebraic = AlgebraicModel(a51) sage: A = fsr_component.algebraic_polynomials(algebraic) sage: A[0] fsr_1_0_x1*fsr_1_0_x30*fsr_1_0_x53 + fsr_1_0_x1*fsr_1_0_x10*fsr_1_0_x53 + fsr_1_0_x1*fsr_1_0_x10*fsr_1_0_x30 + fsr_1_0_x0*fsr_1_0_x30*fsr_1_0_x53 + fsr_1_0_x0*fsr_1_0_x10*fsr_1_0_x53 + fsr_1_0_x0*fsr_1_0_x10*fsr_1_0_x30 + fsr_1_0_x1*fsr_1_0_x10 + fsr_1_0_x0*fsr_1_0_x10 + fsr_1_0_y0 + fsr_1_0_x1 sage: from claasp.ciphers.stream_ciphers.bivium_stream_cipher import BiviumStreamCipher sage: from claasp.cipher_modules.models.algebraic.algebraic_model import AlgebraicModel sage: bivium = BiviumStreamCipher(number_of_initialization_clocks=1, keystream_bit_len=1) sage: fsr_component = bivium.get_component_from_id("fsr_0_1") sage: algebraic = AlgebraicModel(bivium) sage: B = fsr_component.algebraic_polynomials(algebraic) sage: B[92] fsr_0_1_x94*fsr_0_1_x95 + fsr_0_1_y92 + fsr_0_1_x108 + fsr_0_1_x93 + fsr_0_1_x24 sage: from claasp.ciphers.stream_ciphers.trivium_stream_cipher import TriviumStreamCipher sage: from claasp.cipher_modules.models.algebraic.algebraic_model import AlgebraicModel sage: trivium = TriviumStreamCipher(number_of_initialization_clocks=1, keystream_bit_len=1) sage: fsr_component = trivium.get_component_from_id("fsr_0_2") sage: algebraic = AlgebraicModel(trivium) sage: T = fsr_component.algebraic_polynomials(algebraic) sage: T[92] fsr_0_2_x178*fsr_0_2_x179 + fsr_0_2_y92 + fsr_0_2_x222 + fsr_0_2_x177 + fsr_0_2_x24 sage: from claasp.ciphers.stream_ciphers.bluetooth_stream_cipher_e0 import BluetoothStreamCipherE0 sage: from claasp.cipher_modules.models.algebraic.algebraic_model import AlgebraicModel sage: e0 = BluetoothStreamCipherE0(keystream_bit_len=1) sage: fsr_component = e0.get_component_from_id("fsr_0_16") sage: algebraic = AlgebraicModel(e0) sage: E = fsr_component.algebraic_polynomials(algebraic) sage: E[24] fsr_0_16_y24 + fsr_0_16_x17 + fsr_0_16_x13 + fsr_0_16_x5 + fsr_0_16_x0 sage: from claasp.ciphers.stream_ciphers.snow3g_stream_cipher import Snow3GStreamCipher sage: from claasp.cipher_modules.models.algebraic.algebraic_model import AlgebraicModel sage: snow = Snow3GStreamCipher(number_of_initialization_clocks=1, keystream_word_size=1) sage: fsr_component = snow.get_component_from_id("fsr_0_714") sage: algebraic = AlgebraicModel(snow) sage: S = fsr_component.algebraic_polynomials(algebraic) sage: S[480] fsr_0_714_y480 + fsr_0_714_x352 + fsr_0_714_x64 + fsr_0_714_x0
- as_python_dictionary()¶
- check_output_size(available_word_sizes, fixed, word_size)¶
- property description¶
- get_graph_representation()¶
- property id¶
- property input_bit_positions¶
- property input_bit_size¶
- property input_id_links¶
- is_forbidden(forbidden_types, forbidden_descriptions)¶
- is_id_equal_to(component_id)¶
- is_power_of_2_word_based(dto)¶
- property output_bit_size¶
- output_size_for_concatenate(available_word_sizes, fixed, word_size)¶
- print()¶
- print_as_python_dictionary()¶
- print_values(code)¶
- print_word_values(code)¶
- select_bits(code)¶
- select_words(code, word_size, input=True)¶
- set_description(description)¶
- set_id(id_string)¶
- set_input_bit_positions(bit_positions)¶
- set_input_id_links(input_id_links)¶
- property suffixes¶
- property type¶