Skip to content

Commit

Permalink
Document BLAKE2b and clean up after ccache#445
Browse files Browse the repository at this point in the history
Closes ccache#412.
  • Loading branch information
jrosdahl committed Jul 22, 2019
1 parent a30c4ba commit 6d76231
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 270 deletions.
1 change: 0 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ non_third_party_sources = \
src/language.c \
src/lockfile.c \
src/manifest.c \
src/mdfour.c \
src/result.c \
src/stats.c \
src/unify.c \
Expand Down
1 change: 0 additions & 1 deletion dev.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ headers = \
src/language.h \
src/macroskip.h \
src/manifest.h \
src/mdfour.h \
src/result.h \
src/system.h \
src/third_party/getopt_long.h \
Expand Down
20 changes: 8 additions & 12 deletions doc/MANUAL.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ compiler options apply and you should refer to the compiler's documentation.

*`--hash-file`*=_PATH_::

Print the hash of the file at PATH in the format `<MD4><size>`, where
`<MD4>` is 32 hex digits and `<size>` is 8 hex digits (representing the
size of the file modulo 2^32). This is only useful when debugging ccache
and its behavior.
Print the hash (160 bit BLAKE2b) of the file at PATH. This is only useful
when debugging ccache and its behavior.

*`-h, --help`*::

Expand Down Expand Up @@ -909,11 +907,9 @@ The basic idea is to detect when you are compiling exactly the same code a
second time and reuse the previously produced output. The detection is done by
hashing different kinds of information that should be unique for the
compilation and then using the hash sum to identify the cached output. ccache
uses MD4, a very fast cryptographic hash algorithm, for the hashing. (MD4 is
nowadays too weak to be useful in cryptographic contexts, but it should be safe
enough to be used to identify recompilations.) On a cache hit, ccache is able
to supply all of the correct compiler outputs (including all warnings,
dependency file, etc) from the cache.
uses BLAKE2b, a very fast cryptographic hash algorithm, for the hashing. On a
cache hit, ccache is able to supply all of the correct compiler outputs
(including all warnings, dependency file, etc) from the cache.

ccache has two ways of gathering information used to look up results in the
cache:
Expand Down Expand Up @@ -1073,9 +1069,9 @@ Log for this object file.
|==============================================================================
In the direct mode, ccache uses the MD4 hash of the *ccache-input-c*
+ *ccache-input-d* data (where *+* means concatenation), while the
*ccache-input-c* + *ccache-input-p* data is used in the preprocessor mode.
In the direct mode, ccache uses the 160 bit BLAKE2b hash of the
*ccache-input-c* + *ccache-input-d* data (where *+* means concatenation), while
the *ccache-input-c* + *ccache-input-p* data is used in the preprocessor mode.
The *ccache-input-text* file is a combined text version of the three
binary input files. It has three sections (“COMMON”, “DIRECT MODE” and
Expand Down
4 changes: 2 additions & 2 deletions src/ccache.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ static const char USAGE_TEXT[] =
"Options for scripting or debugging:\n"
" --dump-manifest=PATH dump manifest file at PATH in text format\n"
" -k, --get-config=K print the value of configuration key K\n"
" --hash-file=PATH print the hash (<MD4><file_size_in_hex>) of the\n"
" file at PATH\n"
" --hash-file=PATH print the hash (160 bit BLAKE2b) of the file at\n"
" PATH\n"
" --print-stats print statistics counter IDs and corresponding\n"
" values in machine-parsable format\n"
" -o, --set-config=K=V set configuration item K to value V\n"
Expand Down
215 changes: 0 additions & 215 deletions src/mdfour.c

This file was deleted.

37 changes: 0 additions & 37 deletions src/mdfour.h

This file was deleted.

4 changes: 2 additions & 2 deletions unittest/test_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include "../src/hash.h"
#include "framework.h"

TEST_SUITE(mdfour)
TEST_SUITE(hash)

TEST(test_vectors_from_rfc_1320_should_be_correct)
TEST(test_known_strings)
{
char d[DIGEST_STRING_BUFFER_SIZE];

Expand Down

0 comments on commit 6d76231

Please sign in to comment.