Content deleted Content added
John Comeau (talk | contribs) →Code sample for the binary field in Java: made variables match closer to pseudocode; using char[] arrays instead of int[] for easier conversion to and from strings; made output something more usable than simply length of polynomial ~~~~ |
John Comeau (talk | contribs) →Code sample for the binary field in Java: fixed formatting |
||
Line 168:
for (int N = 0; N < n; N++) {
int d = s[N];
for (int i = 1; i <= L; i++)
d ^= (c[i] & s[N - i]);▼
if (d == 1) {
System.arraycopy(c, 0, t, 0, n);
int diff = N - m;
for (int i = 0, j = diff; j < n; i++, j++)
if (L <= N
}
▲ L = N + 1 - L;
▲ System.arraycopy(t, 0, b, 0, n);
}
return stringify(c, L);
|