## 5 EMD-Resilient Reed-Solomon Codes
### Single Symbol Inversion  
In mathematical terms, the minimum Hamming distance among valid code words is \(n-k+1\), thus inverting any number of bits less than or equal to the minimum Hamming distance in all code words cannot generate a valid one. However, it would break the repetitiveness in code words with one-symbol-value. Furthermore, it guarantees that valid multi-symbol-value code words never turn into one-symbol-value code words. As a result, the initial generated dictionary by primitive RS Codes, which contains one-symbol-value code words, is no longer valid at the inversion layer, and receiving any code word from that dictionary at the consumer side is not valid anymore. Hence, by checking this condition at the consumer side, it is possible to detect CTP and CFN. Accordingly, in our proposed algorithm, one symbol of a code word is required to obtain an inverted one. Note that inverting one symbol does not violate the mentioned criteria (i.e., \(m\leq n-k+1\)) since the size of one symbol (i.e., \(m\)) is always less than the minimum Hamming distance (i.e., \(n-k+1\)). An overview of the Single Symbol Inversion (SSI) mechanism is provided in Equation (8).  
\[SSI\ [D_{1},\cdots,D_{i},P_{1},P_{2},\cdots,P_{j}]=[D_{1},\cdots,D_{i},\overline{ P_{1}},P_{2},\cdots,P_{j}], \tag{8}\]  
As indicated in Equation (8), the first symbol of the parity (\(P_{1}\)) is inverted in this paper. However, it should be noted that any symbol locations can be considered for the inversion as the sole purpose of this mechanism is to break the repetitive nature of code word's symbols, and the difference in the final outcomes would not be significant.  
In the case that the mentioned condition is not encountered, the applied changes should be reverted, followed by transmitting the code word to the RS Codes' decoder. The block diagram of the proposed approach is shown in Figure 8.  
As can be seen, instead of using two layers in the communication channel, three layers are used to overcome the mentioned vulnerability. The SSI encoder at Layer 2 is responsible for applying the inversion to break the repetitiveness in the generated code words by RS Codes encoder at layer 3 and generates a new dictionary. In this new dictionary, one-symbol-value code words, which are mainly responsible for the CTP and CFN at layer 3, are no longer valid, and they can easily be detected by the SSI decoder at layer 2. Accordingly, CTP and CFN at layer 3 convert to CTN at layer 2, i.e., the SSI decoder produces no output by design, which is considered as a \"Negative\" based on the initial assumption, followed by a \"True\" detection at the SSI decoder. Nevertheless, although other code words can pass through this layer without any protection regardless of their status, they will be handled by the RS Codes decoder at layer 3. At this layer, the RS Codes decoder performs its normal operation on the received code words. In other words, layer 2 fills the safety gap in the communication channel by addressing the vulnerability of layer 3, i.e., detecting corrupted code words that are not detectable by RS Codes decoder. Accordingly, this combination of layers guarantees a safer operation in the considered communication network.