carlos / contra Public

Clone
git clone https://amadan.net/carlos/contra

Plain git — no account needed to clone.

Download

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
13CC ?= cc
14CFLAGS ?= -O2 -Wall -Wextra -std=c99
15LDLIBS := -lcrypto
16REJECT_K ?= 10962785172
17
18all: gen seedsearch
19
20gen: gen.c
21 $(CC) $(CFLAGS) -o $@ $< $(LDLIBS)
22
23seedsearch: seedsearch.c
24 $(CC) $(CFLAGS) -O3 -o $@ $< $(LDLIBS) -lpthread
25
26vectors: gen
27 ./gen $(REJECT_K) > ../contra-v1.json
28
29search: seedsearch
30 ./seedsearch $$(nproc)
31
32clean:
33 rm -f gen seedsearch
34
35.PHONY: all vectors search clean
36