2 * Copyright 1988 by the Massachusetts Institute of Technology.
4 * For copying and distribution information, please see
5 * the file <mit-cpyright.h>.
7 * This routine generates an odd-parity table for use in key generation.
10 #include <afs/param.h>
11 #include <afsconfig.h>
15 #include <mit-cpyright.h>
22 * map a byte into its equivalent with odd parity, where odd
23 * parity is in the least significant bit
25 register int i, j, k, odd;
28 "static unsigned char const odd_parity[256] = {\n");
30 for (i = 0; i < 256; i++) {
32 /* shift out the lsb parity bit */
34 /* then count the other bits */
35 for (j = 0; j < 7; j++) {
42 fprintf(stream, "%3d", k);
44 fprintf(stream, ", ");
46 fprintf(stream, "\n");
48 fprintf(stream, "};\n");