Skip to content

Commit

Permalink
tests: fix makefile with new paths, fix md5 define collision
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmoose committed Aug 7, 2024
1 parent 15654e2 commit d341dd5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build:
run_tests:
rm -rf tests/.get/packages tests/.get/tmp
gcc -c $(MINIZIP)/*.c
g++ -g tests/*.cpp src/*.cpp -std=gnu++20 -lm -L/usr/lib -I $(RAPIDJSON) $(MINIZIP_O) -I $(MINIZIP) -lz -lcurl -o get_tests
g++ -g tests/*.cpp src/*.cpp src/repos/*.cpp -std=gnu++20 -lm -L/usr/lib -I $(RAPIDJSON) $(MINIZIP_O) -I $(MINIZIP) -lz -lcurl -o get_tests
cd tests/server && python3 -m http.server &
export SERVERD=$!
sleep 2
Expand Down
100 changes: 50 additions & 50 deletions tests/md5_portable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
#define SET(n) \
(*(MD5_u32plus *)&ptr[(n) * 4])
#define GET(n) \
#define MY_GET(n) \
SET(n)
#else
#define SET(n) \
Expand All @@ -87,7 +87,7 @@
((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \
((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \
((MD5_u32plus)ptr[(n) * 4 + 3] << 24))
#define GET(n) \
#define MY_GET(n) \
(ctx->block[(n)])
#endif

Expand Down Expand Up @@ -133,58 +133,58 @@ static const void *body(MD5_CTX *ctx, const void *data, unsigned long size)
STEP(F, b, c, d, a, SET(15), 0x49b40821, 22)

/* Round 2 */
STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5)
STEP(G, d, a, b, c, GET(6), 0xc040b340, 9)
STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14)
STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20)
STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5)
STEP(G, d, a, b, c, GET(10), 0x02441453, 9)
STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14)
STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20)
STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5)
STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9)
STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14)
STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20)
STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5)
STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9)
STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14)
STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20)
STEP(G, a, b, c, d, MY_GET(1), 0xf61e2562, 5)
STEP(G, d, a, b, c, MY_GET(6), 0xc040b340, 9)
STEP(G, c, d, a, b, MY_GET(11), 0x265e5a51, 14)
STEP(G, b, c, d, a, MY_GET(0), 0xe9b6c7aa, 20)
STEP(G, a, b, c, d, MY_GET(5), 0xd62f105d, 5)
STEP(G, d, a, b, c, MY_GET(10), 0x02441453, 9)
STEP(G, c, d, a, b, MY_GET(15), 0xd8a1e681, 14)
STEP(G, b, c, d, a, MY_GET(4), 0xe7d3fbc8, 20)
STEP(G, a, b, c, d, MY_GET(9), 0x21e1cde6, 5)
STEP(G, d, a, b, c, MY_GET(14), 0xc33707d6, 9)
STEP(G, c, d, a, b, MY_GET(3), 0xf4d50d87, 14)
STEP(G, b, c, d, a, MY_GET(8), 0x455a14ed, 20)
STEP(G, a, b, c, d, MY_GET(13), 0xa9e3e905, 5)
STEP(G, d, a, b, c, MY_GET(2), 0xfcefa3f8, 9)
STEP(G, c, d, a, b, MY_GET(7), 0x676f02d9, 14)
STEP(G, b, c, d, a, MY_GET(12), 0x8d2a4c8a, 20)

/* Round 3 */
STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4)
STEP(H2, d, a, b, c, GET(8), 0x8771f681, 11)
STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16)
STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23)
STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4)
STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11)
STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16)
STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23)
STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4)
STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11)
STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16)
STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23)
STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4)
STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11)
STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16)
STEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23)
STEP(H, a, b, c, d, MY_GET(5), 0xfffa3942, 4)
STEP(H2, d, a, b, c, MY_GET(8), 0x8771f681, 11)
STEP(H, c, d, a, b, MY_GET(11), 0x6d9d6122, 16)
STEP(H2, b, c, d, a, MY_GET(14), 0xfde5380c, 23)
STEP(H, a, b, c, d, MY_GET(1), 0xa4beea44, 4)
STEP(H2, d, a, b, c, MY_GET(4), 0x4bdecfa9, 11)
STEP(H, c, d, a, b, MY_GET(7), 0xf6bb4b60, 16)
STEP(H2, b, c, d, a, MY_GET(10), 0xbebfbc70, 23)
STEP(H, a, b, c, d, MY_GET(13), 0x289b7ec6, 4)
STEP(H2, d, a, b, c, MY_GET(0), 0xeaa127fa, 11)
STEP(H, c, d, a, b, MY_GET(3), 0xd4ef3085, 16)
STEP(H2, b, c, d, a, MY_GET(6), 0x04881d05, 23)
STEP(H, a, b, c, d, MY_GET(9), 0xd9d4d039, 4)
STEP(H2, d, a, b, c, MY_GET(12), 0xe6db99e5, 11)
STEP(H, c, d, a, b, MY_GET(15), 0x1fa27cf8, 16)
STEP(H2, b, c, d, a, MY_GET(2), 0xc4ac5665, 23)

/* Round 4 */
STEP(I, a, b, c, d, GET(0), 0xf4292244, 6)
STEP(I, d, a, b, c, GET(7), 0x432aff97, 10)
STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15)
STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21)
STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6)
STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10)
STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15)
STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21)
STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6)
STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10)
STEP(I, c, d, a, b, GET(6), 0xa3014314, 15)
STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21)
STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6)
STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10)
STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15)
STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21)
STEP(I, a, b, c, d, MY_GET(0), 0xf4292244, 6)
STEP(I, d, a, b, c, MY_GET(7), 0x432aff97, 10)
STEP(I, c, d, a, b, MY_GET(14), 0xab9423a7, 15)
STEP(I, b, c, d, a, MY_GET(5), 0xfc93a039, 21)
STEP(I, a, b, c, d, MY_GET(12), 0x655b59c3, 6)
STEP(I, d, a, b, c, MY_GET(3), 0x8f0ccc92, 10)
STEP(I, c, d, a, b, MY_GET(10), 0xffeff47d, 15)
STEP(I, b, c, d, a, MY_GET(1), 0x85845dd1, 21)
STEP(I, a, b, c, d, MY_GET(8), 0x6fa87e4f, 6)
STEP(I, d, a, b, c, MY_GET(15), 0xfe2ce6e0, 10)
STEP(I, c, d, a, b, MY_GET(6), 0xa3014314, 15)
STEP(I, b, c, d, a, MY_GET(13), 0x4e0811a1, 21)
STEP(I, a, b, c, d, MY_GET(4), 0xf7537e82, 6)
STEP(I, d, a, b, c, MY_GET(11), 0xbd3af235, 10)
STEP(I, c, d, a, b, MY_GET(2), 0x2ad7d2bb, 15)
STEP(I, b, c, d, a, MY_GET(9), 0xeb86d391, 21)

a += saved_a;
b += saved_b;
Expand Down

0 comments on commit d341dd5

Please sign in to comment.