I'm testing a Reed Solomon algorithm from this repository in order to recover info in case something is externally changed.
Assuming:
m = bits per symbol
k = data
r = redundance
n = bits per block = r + k = 2^m - 1
t = error correction = (n - k) / 2
I can codify and recover info using the following parameters:
m = 8
n = 255
r = 135
k = 120
t = 67
And works perfectly, I can recover 67 errors.
My assumtions are:
- Only data will be corrupted, no redundancy.
- To get full recovery n = 3 * k --> r = 2 * k.
- Then n = 255 so r in this case shall be 170.
- So I must have GF(2^m) and RS [n, k, n - k + 1] for use is GF(2^8) and RS [255, 85, 171]
With these parameters I get the error:
Error - Failed to create sequential root generator!
This means that library function make_sequential_root_generator_polynomial:
const std::size_t field_descriptor = 8; /* m = bit per symbol */
const std::size_t generator_polynomial_index = 120;
const std::size_t generator_polynomial_root_count = 170; /* root shall be equal to redundance */
const schifra::galois::field field(field_descriptor,
schifra::galois::primitive_polynomial_size06,
schifra::galois::primitive_polynomial06);
if (
!schifra::make_sequential_root_generator_polynomial(field,
generator_polynomial_index,
generator_polynomial_root_count,
generator_polynomial)
)
{
std::cout << "Error - Failed to create sequential root generator!" << std::endl;
return false;
}
My problem is that I don't know why the algorithm fails. I think I have a concept problem, bug after read about the topic here and here, I don't get why is not possible.
Is it possible to use according assumtions or theory say that this is not possible?