Index: build/argon2/Makefile ================================================================== --- build/argon2/Makefile +++ build/argon2/Makefile @@ -1,10 +1,10 @@ PREFIX := $(shell pwd)/INST all: out/argon2.c out/argon2.h -out/argon2.c: src/argon2.c src/ref.c src/core.c src/blake2b.c src/encoding.c monocypher-blake2b.h +out/argon2.c: src/argon2.c src/ref.c src/core.c src/blake2b.c src/encoding.c monocypher-blake2b.h Makefile mkdir -p out echo '#define ARGON2_NO_THREADS 1' > out/argon2.c.new.1 echo '#define ARGON2_INTERNAL_ONLY 1' >> out/argon2.c.new.1 cat monocypher-blake2b.h >> out/argon2.c.new.1 echo '#include "argon2.h"' >> out/argon2.c.new.1 @@ -13,13 +13,15 @@ sed '/^#include "/ d' src/ref.c >> out/argon2.c.new.1 sed '/#include "/ d;/#include/ b;/Argon2 Team - Begin Code/,/Argon2 Team - End Code/ b;d' src/blake2b.c >> out/argon2.c.new.1 sed '/^#include "/ d' src/core.c >> out/argon2.c.new.1 sed -r '/( |\*)argon(2_ctx|2_verify|2_hash|2_type2|2_error_message|2_encodedlen|2i_|2d_|2id_)/ b;/:/ b;/^(static|extern|enum|typedef) / b;s@^[a-z]@static &@' out/argon2.c.new.1 > out/argon2.c.new.2 rm -f out/argon2.c.new.1 - mv out/argon2.c.new.2 out/argon2.c + sed 's@malloc(@(void *) Tcl_AttemptAlloc(@g;s@free(@Tcl_Free((void *) @g' out/argon2.c.new.2 > out/argon2.c.new.1 + rm -f out/argon2.c.new.2 + mv out/argon2.c.new.1 out/argon2.c -out/argon2.h: src/argon2.h src/blamka-round-ref.h src/core.h src/encoding.h +out/argon2.h: src/argon2.h src/blamka-round-ref.h src/core.h src/encoding.h Makefile mkdir -p out cat src/argon2.h > out/argon2.h.new.1 echo '#ifdef ARGON2_INTERNAL_ONLY' >> out/argon2.h.new.1 cat src/blamka-round-ref.h src/core.h src/encoding.h >> out/argon2.h.new.1 echo '#endif' >> out/argon2.h.new.1 Index: build/argon2/monocypher-blake2b.h ================================================================== --- build/argon2/monocypher-blake2b.h +++ build/argon2/monocypher-blake2b.h @@ -5,10 +5,11 @@ #define blake2b_update(ctx, in, inlen) 0; crypto_blake2b_update(ctx, in, inlen) #define blake2b_final(ctx, out, ignore1) 0; crypto_blake2b_final(ctx, out) #define BLAKE2_INLINE #define BLAKE2B_OUTBYTES 64 #include +#include #include "monocypher.h" static BLAKE2_INLINE uint64_t rotr64(uint64_t x, uint64_t n) { return (x >> n) ^ (x << (64 - n)); } static BLAKE2_INLINE void store32( void *dst, uint32_t w ) { #if defined(NATIVE_LITTLE_ENDIAN)