Download this file
| 1 | # The golden-vector generator. Not part of the CONTRA binary and not on the |
| 2 | # Go build path — it exists so the vectors come from an implementation nobody |
| 3 | # here wrote (OpenSSL) rather than from the Go code they are meant to test. |
| 4 | # |
| 5 | # make build both tools |
| 6 | # make vectors regenerate ../contra-v1.json |
| 7 | # make search find a fresh rejecting seed (minutes; only needed if the |
| 8 | # EC derivation label ever changes) |
| 9 | # |
| 10 | # REJECT_K is the witness from seedsearch. It is pinned rather than searched |
| 11 | # on every run because the search costs a few billion HKDF evaluations. |
| 12 | |
| 13 | CC ?= cc |
| 14 | CFLAGS ?= -O2 -Wall -Wextra -std=c99 |
| 15 | LDLIBS := -lcrypto |
| 16 | REJECT_K ?= 10962785172 |
| 17 | |
| 18 | all: gen seedsearch |
| 19 | |
| 20 | gen: gen.c |
| 21 | $(CC) $(CFLAGS) -o $@ $< $(LDLIBS) |
| 22 | |
| 23 | seedsearch: seedsearch.c |
| 24 | $(CC) $(CFLAGS) -O3 -o $@ $< $(LDLIBS) -lpthread |
| 25 | |
| 26 | vectors: gen |
| 27 | ./gen $(REJECT_K) > ../contra-v1.json |
| 28 | |
| 29 | search: seedsearch |
| 30 | ./seedsearch $$(nproc) |
| 31 | |
| 32 | clean: |
| 33 | rm -f gen seedsearch |
| 34 | |
| 35 | .PHONY: all vectors search clean |
| 36 | |