[PATCH] [lib/Fuzzer] Add SHA1 implementation from public domain.

Chandler Carruth chandlerc at gmail.com
Thu May 14 15:38:10 PDT 2015


Looks good. Minor comment below.


================
Comment at: lib/Fuzzer/FuzzerSHA1.cpp:9-12
@@ +8,6 @@
+//===----------------------------------------------------------------------===//
+// This code is taken from
+// http://oauth.googlecode.com/svn/code/c/liboauth/src/sha1.c
+// and modified by adding anonymous namespace, adding an interface
+// function fuzzer::ComputeSHA1() and removing unnecessary code.
+//
----------------
I'd go ahead and say its been placed in the public domain so no one panics when reading it.

================
Comment at: lib/Fuzzer/FuzzerSHA1.cpp:197-198
@@ +196,4 @@
+// The rest is added for LibFuzzer
+namespace fuzzer {
+void ComputeSHA1(const uint8_t *Data, size_t Len, uint8_t *Out) {
+	sha1nfo s;
----------------
You can just define it:

  void fuzzer::ComputeSHA1(...) {


Saves you namespace boilerplate. Not a big deal either way though.

http://reviews.llvm.org/D9733

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list