2 * Copyright (c) 2016-present, Facebook, Inc.
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
11 * Helper functions for fuzzing.
14 #ifndef ZSTD_HELPERS_H
15 #define ZSTD_HELPERS_H
17 #define ZSTD_STATIC_LINKING_ONLY
26 void FUZZ_setRandomParameters(ZSTD_CCtx
*cctx
, size_t srcSize
, uint32_t *state
);
28 ZSTD_compressionParameters
FUZZ_randomCParams(size_t srcSize
, uint32_t *state
);
29 ZSTD_frameParameters
FUZZ_randomFParams(uint32_t *state
);
30 ZSTD_parameters
FUZZ_randomParams(size_t srcSize
, uint32_t *state
);
37 /* Quickly train a dictionary from a source for fuzzing.
38 * NOTE: Don't use this to train production dictionaries, it is only optimized
39 * for speed, and doesn't care about dictionary quality.
41 FUZZ_dict_t
FUZZ_train(void const* src
, size_t srcSize
, uint32_t *state
);
48 #endif /* ZSTD_HELPERS_H */