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 <afsconfig.h>
11 #include <afs/param.h>
14 #include "mit-cpyright.h"
21 * map a byte into its equivalent with odd parity, where odd
22 * parity is in the least significant bit
26 fprintf(stream, "static unsigned char const odd_parity[256] = {\n");
28 for (i = 0; i < 256; i++) {
30 /* shift out the lsb parity bit */
32 /* then count the other bits */
33 for (j = 0; j < 7; j++) {
40 fprintf(stream, "%3d", k);
42 fprintf(stream, ", ");
44 fprintf(stream, "\n");
46 fprintf(stream, "};\n");