george.karpenkov | 29efa6d | 2017-08-21 23:25:50 +0000 | [diff] [blame^] | 1 | //===- 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 | |
| 19 | namespace fuzzer { |
| 20 | |
| 21 | // Private copy of SHA1 implementation. |
| 22 | static const int kSHA1NumBytes = 20; |
| 23 | |
| 24 | // Computes SHA1 hash of 'Len' bytes in 'Data', writes kSHA1NumBytes to 'Out'. |
| 25 | void ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out); |
| 26 | |
| 27 | std::string Sha1ToString(const uint8_t Sha1[kSHA1NumBytes]); |
| 28 | |
| 29 | std::string Hash(const Unit &U); |
| 30 | |
| 31 | } // namespace fuzzer |
| 32 | |
| 33 | #endif // LLVM_FUZZER_SHA1_H |