mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
Lagom/Fuzzers: Add fuzzers for all current hashing functions
Namely MD5, SHA1, SHA256, SHA384 and SHA512.
This commit is contained in:
parent
4dc63896de
commit
f29036dc98
6 changed files with 85 additions and 0 deletions
16
Meta/Lagom/Fuzzers/FuzzSHA384.cpp
Normal file
16
Meta/Lagom/Fuzzers/FuzzSHA384.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCrypto/Hash/SHA2.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
auto buffer = ByteBuffer::copy(data, size);
|
||||
Crypto::Hash::SHA384::hash(buffer);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue