YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
/* Generate the lookup table needed for fast left-to-right computation
of the Jacobi symbol. */
assert (d < 2);
assert (a < 4);
assert (b < 4);
assert ( (a | b ) & 1);
if (a == 3 && b == 3) return d ? 7 : 12;
for (i = 0; i < 12; i++) if (decode_table[i].a == a
&& decode_table[i].b == b) return i;
abort ();
}
int
main (int argc, char **argv)
{ unsigned bits;
for (bits = 0; bits < 208; bits++)
{ unsigned e, a, b, d_old, d, q;
if (bits && !(bits & 0xf))
printf("\n");
q = bits & 3;
d = (bits >> 2) & 1;
e = JACOBI_E (bits >> 3);
a = JACOBI_A (bits >> 3);
b = JACOBI_B (bits >> 3);
d_old = JACOBI_D (bits >> 3);
if (d != d_old && a == 3 && b == 3)
e ^= 1;
if (d == 1)
{ if (b == 2)
e ^= (q & (a >> 1)) ^ (q >> 1);
a = (a - q * b) & 3;
} else
{ if (a == 2)
e ^= (q & (b >> 1)) ^ (q >> 1);
b = (b - q * a) & 3;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.