-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
283 lines (230 loc) · 9.39 KB
/
Copy pathMakefile
File metadata and controls
283 lines (230 loc) · 9.39 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
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
# Crypto Module Makefile
# Provides targets for testing all cryptographic packages individually
.PHONY: all test test-verbose clean help
.PHONY: test-accumulator test-bulletproof test-core test-daed test-dkg test-ecies
.PHONY: test-internal test-keys test-mpc test-ot test-paillier test-sharing
.PHONY: test-signatures test-subtle test-tecdsa test-ted25519 test-zkp
.PHONY: test-core-curves test-core-native test-dkg-frost test-dkg-gennaro test-dkg-gennaro2p
.PHONY: test-ot-base test-ot-extension test-sharing-v1 test-signatures-bbs test-signatures-bls
.PHONY: test-signatures-common test-signatures-schnorr test-tecdsa-dklsv1 test-ted25519-frost
.PHONY: test-ted25519-ted25519 test-zkp-schnorr
.PHONY: bench bench-verbose coverage coverage-html
# Default target
all: test
tidy:
@go mod tidy
@go mod download
# Test all packages
test: tidy
@gum log --level info "Running tests for all crypto packages..."
@go test ./... -v
# Test all packages with verbose output
test-verbose: tidy
@gum log --level info "Running verbose tests for all crypto packages..."
@go test ./... -v -count=1
# Help target
help:
@gum log --level info "Crypto Module Makefile"
@gum log --level info ""
@gum log --level info "Available targets:"
@gum log --level info " all - Run all tests (default)"
@gum log --level info " test - Run all tests"
@gum log --level info " test-verbose - Run all tests with verbose output"
@gum log --level info ""
@gum log --level info "Individual package tests:"
@gum log --level info " test-accumulator - Test accumulator package"
@gum log --level info " test-bulletproof - Test bulletproof package"
@gum log --level info " test-core - Test core package"
@gum log --level info " test-daed - Test daed package"
@gum log --level info " test-dkg - Test dkg package"
@gum log --level info " test-ecies - Test ecies package"
@gum log --level info " test-internal - Test internal package"
@gum log --level info " test-keys - Test keys package"
@gum log --level info " test-mpc - Test mpc package"
@gum log --level info " test-ot - Test ot package"
@gum log --level info " test-paillier - Test paillier package"
@gum log --level info " test-sharing - Test sharing package"
@gum log --level info " test-signatures - Test signatures package"
@gum log --level info " test-subtle - Test subtle package"
@gum log --level info " test-tecdsa - Test tecdsa package"
@gum log --level info " test-ted25519 - Test ted25519 package"
@gum log --level info " test-zkp - Test zkp package"
@gum log --level info ""
@gum log --level info "Subpackage tests:"
@gum log --level info " test-core-curves - Test core/curves package"
@gum log --level info " test-core-native - Test core/curves/native package"
@gum log --level info " test-dkg-frost - Test dkg/frost package"
@gum log --level info " test-dkg-gennaro - Test dkg/gennaro package"
@gum log --level info " test-dkg-gennaro2p - Test dkg/gennaro2p package"
@gum log --level info " test-ot-base - Test ot/base package"
@gum log --level info " test-ot-extension - Test ot/extension package"
@gum log --level info " test-sharing-v1 - Test sharing/v1 package"
@gum log --level info " test-signatures-bbs - Test signatures/bbs package"
@gum log --level info " test-signatures-bls - Test signatures/bls package"
@gum log --level info " test-signatures-common - Test signatures/common package"
@gum log --level info " test-signatures-schnorr - Test signatures/schnorr package"
@gum log --level info " test-tecdsa-dklsv1 - Test tecdsa/dklsv1 package"
@gum log --level info " test-ted25519-frost - Test ted25519/frost package"
@gum log --level info " test-ted25519-ted25519 - Test ted25519/ted25519 package"
@gum log --level info " test-zkp-schnorr - Test zkp/schnorr package"
@gum log --level info ""
@gum log --level info "Performance and coverage:"
@gum log --level info " bench - Run benchmarks"
@gum log --level info " bench-verbose - Run benchmarks with verbose output"
@gum log --level info " coverage - Generate test coverage report"
@gum log --level info " coverage-html - Generate HTML test coverage report"
# Top-level package tests
test-accumulator:
@gum log --level info "Testing accumulator package..."
@go test ./accumulator -v
test-bulletproof:
@gum log --level info "Testing bulletproof package..."
@go test ./bulletproof -v
test-core:
@gum log --level info "Testing core package..."
@go test ./core -v
test-daed:
@gum log --level info "Testing daed package..."
@go test ./daed -v
test-dkg:
@gum log --level info "Testing dkg package..."
@go test ./dkg/... -v
test-ecies:
@gum log --level info "Testing ecies package..."
@go test ./ecies -v
test-internal:
@gum log --level info "Testing internal package..."
@go test ./internal -v
test-keys:
@gum log --level info "Testing keys package..."
@go test ./keys -v
test-mpc:
@gum log --level info "Testing mpc package..."
@go test ./mpc -v
test-ot:
@gum log --level info "Testing ot package..."
@go test ./ot/... -v
test-paillier:
@gum log --level info "Testing paillier package..."
@go test ./paillier -v
test-sharing:
@gum log --level info "Testing sharing package..."
@go test ./sharing/... -v
test-signatures:
@gum log --level info "Testing signatures package..."
@go test ./signatures/... -v
test-subtle:
@gum log --level info "Testing subtle package..."
@go test ./subtle -v
test-tecdsa:
@gum log --level info "Testing tecdsa package..."
@go test ./tecdsa/... -v
test-ted25519:
@gum log --level info "Testing ted25519 package..."
@go test ./ted25519/... -v
test-zkp:
@gum log --level info "Testing zkp package..."
@go test ./zkp/... -v
# Subpackage tests
test-core-curves:
@gum log --level info "Testing core/curves package..."
@go test ./core/curves -v
test-core-native:
@gum log --level info "Testing core/curves/native package..."
@go test ./core/curves/native/... -v
test-dkg-frost:
@gum log --level info "Testing dkg/frost package..."
@go test ./dkg/frost -v
test-dkg-gennaro:
@gum log --level info "Testing dkg/gennaro package..."
@go test ./dkg/gennaro -v
test-dkg-gennaro2p:
@gum log --level info "Testing dkg/gennaro2p package..."
@go test ./dkg/gennaro2p -v
test-ot-base:
@gum log --level info "Testing ot/base package..."
@go test ./ot/base/... -v
test-ot-extension:
@gum log --level info "Testing ot/extension package..."
@go test ./ot/extension/... -v
test-sharing-v1:
@gum log --level info "Testing sharing/v1 package..."
@go test ./sharing/v1 -v
test-signatures-bbs:
@gum log --level info "Testing signatures/bbs package..."
@go test ./signatures/bbs -v
test-signatures-bls:
@gum log --level info "Testing signatures/bls package..."
@go test ./signatures/bls/... -v
test-signatures-common:
@gum log --level info "Testing signatures/common package..."
@go test ./signatures/common -v
test-signatures-schnorr:
@gum log --level info "Testing signatures/schnorr package..."
@go test ./signatures/schnorr/... -v
test-tecdsa-dklsv1:
@gum log --level info "Testing tecdsa/dklsv1 package..."
@go test ./tecdsa/dklsv1/... -v
test-ted25519-frost:
@gum log --level info "Testing ted25519/frost package..."
@go test ./ted25519/frost -v
test-ted25519-ted25519:
@gum log --level info "Testing ted25519/ted25519 package..."
@go test ./ted25519/ted25519 -v
test-zkp-schnorr:
@gum log --level info "Testing zkp/schnorr package..."
@go test ./zkp/schnorr -v
# Performance testing
bench:
@gum log --level info "Running benchmarks for all packages..."
@go test ./... -bench=. -run=^$
bench-verbose:
@gum log --level info "Running verbose benchmarks for all packages..."
@go test ./... -bench=. -benchmem -run=^$ -v
# Coverage testing
coverage:
@gum log --level info "Generating test coverage report..."
@go test ./... -coverprofile=coverage.out
@go tool cover -func=coverage.out
coverage-html:
@gum log --level info "Generating HTML test coverage report..."
@go test ./... -coverprofile=coverage.out
@go tool cover -html=coverage.out -o coverage.html
@gum log --level info "Coverage report generated: coverage.html"
# Build verification
build:
@gum log --level info "Building all packages to verify compilation..."
@go build ./...
# Module maintenance
mod-tidy:
@gum log --level info "Tidying go.mod..."
@go mod tidy
mod-verify:
@gum log --level info "Verifying go.mod..."
@go mod verify
mod-download:
@gum log --level info "Downloading dependencies..."
@go mod download
# Security scanning (if staticcheck is available)
lint:
@gum log --level info "Running static analysis..."
@if command -v staticcheck >/dev/null 2>&1; then \
staticcheck ./...; \
else \
gum log --level warn "staticcheck not installed. Install with: go install honnef.co/go/tools/cmd/staticcheck@latest"; \
go vet ./...; \
fi
# Format code
fmt:
@gum log --level info "Formatting code..."
@go fmt ./...
# Check for formatting issues
fmt-check:
@gum log --level info "Checking code formatting..."
@test -z "$$(go fmt ./...)"
# Run all quality checks
check: fmt-check lint test
@gum log --level info "✅ All quality checks passed!"
# Development workflow
dev: clean mod-tidy fmt lint test
@gum log --level info "✅ Development workflow completed successfully!"