| Zachary Turner | 24a148b | 2016-11-30 19:06:14 +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 | //===----------------------------------------------------------------------===// |
| Marcos Pividori | 178fe58 | 2016-12-13 17:46:11 +0000 | [diff] [blame] | 11 | |
| Zachary Turner | 24a148b | 2016-11-30 19:06:14 +0000 | [diff] [blame] | 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 |
| Marcos Pividori | 178fe58 | 2016-12-13 17:46:11 +0000 | [diff] [blame] | 32 | |
| Zachary Turner | 24a148b | 2016-11-30 19:06:14 +0000 | [diff] [blame] | 33 | #endif // LLVM_FUZZER_SHA1_H |