Index: build/argon2/Makefile ================================================================== --- build/argon2/Makefile +++ build/argon2/Makefile @@ -2,15 +2,16 @@ all: out/argon2.c out/argon2.h src-patched/argon2.c src-patched/argon2.h src-patched/blake2b.c src-patched/blamka-round-ref.h src-patched/core.c src-patched/core.h src-patched/encoding.c src-patched/encoding.h src-patched/ref.c: src-patched Makefile -src-patched: src/argon2.c src/argon2.h src/blake2b.c src/blamka-round-ref.h src/core.c src/core.h src/encoding.c src/encoding.h src/ref.c patches/argon2-20181109-tclamalgamation.diff Makefile +src-patched: src/argon2.c src/argon2.h src/blake2b.c src/blamka-round-ref.h src/core.c src/core.h src/encoding.c src/encoding.h src/ref.c patches/argon2-20181109-tclamalgamation.diff patches/argon2-20181109-noencoding.diff Makefile rm -rf src-patched src-patched.new mkdir src-patched.new cp $^ src-patched.new/ cd src-patched.new && patch --batch --posix -p1 < ../patches/argon2-20181109-tclamalgamation.diff + cd src-patched.new && patch --batch --posix -p1 < ../patches/argon2-20181109-noencoding.diff mv src-patched.new src-patched out/argon2.c: src-patched/argon2.c src-patched/ref.c src-patched/core.c src-patched/blake2b.c src-patched/encoding.c monocypher-blake2b.h Makefile mkdir -p out echo '#define ARGON2_NO_THREADS 1' > out/argon2.c.new.1 ADDED build/argon2/patches/argon2-20181109-noencoding.diff Index: build/argon2/patches/argon2-20181109-noencoding.diff ================================================================== --- /dev/null +++ build/argon2/patches/argon2-20181109-noencoding.diff @@ -0,0 +1,83 @@ +diff -uNr a/argon2.c b/argon2.c +--- a/argon2.c 2019-01-11 10:45:44.193444670 -0600 ++++ b/argon2.c 2019-01-11 12:01:03.325362284 -0600 +@@ -163,12 +163,16 @@ + + /* if encoding requested, write it */ + if (encoded && encodedlen) { ++ clear_internal_memory(out, hashlen); ++ free(out); ++ return ARGON2_ENCODING_FAIL; ++#if 0 + if (encode_string(encoded, encodedlen, &context, type) != ARGON2_OK) { + clear_internal_memory(out, hashlen); /* wipe buffers if error */ + clear_internal_memory(encoded, encodedlen); + free(out); +- return ARGON2_ENCODING_FAIL; + } ++#endif + } + clear_internal_memory(out, hashlen); + free(out); +@@ -246,6 +250,7 @@ + return (int)((1 & ((d - 1) >> 8)) - 1); + } + ++#if 0 + int argon2_verify(const char *encoded, const void *pwd, const size_t pwdlen, + argon2_type type) { + +@@ -326,6 +331,7 @@ + + return argon2_verify(encoded, pwd, pwdlen, Argon2_id); + } ++#endif + + int argon2d_ctx(argon2_context *context) { + return argon2_ctx(context, Argon2_d); +@@ -444,9 +450,11 @@ + } + } + ++#if 0 + size_t argon2_encodedlen(uint32_t t_cost, uint32_t m_cost, uint32_t parallelism, + uint32_t saltlen, uint32_t hashlen, argon2_type type) { + return strlen("$$v=$m=,t=,p=$$") + strlen(argon2_type2string(type, 0)) + + numlen(t_cost) + numlen(m_cost) + numlen(parallelism) + + b64len(saltlen) + b64len(hashlen) + numlen(ARGON2_VERSION_NUMBER) + 1; + } ++#endif +diff -uNr a/encoding.c b/encoding.c +--- a/encoding.c 2019-01-11 10:45:44.195444669 -0600 ++++ b/encoding.c 2019-01-11 12:01:35.466361698 -0600 +@@ -15,6 +15,8 @@ + * software. If not, they may be obtained at the above URLs. + */ + ++#if 0 ++ + #include + #include + #include +@@ -461,3 +463,4 @@ + return len; + } + ++#endif +diff -uNr a/encoding.h b/encoding.h +--- a/encoding.h 2019-01-11 10:45:44.196444669 -0600 ++++ b/encoding.h 2019-01-11 12:02:49.941360340 -0600 +@@ -19,6 +19,7 @@ + #define ENCODING_H + #include "argon2.h" + ++#if 0 + #define ARGON2_MAX_DECODED_LANES UINT32_C(255) + #define ARGON2_MIN_DECODED_SALT_LEN UINT32_C(8) + #define ARGON2_MIN_DECODED_OUT_LEN UINT32_C(12) +@@ -55,3 +56,5 @@ + size_t numlen(uint32_t num); + + #endif ++ ++#endif