mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
a1f9d2420f
Previously, some fuzzers were generating an excessive amount of debug logging. This change explicitly disables debug logging for all fuzzers. This allows higher test throughput and makes the logs easier to read when fuzzing locally.
26 lines
584 B
C++
26 lines
584 B
C++
/*
|
|
* Copyright (c) 2022, stelar7 <dudedbz@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/Format.h>
|
|
#include <LibCrypto/Authentication/Poly1305.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
{
|
|
AK::set_debug_enabled(false);
|
|
|
|
if (size < 32)
|
|
return 0;
|
|
|
|
auto initial = ReadonlyBytes { data, 32 };
|
|
auto message = ReadonlyBytes { data + 32, size - 32 };
|
|
|
|
Crypto::Authentication::Poly1305 mac(initial);
|
|
mac.update(message);
|
|
(void)mac.digest();
|
|
return 0;
|
|
}
|