#
#
# MDcrack Makefile
#
# Gregory Duchemin, 11 Feb 2001
# c3rb3r@hotmail.com
#
# MDcrack is derived from the RSA Data
# Security, Inc. MD5 Message-Digest Algorithm
#

CC = gcc

# Please set RESUME_FILE and choose a secure place for the resume file 
# before using mdcrack as root.
# default is NOT secure and own an obvious race condition.

# BENCH_HASH corresponds to the default benchmark hash 
# In fact i did not try it no more longer than 10 secs, however if 
# it would collide too quickly for your tests, change it.
 

MDCRACK_OPTS= -DRESUME_FILE="\"/tmp/.mdcrack-resume\"" -DBENCH_HASH="\"ffffffffffffffffffffffffffffffff\""


CFLAGS = -O3 -fforce-addr -funroll-loops 

# static linkage will suppress a little overhead due to obj search/mountage.
# useless for big sessions.

LDFLAGS = -static

mdcrack: md5c.o mdcrack.o
	$(CC) $(LDFLAGS) -o mdcrack md5c.o mdcrack.o
	@echo -e "\nok.\n\nto install -- \"make install\"\nto test -- \"make test/bigtest\"\n"

mdcrack.o: generic.h mdcrack.c md5c.c
	$(CC) -c $(CFLAGS) $(MDCRACK_OPTS) mdcrack.c

md5c.o: generic.h mdcrack.c md5c.c
	$(CC) -c $(CFLAGS) md5c.c

test: mdcrack 
	./mdcrack -s 0123456ABCDEFGHIJabcdfghzxsqwertiop   f71dbe52628a3f83a77ab494817525c6

bigtest: mdcrack
	./mdcrack  f71dbe52628a3f83a77ab494817525c6

clean:
	@echo -e "\nCleaning binaries...\n"
	rm -f *.o mdcrack 

install:
	@echo -e "\nInstalling mdcrack in /usr/sbin/mdcrack\n"
	cp ./mdcrack /usr/sbin/mdcrack
	@echo -e "\nok.\n"

