MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / gfInit

Method gfInit

Libraries/unrar/rs.cpp:15–27  ·  view source on GitHub ↗

Initialize logarithms and exponents Galois field tables.

Source from the content-addressed store, hash-verified

13
14// Initialize logarithms and exponents Galois field tables.
15void 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected