blob: 3b5e6e807f420b3fb3ffe432c80dd2efe96a8823 [file] [log] [blame]
george.karpenkov29efa6d2017-08-21 23:25:50 +00001//===- FuzzerSHA1.h - Internal header for the SHA1 utils --------*- C++ -* ===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9// SHA1 utils.
10//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_FUZZER_SHA1_H
13#define LLVM_FUZZER_SHA1_H
14
15#include "FuzzerDefs.h"
16#include <cstddef>
17#include <stdint.h>
18
19namespace fuzzer {
20
21// Private copy of SHA1 implementation.
22static const int kSHA1NumBytes = 20;
23
24// Computes SHA1 hash of 'Len' bytes in 'Data', writes kSHA1NumBytes to 'Out'.
25void ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out);
26
27std::string Sha1ToString(const uint8_t Sha1[kSHA1NumBytes]);
28
29std::string Hash(const Unit &U);
30
31} // namespace fuzzer
32
33#endif // LLVM_FUZZER_SHA1_H