gsimm.hon commit Merge branch 'lt/logopt' into next (d2b9b5f)
   1#ifndef GSIMM_H
   2#define GSIMM_H
   3
   4/* Length of file message digest (MD) in bytes. Longer MD's are
   5   better, but increase processing time for diminishing returns.
   6   Must be multiple of NUM_HASHES_PER_CHAR / 8, and at least 24
   7   for good results
   8*/
   9#define MD_LENGTH 32
  10#define MD_BITS (MD_LENGTH * 8)
  11
  12/* The MIN_FILE_SIZE indicates the absolute minimal file size that
  13   can be processed. As indicated above, the first and last
  14   RABIN_WINDOW_SIZE - 1 bytes are skipped.
  15   In order to get at least an average of 12 samples
  16   per bit in the final message digest, require at least 3 * MD_LENGTH
  17   complete windows in the file.  */
  18#define MIN_FILE_SIZE (3 * MD_LENGTH + 2 * (RABIN_WINDOW_SIZE - 1))
  19
  20/* Limit matching algorithm to files less than 256 MB, so we can use
  21   32 bit integers everywhere without fear of overflow. For larger
  22   files we should add logic to mmap the file by piece and accumulate
  23   the frequency counts. */
  24#define MAX_FILE_SIZE (256*1024*1024 - 1)
  25
  26void gb_simm_process(u_char *data, unsigned len, u_char *md);
  27
  28#endif