Initialize logarithms and exponents Galois field tables.
| 13 | |
| 14 | // Initialize logarithms and exponents Galois field tables. |
| 15 | void RSCoder::gfInit() |
| 16 | { |
| 17 | for (int I=0,J=1;I<MAXPAR;I++) |
| 18 | { |
| 19 | gfLog[J]=I; |
| 20 | gfExp[I]=J; |
| 21 | J<<=1; |
| 22 | if (J > MAXPAR) |
| 23 | J^=0x11D; // 0x11D field-generator polynomial (x^8+x^4+x^3+x^2+1). |
| 24 | } |
| 25 | for (int I=MAXPAR;I<MAXPOL;I++) // Avoid gfExp overflow check. |
| 26 | gfExp[I]=gfExp[I-MAXPAR]; |
| 27 | } |
| 28 | |
| 29 | |
| 30 | // Multiplication over Galois field. |
nothing calls this directly
no outgoing calls
no test coverage detected