FuzzerSHA1.h 978 B

1234567891011121314151617181920212223242526272829303132
  1. //===- FuzzerSHA1.h - Internal header for the SHA1 utils --------*- C++ -* ===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // SHA1 utils.
  9. //===----------------------------------------------------------------------===//
  10. #ifndef LLVM_FUZZER_SHA1_H
  11. #define LLVM_FUZZER_SHA1_H
  12. #include "FuzzerDefs.h"
  13. #include <cstddef>
  14. #include <stdint.h>
  15. namespace fuzzer {
  16. // Private copy of SHA1 implementation.
  17. static const int kSHA1NumBytes = 20;
  18. // Computes SHA1 hash of 'Len' bytes in 'Data', writes kSHA1NumBytes to 'Out'.
  19. void ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out);
  20. std::string Sha1ToString(const uint8_t Sha1[kSHA1NumBytes]);
  21. std::string Hash(const Unit &U);
  22. } // namespace fuzzer
  23. #endif // LLVM_FUZZER_SHA1_H