14#define ENIGMA_ROTOR_COUNT 8
46 .fwd_indices = { 4, 10, 12, 5, 11, 6, 3, 16, 21, 25, 13, 19, 14,
47 22, 24, 7, 23, 20, 18, 15, 0, 8, 1, 17, 2, 9 },
48 .rev_indices = { 20, 22, 24, 6, 0, 3, 5, 15, 21, 25, 1, 4, 2,
49 10, 12, 19, 7, 23, 18, 11, 17, 8, 13, 16, 14, 9 },
62 .fwd_indices = { 0, 9, 3, 10, 18, 8, 17, 20, 23, 1, 11, 7, 22,
63 19, 12, 2, 16, 6, 25, 13, 15, 24, 5, 21, 14, 4 },
64 .rev_indices = { 0, 9, 15, 2, 25, 22, 17, 11, 5, 1, 3, 10, 14,
65 19, 24, 20, 16, 6, 4, 13, 7, 23, 12, 8, 21, 18 },
78 .fwd_indices = { 1, 3, 5, 7, 9, 11, 2, 15, 17, 19, 23, 21, 25,
79 13, 24, 4, 8, 22, 6, 0, 10, 12, 20, 18, 16, 14 },
80 .rev_indices = { 19, 0, 6, 1, 15, 2, 18, 3, 16, 4, 20, 5, 21,
81 13, 25, 7, 24, 8, 23, 9, 22, 11, 17, 10, 14, 12 },
94 .fwd_indices = { 4, 18, 14, 21, 15, 25, 9, 0, 24, 16, 20, 8, 17,
95 7, 23, 11, 13, 5, 19, 6, 10, 3, 2, 12, 22, 1 },
96 .rev_indices = { 7, 25, 22, 21, 0, 17, 19, 13, 11, 6, 20, 15, 23,
97 16, 2, 4, 9, 12, 1, 18, 10, 3, 24, 14, 8, 5 },
110 .fwd_indices = { 21, 25, 1, 17, 6, 8, 19, 24, 20, 15, 18, 3, 13,
111 7, 11, 23, 0, 22, 12, 9, 16, 14, 5, 4, 2, 10 },
112 .rev_indices = { 16, 2, 24, 11, 23, 22, 4, 13, 5, 19, 25, 14, 18,
113 12, 21, 9, 20, 3, 10, 6, 8, 0, 17, 15, 7, 1 },
126 .fwd_indices = { 9, 15, 6, 21, 14, 20, 12, 5, 24, 16, 1, 4, 13,
127 7, 25, 17, 3, 10, 0, 18, 23, 11, 8, 2, 19, 22 },
128 .rev_indices = { 18, 10, 23, 16, 11, 7, 2, 13, 22, 0, 17, 21, 6,
129 12, 4, 1, 9, 15, 19, 24, 5, 3, 25, 20, 8, 14 },
130 .notches = { 25, 12 },
142 .fwd_indices = { 13, 25, 9, 7, 6, 17, 2, 23, 12, 24, 18, 22, 1,
143 14, 20, 5, 0, 8, 21, 11, 15, 4, 10, 16, 3, 19 },
144 .rev_indices = { 16, 12, 6, 24, 21, 15, 4, 3, 17, 2, 22, 19, 8,
145 0, 13, 20, 23, 5, 10, 25, 14, 18, 11, 7, 9, 1 },
146 .notches = { 25, 12 },
158 .fwd_indices = { 5, 10, 16, 7, 19, 11, 23, 14, 2, 1, 9, 18, 15,
159 3, 25, 17, 0, 12, 4, 22, 13, 8, 20, 24, 6, 21 },
160 .rev_indices = { 16, 9, 8, 13, 18, 0, 24, 3, 21, 10, 1, 5, 17,
161 20, 7, 12, 2, 15, 11, 4, 22, 25, 19, 6, 23, 14 },
162 .notches = { 25, 12 },
172 = { &enigma_rotor_I, &enigma_rotor_II, &enigma_rotor_III, &enigma_rotor_IV,
173 &enigma_rotor_V, &enigma_rotor_VI, &enigma_rotor_VII, &enigma_rotor_VIII };
#define ENIGMA_ALPHA_SIZE
Defines the size of the alphabet used in the Enigma machine.
Definition: common.h:18
int enigma_rotor_set_fwd_indices(EnigmaRotor *, const int *)
Set the forward indices of the rotor.
Definition: rotor.c:148
int enigma_rotor_set_rev_indices(EnigmaRotor *, const int *)
Set the reverse indices of the rotor.
Definition: rotor.c:165
const int * enigma_rotor_get_rev_indices(const EnigmaRotor *)
Get the reverse indices of the rotor.
Definition: rotor.c:83
int enigma_rotor_set_notches_count(EnigmaRotor *, int)
Set the notches count of the rotor.
Definition: rotor.c:202
const int * enigma_rotor_get_fwd_indices(const EnigmaRotor *)
Get the forward indices of the rotor.
Definition: rotor.c:67
int enigma_rotor_generate_indices(EnigmaRotor *, const char *)
Generate the indices for the rotor.
Definition: rotor.c:23
int enigma_rotor_set_name(EnigmaRotor *, const char *)
Set the name of the rotor.
Definition: rotor.c:131
int enigma_rotor_set_notches(EnigmaRotor *, const int *, int)
Set the notches of the rotor.
Definition: rotor.c:184
const int * enigma_rotor_get_notches(const EnigmaRotor *)
Get the notches of the rotor.
Definition: rotor.c:99
const char * enigma_rotor_get_name(const EnigmaRotor *)
Get the name of the rotor.
Definition: rotor.c:51
int enigma_rotor_get_notches_count(const EnigmaRotor *)
Get the number of notches of the rotor.
Definition: rotor.c:115
Represents a rotor configuration for the Enigma machine.
Definition: rotor.h:23
const char * name
Name of the rotor.
Definition: rotor.h:24
int notches_count
Number of notches.
Definition: rotor.h:30