aboutsummaryrefslogtreecommitdiff
path: root/fuzz/fuzz_alg_crc32_md5.c
blob: b449941e2fd16037a4ee4961ceee7ff292f0a68f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "ndpi_api.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  u_char hash[16];
  struct ndpi_popcount popcount;

  /* No memory allocations involved */

  /* Used for crc32, md5 and popcount algs */

  ndpi_crc32(data, size);
  ndpi_md5(data, size, hash);

  ndpi_popcount_init(&popcount);
  ndpi_popcount_count(&popcount, data, size);

  return 0;
}