blob: 3b5e6e807f420b3fb3ffe432c80dd2efe96a8823 [file] [log] [blame]
Zachary Turner24a148b2016-11-30 19:06:14 +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//===----------------------------------------------------------------------===//
Marcos Pividori178fe582016-12-13 17:46:11 +000011
Zachary Turner24a148b2016-11-30 19:06:14 +000012#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
Marcos Pividori178fe582016-12-13 17:46:11 +000032
Zachary Turner24a148b2016-11-30 19:06:14 +000033#endif // LLVM_FUZZER_SHA1_H