00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <Basics.H>
00026 #include "ByteModTable.H"
00027
00028 using std::cout;
00029 using std::endl;
00030
00031 int main()
00032 {
00033 cout << "// The table for computing raw fingerprints\n//\n";
00034 cout << "// This table was generated by the program \"TestFPTable\"\n//\n";
00035 cout << "// These used to be compiled in as constants, but are" << endl
00036 << "// now generated when the fingerprinting library is" << endl
00037 << "// initialized. The output of this program can still" << endl
00038 << "// serve as a test that the table generation algorithm" << endl
00039 << "// is working correctly.\n\n";
00040 cout << "Poly ";
00041
00042
00043 cout << "ByteModTable[8][256] = {\n";
00044 for (int i = 0; i < 8; i++) {
00045 cout << " { ";
00046 for (int j = 0; j < 256; j++) {
00047 if (j > 0) cout << " ";
00048 cout << "{ ";
00049 for (int ix = 0; ix < PolyVal::WordCnt; ix ++) {
00050 if (ix > 0) cout << " ";
00051 char buff[17];
00052 sprintf(buff, "%016" FORMAT_LENGTH_INT_64 "x",
00053 ByteModTable[i][j].w[ix]);
00054 cout << "CONST_INT_64(0x" << buff << ")";
00055 if (ix < PolyVal::WordCnt-1) cout << "," << endl;
00056 }
00057 cout << " }";
00058 if (j < 255) cout << ",";
00059 cout << "\n";
00060 }
00061 cout << " }";
00062 if (i < 7) cout << ",";
00063 cout << "\n";
00064 }
00065 cout << "};\n";
00066 cout.flush();
00067 return(0);
00068 }