Is Reed Solomon's first ECC always the same as xor?

Now I am working with reed-solomon. As I understand it, the first error correction code always matches the xor'ing of the data words, because the first row of the Vandermonde matrix is ​​always 1, and adding elements to the halo field is equivalent to xor.

Now I tried to get some codewords using the RexSolomonEncoder Zxing 3.3.0 implementation. See the following list in Java:

 
ReedSolomonEncoder rs = new ReedSolomonEncoder(GenericGF.QR_CODE_FIELD_256);

int[] codeword = {72,87,0,0};

rs.encode(codeword, 2);
System.out.println("Ecc for " + codeword[0] + " and " + codeword[1]);
System.out.println("XOR: " + (72^87));
System.out.println("RS #1: " + codeword[2]); // Shouldn't this be 31 too?
System.out.println("RS #2: " + codeword[3]);

Which gives the following result:

Ecc for 72 and 87
XOR: 31
RS #1: 28
RS #2: 3

There are two possibilities:

  • I have a misconception about Reed-Solomon
  • I am using the implementation incorrectly (since javadoc is poorly written)

Or is it a mistake that I somehow do not believe.

+4
source share
1 answer

, , (x + 1) (x + α) (x + α ^ 2).... " " 1. " " α, (x + α) (x + α ^ 2) (x + α ^ 3).... , (x + a ^ 127) (x + a ^ 128) GF (256) , 1x ^ 2 +?? x + 1.

GF (256) 9- x ^ 8 + x ^ 4 + x ^ 3 + x ^ 2 + 1 hex 11d. α , α = x + 0 == hex 02.

(1x + 1) (1x + 2) = 1x ^ 2 + 3x + 2. , . x ^ 2 ( ), :

               48 8f
        ------------
1  3  2 |48 57 00 00
         48 d8 90
         --------
            8f 90 00
            8f 8c 03
            --------
               1c 03   remainder

, , GF (256),

48 57 1c 03

(hex 1c = decimal 28).

[0] xor . ( ):

        syndrome 0:                 syndrome 1:

          48 09 03                    48 c7 8f
      ------------                ------------
 1  1 |48 57 1c 03           1  2 |48 57 1c 03
       48 48                       48 90
       -----                       -----
          1f 1c                       c7 1c
          1f 1f                       c7 93
          -----                       -----
             03 03                       8f 03
             03 03                       8f 03
             -----                       -----
                00                          00

01, 57 56:

          48 1e 02                    48 c6 8d
      ------------                ------------
 1  1 |48 56 1c 03           1  2 |48 56 1c 03
       48 48                       48 90
       -----                       -----
          1e 1c                       c6 1c
          1e 1e                       c6 91
          -----                       -----
             02 03                       8d 03
             02 02                       8d 07
             -----                       -----
                01                          04
+4

Source: https://habr.com/ru/post/1677708/


All Articles