-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (40 loc) · 2.01 KB
/
Copy pathMakefile
File metadata and controls
53 lines (40 loc) · 2.01 KB
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
43
44
45
46
47
48
49
50
51
52
53
SHELL := /bin/zsh
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
GO_DIR := $(ROOT_DIR)go
SAGE_DIR := $(ROOT_DIR)sage
ARTIFACTS_DIR := $(ROOT_DIR)artifacts
LOG_DIR := $(ARTIFACTS_DIR)/logs
GOCACHE ?= $(ARTIFACTS_DIR)/.gocache
GO ?= go
SAGE ?= sage
MAKE ?= make
.PHONY: help repro sage-attack sage-correctness go-test constraints pipeline \
clean clean-artifacts
help:
@echo "Reproduce paper artifacts for map-to-curve"
@echo
@echo "Targets:"
@echo " make repro Run all code-backed artifacts"
@echo " make sage-attack Run all SageMath artifacts"
@echo " make go-test Run the Go correctness test suite"
@echo " make constraints Reproduce constraint-count logs used for Table 1"
@echo " make pipeline Reproduce full prove/verify benchmark logs"
@echo " make clean Remove local reproducibility artifacts"
repro: sage-attack go-test constraints pipeline
sage-attack: sage-correctness | $(LOG_DIR)
cd $(SAGE_DIR) && $(SAGE) bn_poly_attack.sage | tee $(LOG_DIR)/sage-bn-poly-attack.log
cd $(SAGE_DIR) && $(SAGE) bn254_forgery.sage | tee $(LOG_DIR)/sage-bn-linear-combination.log
sage-correctness: | $(LOG_DIR)
cd $(SAGE_DIR) && $(SAGE) cardano.sage | tee $(LOG_DIR)/sage-cardano.log
go-test: | $(LOG_DIR)
cd $(GO_DIR) && GOCACHE=$(GOCACHE) $(GO) test -v ./... | tee $(LOG_DIR)/go-test.log
constraints: | $(LOG_DIR)
cd $(GO_DIR) && GOCACHE=$(GOCACHE) $(GO) test ./x-increment -run='^$$' -bench='Benchmark(Native|Emulated)$$' -benchtime=1x -count=1 | tee $(LOG_DIR)/constraints-x-increment.log
cd $(GO_DIR) && GOCACHE=$(GOCACHE) $(GO) test ./y-increment -run='^$$' -bench='Benchmark(Native|Emulated)$$' -benchtime=1x -count=1 | tee $(LOG_DIR)/constraints-y-increment.log
pipeline: | $(LOG_DIR)
cd $(GO_DIR) && GOCACHE=$(GOCACHE) $(GO) test ./x-increment ./y-increment -run='^$$' -bench='BenchmarkPipeline' -benchtime=10x -count=3 | tee $(LOG_DIR)/pipeline.log
$(LOG_DIR):
mkdir -p $(LOG_DIR) $(GOCACHE)
clean: clean-artifacts
clean-artifacts:
rm -rf $(ARTIFACTS_DIR)