Reed-Solomon Rebuilds the Bytes

Build the field GF(2^8) of Reed-Solomon codes in small loops, encode a few bytes into shards, lose some and solve for the data. A toy-sized code over the real field, with no OpenSSL call.

The Field

Addition, multiplication and powers of two in the field of 256 elements.

  1. Bytes Add by XOR

    addition in the field of bytes

  2. Multiply With a Reduction

    the product of two bytes stays a byte

  3. Powers of Two Walk the Field

    2 reaches every non-zero byte

The Code

Shards as values of a polynomial, rebuilding from the survivors, and what this code does not do.

  1. Shards Are Evaluations

    encode bytes by evaluating a polynomial

  2. Lose Shards and Solve

    rebuild the data from the survivors

  3. What This Code Does Not Do

    erasures, not errors