aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 326e80eb446f4fe17d6143d4d73da9dc8e8333c2 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
EC_TESTS = ec.test_context ec.test_configuration ec.test_curve ec.test_formula \
ec.test_params ec.test_key_agreement ec.test_key_generation ec.test_mod ec.test_model \
ec.test_mult ec.test_naf ec.test_op ec.test_point ec.test_signature ec.test_transformations ec.test_regress

SCA_TESTS = sca.test_align sca.test_combine sca.test_edit sca.test_filter sca.test_match sca.test_process \
sca.test_sampling sca.test_target sca.test_test sca.test_trace sca.test_traceset sca.test_plot sca.test_rpa

TESTS = ${EC_TESTS} ${SCA_TESTS}

PERF_SCRIPTS = test/ec/perf_mod.py test/ec/perf_formula.py test/ec/perf_mult.py

test:
	nose2 -s test -E "not slow and not disabled" -C -v ${TESTS}

test-plots:
	env PYECSCA_TEST_PLOTS=1 nose2 -s test -E "not slow and not disabled" -C -v ${TESTS}

test-all:
	nose2 -s test -C -v ${TESTS}

typecheck:
	mypy pyecsca --ignore-missing-imports --show-error-codes

typecheck-all:
	mypy pyecsca test --ignore-missing-imports --show-error-codes

codestyle:
	flake8 --extend-ignore=E501,F405,F403,F401,E126,E203 pyecsca

codestyle-all:
	flake8 --extend-ignore=E501,F405,F403,F401,E126,E203 pyecsca test

black:
	black pyecsca

black-all:
	black pyecsca test

perf: ${PERF_SCRIPTS}
	mkdir -p .perf
	echo $^ | env DIR=".perf" xargs -n 1 python

doc-coverage:
	interrogate -vv -nmps -e pyecsca/ec/std/.github/ -f 55 pyecsca

docs:
	$(MAKE) -C docs apidoc
	$(MAKE) -C docs html

help:
	@echo "pyecsca, Python Elliptic Curve cryptography Side-Channel Analysis toolkit."
	@echo
	@echo "Available targets:"
	@echo " - test: Test pyecsca."
	@echo " - test-plots: Test pyecsca and produce debugging plots."
	@echo " - test-all: Test pyecsca but also run slow (and disabled) tests."
	@echo " - typecheck: Use mypy to verify the use of types in pyecsca."
	@echo " - typecheck-all: Use mypy to verify the use of types in pyecsca and in tests."
	@echo " - codestyle: Use flake8 to check codestyle in pyecsca."
	@echo " - codestyle-all: Use flake8 to check codestyle in pyecsca and in tests."
	@echo " - black: Run black on pyecsca sources (will transform them inplace)."
	@echo " - black-all: Run black on pyecsca sources and tests (will transform them inplace)."
	@echo " - perf: Run performance measurements (prints results and stores them in .perf/)."
	@echo " - doc-coverage: Use interrogate to check documentation coverage of public API."
	@echo " - docs: Build docs using sphinx."
	@echo " - help: Show this help."

.PHONY: test test-plots test-all typecheck typecheck-all codestyle codestyle-all black black-all perf doc-coverage docs