Skip to content

Commit

Permalink
Wrote a Makefile to simulate a DH key exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuysmans committed Dec 11, 2016
1 parent 7eb58c8 commit 1c351ce
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 $@

0 comments on commit 1c351ce

Please sign in to comment.