From 1c351ceb49215dc9c5865204dafd89f190abb1d3 Mon Sep 17 00:00:00 2001 From: Guillaume Huysmans Date: Sun, 11 Dec 2016 18:37:45 +0100 Subject: [PATCH] Wrote a Makefile to simulate a DH key exchange --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..baceefa --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: a-shared.dh + +clean: + rm a-to-b.dh b-to-a.dh a-shared.dh a-secret.dh +%.byte: %.ml + ocamlbuild -lib nums $@ + +TOOL=toy.byte +params.dh: $(TOOL) + ./$(TOOL) parameters 128 >$@ +a-to-b.dh: params.dh + ./$(TOOL) challenge $< >$@ 2>a-secret.dh +b-to-a.dh: a-to-b.dh + ./$(TOOL) derive1 params.dh <$< >$@ +a-shared.dh: b-to-a.dh + cat a-secret.dh $< |./$(TOOL) derive2 params.dh 3>&2 |tee $@