~ehmry/nim_sphincs

nim_sphincs/Makefile -rw-r--r-- 1.1 KiB
6a66c7b1Emery Hemingway Support for seq[byte] input 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Makefile for generating test data

REF_VERSION = 20180313
REF_PKG_DIR := sphincs+-reference-implementation-$(REF_VERSION)
CRYPTO_SIGN_DIR := $(REF_PKG_DIR)/crypto_sign

TEST_RSPS := $(foreach S,128f 128s,tests/shake256-$(S)/PQCsignKAT_64.rsp)
TEST_RSPS += $(foreach S,192f 192s,tests/shake256-$(S)/PQCsignKAT_96.rsp)
TEST_RSPS += $(foreach S,256f 256s,tests/shake256-$(S)/PQCsignKAT_128.rsp)

RNG_SOURCES = tests/rng.c tests/rng.h

default: $(TEST_RSPS) $(RNG_SOURCES)

tests/shake256-%/PQCsignKAT_64.rsp: \
		$(CRYPTO_SIGN_DIR)/sphincs-shake256-%/PQCgenKAT_sign
	mkdir -p $(@D)
	cd $(@D) && ../../$<

tests/shake256-%/PQCsignKAT_96.rsp: \
		$(CRYPTO_SIGN_DIR)/sphincs-shake256-%/PQCgenKAT_sign
	mkdir -p $(@D)
	cd $(@D) && ../../$<

tests/shake256-%/PQCsignKAT_128.rsp: \
		$(CRYPTO_SIGN_DIR)/sphincs-shake256-%/PQCgenKAT_sign
	mkdir -p $(@D)
	cd $(@D) && ../../$<

$(CRYPTO_SIGN_DIR)/sphincs-shake256-%/PQCgenKAT_sign: $(REF_PKG_DIR)
	make -C $(@D)

$(RNG_SOURCES): $(REF_PKG_DIR)
	cp $</crypto_sign/sphincs-haraka-128f/$(notdir $@) $@
	git add $@

$(REF_PKG_DIR): $(REF_PKG_DIR).tar.bz2
	tar xf $<
	touch $@

$(REF_PKG_DIR).tar.bz2:
	wget https://sphincs.org/data/$@