forked from tamarin-prover/tamarin-prover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
301 lines (212 loc) · 10.2 KB
/
Makefile
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
CABAL_OPTS=
# NOTE that the dependency solver of cabal-install-0.10.2 has sometimes
# trouble coping with complicated install plans. In these cases, the
# development version version of 'cabal-install' available from
#
# darcs get http://darcs.haskell.org/cabal-install/
#
# allows you to use a better solver which is activated using the following
# flag.
#
# CABAL_OPTS=--solver=modular
#
# This is the only target that an end-user will use
install:
cabal install $(CABAL_OPTS) lib/utils lib/term lib/theory ./
install-theory:
cabal install $(CABAL_OPTS) lib/theory ./
install-term:
cabal install $(CABAL_OPTS) lib/term lib/theory ./
# In case some dependencies cannot be resolved and should be forced use this
# target. NOTE that this may break other libraries installed on your system.
force-install:
cabal install $(CABAL_OPTS) --force-reinstalls lib/utils lib/term lib/theory ./
force-install-ghc-7.0.4:
cabal install -wghc-7.0.4 $(CABAL_OPTS) --force-reinstalls lib/utils lib/term lib/theory ./
force-install-ghc-7.4.1:
cabal install -wghc-7.4.1 $(CABAL_OPTS) --force-reinstalls lib/utils lib/term lib/theory ./
force-install-theory:
cabal install $(CABAL_OPTS) --force-reinstalls lib/theory ./
force-install-term:
cabal install $(CABAL_OPTS) --force-reinstalls lib/term lib/theory ./
#
#
# ###########################################################################
# NOTE the remainder makefile is FOR DEVELOPERS ONLY.
# It is by no means official in any form and should be IGNORED :-)
# ###########################################################################
#
#
#
VERSION=0.8.5.0
source-dists:
cd lib/utils; cabal sdist
cd lib/term; cabal sdist
cd lib/theory; cabal sdist
cabal sdist
source-dists-tests: source-dists
mkdir -p /tmp/dist-test-$(VERSION)/
cp lib/utils/dist/tamarin-prover-utils-$(VERSION).tar.gz /tmp/dist-test-$(VERSION)/
cp lib/term/dist/tamarin-prover-term-$(VERSION).tar.gz /tmp/dist-test-$(VERSION)/
cp lib/theory/dist/tamarin-prover-theory-$(VERSION).tar.gz /tmp/dist-test-$(VERSION)/
cp dist/tamarin-prover-$(VERSION).tar.gz /tmp/dist-test-$(VERSION)/
cd /tmp/dist-test-$(VERSION)/; cabal install *.tar.gz
# For profiling, we use the cabal-dev tool and do not build the GUI. This
# simplifies installing all required libraries with profiling support enabled.
# The locally installed executable can then be called as follows
#
# ./cabal-dev/bin/tamarin-prover +RTS -p -RTS
#
# to generate the profiling report
#
# tamarin-prover.prof
#
# in the working directory.
profiling-install:
cabal-dev install --flags="-threaded no-gui" --force-reinstalls --enable-library-profiling --enable-executable-profiling ./lib/term ./lib/utils ./lib/theory ./
# requires the cabal-dev tool. Install it using the 'cabal-dev'
dev-install:
cabal-dev configure && cabal-dev build
dev-run:
./dist/build/tamarin-prover/tamarin-prover interactive examples/TPM
# TODO: Implement 'dev-clean' target
cabal-dev:
cabal-dev add-source lib/utils
cabal-dev add-source lib/term
# force install with 'native' flag of blaze-textual
cabal-dev install blaze-textual -fnative --reinstall
cabal-clean:
cd lib/utils; cabal clean
cd lib/term; cabal clean
cabal clean
###############################################################################
## Case Studies
###############################################################################
## CSF'12
#########
# These case studies are located in data/examples/ or examples/
DH2=DH2_original.spthy
KAS=KAS1.spthy KAS2_eCK.spthy KAS2_original.spthy
KEA=KEA_plus_KI_KCI.spthy KEA_plus_KI_KCI_wPFS.spthy
NAXOS=NAXOS_eCK_PFS.spthy NAXOS_eCK.spthy
SDH=SignedDH_PFS.spthy SignedDH_eCK.spthy
STS=STS_MAC.spthy STS_MAC_fix1.spthy STS_MAC_fix2.spthy
JKL1=JKL_TS1_2004_KI.spthy JKL_TS1_2008_KI.spthy
JKL2=JKL_TS2_2004_KI_wPFS.spthy JKL_TS2_2008_KI_wPFS.spthy
JKL3=JKL_TS3_2004_KI_wPFS.spthy JKL_TS3_2008_KI_wPFS.spthy
UM=UM_wPFS.spthy UM_PFS.spthy
TMPRES=case-studies/temp-analysis.spthy
TMPOUT=case-studies/temp-output.spthy
CSF12_CASE_STUDIES=$(JKL1) $(JKL2) $(KEA) $(NAXOS) $(UM) $(STS) $(SDH) $(KAS) $(DH2)
CSF12_CS_TARGETS=$(subst .spthy,_analyzed.spthy,$(addprefix case-studies/csf12/,$(CSF12_CASE_STUDIES)))
# CSF'12 case studies
csf12-case-studies: $(CSF12_CS_TARGETS)
grep "verified\|falsified\|processing time" case-studies/csf12/*.spthy
# individual case studies
case-studies/%_analyzed.spthy: data/examples/%.spthy
mkdir -p case-studies/csf12
mkdir -p case-studies/classic
mkdir -p case-studies/loops
mkdir -p case-studies/ake/bilinear
mkdir -p case-studies/ake/dh
mkdir -p case-studies/features/private_function_symbols
mkdir -p case-studies/features/multiset
mkdir -p case-studies/cav13
mkdir -p case-studies/related_work/AIF_Moedersheim_CCS10
mkdir -p case-studies/related_work/StatVerif_ARR_CSF11
mkdir -p case-studies/related_work/YubiSecure_KS_STM12
mkdir -p case-studies/related_work/TPM_DKRS_CSF11
# Use -N3, as the fourth core is used by the OS and the console
tamarin-prover $< --prove --stop-on-trace=dfs +RTS -N3 -RTS -o$(TMPRES) >$(TMPOUT)
# We only produce the target after the run, otherwise aborted
# runs already 'finish' the case.
echo "\n/* Output" >>$(TMPRES)
cat $(TMPOUT) >>$(TMPRES)
echo "*/" >>$(TMPRES)
mv $(TMPRES) $@
\rm -f $(TMPOUT)
## Inductive Strengthening
##########################
TPM=related_work/TPM_DKRS_CSF11/TPM_Exclusive_Secrets.spthy related_work/TPM_DKRS_CSF11/Envelope.spthy
STATVERIF=related_work/StatVerif_ARR_CSF11/StatVerif_Security_Device.spthy related_work/StatVerif_ARR_CSF11/StatVerif_GM_Contract_Signing.spthy
AIF=related_work/AIF_Moedersheim_CCS10/Keyserver.spthy
YUBIKEY=related_work/YubiSecure_KS_STM12/Yubikey.spthy related_work/YubiSecure_KS_STM12/Yubikey_and_YubiHSM.spthy related_work/YubiSecure_KS_STM12/Yubikey_multiset.spthy related_work/YubiSecure_KS_STM12/Yubikey_and_YubiHSM_multiset.spthy
LOOPS=loops/TESLA_Scheme1.spthy loops/Minimal_KeyRenegotiation.spthy loops/Minimal_Create_Use_Destroy.spthy loops/RFID_Simple.spthy loops/Minimal_Create_Use_Destroy.spthy loops/Minimal_Crypto_API.spthy loops/Minimal_Loop_Example.spthy loops/JCS12_Typing_Example.spthy loops/Minimal_Typing_Example.spthy loops/Typing_and_Destructors.spthy
# TESLA_Scheme2.spthy (not finished)
IND_CASE_STUDIES=$(TPM) $(AIF) $(LOOPS) $(STATVERIF) $(YUBIKEY)
IND_CS_TARGETS=$(subst .spthy,_analyzed.spthy,$(addprefix case-studies/,$(IND_CASE_STUDIES)))
# case studies
induction-case-studies: $(IND_CS_TARGETS)
grep -R "verified\|falsified\|processing time" case-studies/related_work/ case-studies/loops/
## Classical Protocols
######################
CLASSIC_CASE_STUDIES=TLS_Handshake.spthy NSPK3.spthy NSLPK3.spthy NSLPK3_untagged.spthy
CLASSIC_CS_TARGETS=$(subst .spthy,_analyzed.spthy,$(addprefix case-studies/classic/,$(CLASSIC_CASE_STUDIES)))
# case studies
classic-case-studies: $(CLASSIC_CS_TARGETS)
grep "verified\|falsified\|processing time" case-studies/classic/*.spthy
## AKE Diffie-Hellman
####################
AKE_DH_CASE_STUDIES=DHKEA_NAXOS_C_eCK_PFS_keyreg_partially_matching.spthy DHKEA_NAXOS_C_eCK_PFS_partially_matching.spthy UM_one_pass_fix.spthy UM_three_pass.spthy NAXOS_eCK.spthy UM_three_pass_combined.spthy NAXOS_eCK_PFS.spthy UM_three_pass_combined_fixed.spthy UM_one_pass_attack.spthy
AKE_DH_CS_TARGETS=$(subst .spthy,_analyzed.spthy,$(addprefix case-studies/ake/dh/,$(AKE_DH_CASE_STUDIES)))
# case studies
ake-dh-case-studies: $(AKE_DH_CS_TARGETS)
grep "verified\|falsified\|processing time" case-studies/ake/dh/*.spthy
## Bilinear Pairing
####################
AKE_BP_CASE_STUDIES=Chen_Kudla.spthy Chen_Kudla_eCK.spthy Joux.spthy Joux_EphkRev.spthy RYY.spthy RYY_PFS.spthy Scott.spthy Scott_EphkRev.spthy TAK1.spthy TAK1_eCK_like.spthy
AKE_BP_CS_TARGETS=$(subst .spthy,_analyzed.spthy,$(addprefix case-studies/ake/bilinear/,$(AKE_BP_CASE_STUDIES)))
# case studies
ake-bp-case-studies: $(AKE_BP_CS_TARGETS)
grep "verified\|falsified\|processing time" case-studies/ake/dh/*.spthy
## Features
###########
FEATURES_CASE_STUDIES=cav13/DH_example.spthy features//multiset/counter.spthy features//private_function_symbols/NAXOS_eCK_PFS_private.spthy features//private_function_symbols/NAXOS_eCK_private.spthy
FEATURES_CS_TARGETS=$(subst .spthy,_analyzed.spthy,$(addprefix case-studies/,$(FEATURES_CASE_STUDIES)))
# case studies
features-case-studies: $(FEATURES_CS_TARGETS)
grep "verified\|falsified\|processing time" case-studies/features/multiset/*.spthy case-studies/features/private_function_symbols/*.spthy case-studies/cav13/*.spthy
## All case studies
###################
CS_TARGETS=case-studies/Tutorial_analyzed.spthy $(CSF12_CS_TARGETS) $(CLASSIC_CS_TARGETS) $(IND_CS_TARGETS) $(AKE_DH_CS_TARGETS) $(AKE_BP_CS_TARGETS) $(FEATURES_CS_TARGETS)
case-studies: $(CS_TARGETS)
grep -R "verified\|falsified\|processing time" case-studies/
-grep -iR "warning\|error" case-studies/
###############################################################################
## Developer specific targets (some out of date)
###############################################################################
# outdated targets
all: unit mult psearch
web:
ghc --make Main -c -isrc -Wall -iinteractive-only-src
runghc -isrc -Wall -iinteractive-only-src Main interactive examples --autosave --loadstate --debug
webc: comp
./tamarin-prover interactive --autosave --loadstate --debug --datadir=data/ examples/
comp:
ghc --make Main -isrc -iinteractive-only-src/ -o tamarin-prover
opt:
ghc -fforce-recomp -isrc -main-is Narrow.main --make -O2 -Wall -o narrow src/Narrow.hs
assert:
ghc -fforce-recomp -isrc -main-is Narrow.main --make -Wall -o narrow src/Narrow.hs
mult: assert
time ./narrow variants "x1*x2"
scyther:
cabal install --flags="-build-library -build-tests build-scyther"
unit:
cabal install --flags="-build-library build-tests -build-scyther"
-rm scyther-ac-unit-tests.tix
scyther-ac-unit-tests
coverage:
ghc -fhpc -fforce-recomp -main-is Term.UnitTests.main --make -Wall -o unit -ilib/term/src Term.UnitTests
-rm unit.tix
./unit
hpc markup unit --destdir coverage
open coverage/hpc_index.html
hpc report unit
haddock:
cabal haddock --executables
depgraph:
find . -name \*hs | grep -v Old | xargs graphmod -q | tred | dot -odepGraph.svg -Tsvg
ctags:
ghc -e :ctags src/Main.hs
.PHONY: unit opt all mult coverage haddock case-studies