Files
corona/Makefile
T
Hanzo AI bf70b85833 audit 2026-06: TEE + GPU + public-permissionless-chain safety + corona->corona sweep
AUDIT-2026-06.md ships the four-dimensional audit:

D1 Permissionless safety: PASSED with two minor open items for v0.7.6.
   Rogue-key NOT APPLICABLE (single global (A, bTilde); no per-party pk
   in the BLS-aggregation sense). Adaptive corruption documented as
   paper-cited only (carryover; GATE-4 target). Slashable equivocation
   evidence is cryptographically extractable via signed dkg2.Complaint
   and activation-cert non-verification. Front-running: sid IS bound
   into PRNG seed / MAC / transcript hash (CRIT-1 fix 2026-05-03), but
   plumbed as Go int (64-bit), not 32-byte randomness as threat-model
   claims — D1-2 MEDIUM, doc tightening for v0.7.6. D1-3 MINOR: extend
   Complaint to signing-round equivocation.

D2 TEE integration: WAS A GAP. Closed by this audit via the new
   docs/mptc/tee-integration.md — full per-platform spec for AMD
   SEV-SNP (primary Linux path), NVIDIA Confidential Computing
   (H100/H200/B200 CC mode) when gpu.UseAccelerator() is used in
   production, Intel TDX (alternative), Apple Secure Enclave (local-
   only defense-in-depth on Apple Silicon). Intel SGX explicitly NOT
   RECOMMENDED. Decomplecting rule held: ZERO Corona kernel code
   change required for §3.1, §3.3, §3.4; §3.2 adds one optional
   plumbing function (gpu.MaybeRegisterAttested) tracked for v0.7.6.
   The TEE layer sits OUTSIDE the cryptographic math — Corona observes
   nothing of TEE state.

D3 GPU acceleration inventory: corona/gpu is a thin SubRing-registration
   shim around luxfi/lattice/v7/gpu — no kernels live in corona/.
   dkg2_parallel.go is goroutine fan-out (honestly relabelled in
   66f7521), not GPU dispatch. Sister-repo lux-private/gpu-kernels/
   ops/mpcvm/*/mpcvm_corona.* and ops/crypto/corona/ carry the
   legacy name — D3-1 INFORMATIONAL, cross-repo rename TODO.

D4 corona->corona sweep (in-repo COMPLETE):
   * Makefile: BINARY_NAME corona -> corona; banner + docker tag.
   * Dockerfile: addgroup/adduser/binary-path/entrypoint.
   * .github/workflows/ci.yml: bin/corona -> bin/corona; artifact
     name corona-${runner.os}-${arch}; release output name pattern.
   * .golangci.yml: local-prefixes: corona -> github.com/luxfi/corona.
   * docs/{app,content,lib,out,public,.source,mdx-components.tsx,...}
     DROPPED — a fumadocs Next.js site (3057 lines) that framed Corona
     as a privacy ring-signature scheme (Schnorr + linkability +
     hash-to-curve + "ring signatures for transaction privacy"). That
     is NOT Corona — Corona is a 2-round R-LWE threshold sig (Boschini
     et al. 2024/1113). The site referenced a non-existent
     github.com/luxfi/corona Go module. Removed.
   * KEPT: docs/mptc/ (authoritative submission docs).
   * KEPT: historical refs in CHANGELOG.md, LLM.md, and
     CRYPTOGRAPHER-SIGN-OFF.md — they document the prior v0.4.x purge
     and are correct as historical context.
   * Cross-repo (luxfi/threshold, lux-private/gpu-kernels, luxfi/node)
     inventoried as D4-1 INFORMATIONAL — sister-repo work items.

Build clean (GOWORK=off go build ./...). gofmt -s clean. vet clean.
Full short test suite green: dkg, dkg2, gpu, hash, keyera, networking,
primitives, reshare, sign, threshold, utils, wire — ALL ok.

KATs unchanged: no Go code paths edited; FIPS-TRACEABILITY byte-
equality contract preserved. v1.x ABI unchanged: no public Go API
modified. Constant-time discipline preserved: no crypto/subtle paths
touched; CONSTANT-TIME-REVIEW.md remains authoritative.

Production deployment posture (unchanged from v0.7.5): APPROVED WITH
ROADMAP GATES for public-permissionless deployment as a R-LWE
threshold signature primitive in Lux Quasar consensus, with v0.8.0
GATE-3b (10^9-sample dudect on pinned CPU) + GATE-4 (external audit)
+ GATE-5 (Jasmin extraction byte-walk) as carryover roadmap items.
2026-06-03 11:40:06 -07:00

216 lines
5.6 KiB
Makefile

# Corona - Post-Quantum Ring-LWE Threshold Signature Scheme
# Makefile for building, testing, and managing the project
.PHONY: all build test clean fmt lint vet coverage bench run help install-tools
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOFMT=gofmt
GOVET=$(GOCMD) vet
GOLINT=golangci-lint
# Binary name
BINARY_NAME=corona
BINARY_PATH=./bin/$(BINARY_NAME)
# Test parameters
TEST_TIMEOUT=30s
BENCH_TIME=10s
COVERAGE_OUT=coverage.out
COVERAGE_HTML=coverage.html
# Build flags
LDFLAGS=-ldflags "-s -w"
BUILD_FLAGS=-v
# Default target
all: test build
## help: Display this help message
help:
@echo "Corona - Post-Quantum Ring-LWE Threshold Signature Scheme"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '^## ' Makefile | sed 's/## / /'
## build: Build the binary
build:
@echo "Building $(BINARY_NAME)..."
@mkdir -p bin
$(GOBUILD) $(BUILD_FLAGS) $(LDFLAGS) -o $(BINARY_PATH) .
@echo "Build complete: $(BINARY_PATH)"
## test: Run all tests
test:
@echo "Running tests..."
$(GOTEST) -v -timeout $(TEST_TIMEOUT) ./...
## test-short: Run short tests only
test-short:
@echo "Running short tests..."
$(GOTEST) -v -short -timeout $(TEST_TIMEOUT) ./...
## test-race: Run tests with race detector
test-race:
@echo "Running tests with race detector..."
$(GOTEST) -v -race -timeout $(TEST_TIMEOUT) ./...
## coverage: Generate test coverage report
coverage:
@echo "Generating coverage report..."
$(GOTEST) -v -coverprofile=$(COVERAGE_OUT) -covermode=atomic ./...
$(GOCMD) tool cover -html=$(COVERAGE_OUT) -o $(COVERAGE_HTML)
@echo "Coverage report generated: $(COVERAGE_HTML)"
@echo "Coverage summary:"
@$(GOCMD) tool cover -func=$(COVERAGE_OUT) | grep total | awk '{print "Total coverage: " $$3}'
## bench: Run benchmarks
bench:
@echo "Running benchmarks..."
$(GOTEST) -bench=. -benchtime=$(BENCH_TIME) -benchmem ./...
## bench-cpu: Run benchmarks with CPU profiling
bench-cpu:
@echo "Running benchmarks with CPU profiling..."
$(GOTEST) -bench=. -benchtime=$(BENCH_TIME) -benchmem -cpuprofile=cpu.prof ./...
@echo "CPU profile saved to cpu.prof"
@echo "View with: go tool pprof cpu.prof"
## bench-mem: Run benchmarks with memory profiling
bench-mem:
@echo "Running benchmarks with memory profiling..."
$(GOTEST) -bench=. -benchtime=$(BENCH_TIME) -benchmem -memprofile=mem.prof ./...
@echo "Memory profile saved to mem.prof"
@echo "View with: go tool pprof mem.prof"
## fmt: Format Go code
fmt:
@echo "Formatting code..."
$(GOFMT) -w -s .
@echo "Code formatting complete"
## lint: Run linter
lint:
@echo "Running linter..."
@if command -v golangci-lint >/dev/null 2>&1; then \
$(GOLINT) run ./...; \
else \
echo "golangci-lint not installed. Run 'make install-tools' to install it."; \
exit 1; \
fi
## vet: Run go vet
vet:
@echo "Running go vet..."
$(GOVET) ./...
## mod: Download and tidy Go modules
mod:
@echo "Downloading dependencies..."
$(GOMOD) download
@echo "Tidying modules..."
$(GOMOD) tidy
@echo "Verifying modules..."
$(GOMOD) verify
## clean: Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
$(GOCLEAN)
@rm -rf bin/
@rm -f $(COVERAGE_OUT) $(COVERAGE_HTML)
@rm -f *.prof
@rm -f *.test
@echo "Clean complete"
## install: Install the binary to GOPATH/bin
install: build
@echo "Installing $(BINARY_NAME) to $(GOPATH)/bin..."
@cp $(BINARY_PATH) $(GOPATH)/bin/
@echo "Installation complete"
## install-tools: Install development tools
install-tools:
@echo "Installing development tools..."
@echo "Installing golangci-lint..."
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@echo "Installing goimports..."
@go install golang.org/x/tools/cmd/goimports@latest
@echo "Installing staticcheck..."
@go install honnef.co/go/tools/cmd/staticcheck@latest
@echo "Tools installation complete"
## run: Run the application with default parameters
run: build
@echo "Running $(BINARY_NAME)..."
$(BINARY_PATH)
## run-local: Run local simulation
run-local: build
@echo "Running local simulation..."
$(BINARY_PATH) l 0 0
## run-party: Run as party (requires party ID, IP, and port)
run-party: build
@if [ -z "$(PARTY_ID)" ] || [ -z "$(IP)" ] || [ -z "$(PORT)" ]; then \
echo "Usage: make run-party PARTY_ID=1 IP=127.0.0.1 PORT=8000"; \
exit 1; \
fi
@echo "Running as party $(PARTY_ID) on $(IP):$(PORT)..."
$(BINARY_PATH) $(PARTY_ID) $(IP) $(PORT)
## docker-build: Build Docker image
docker-build:
@echo "Building Docker image..."
docker build -t corona:latest .
## docker-run: Run Docker container
docker-run: docker-build
@echo "Running Docker container..."
docker run --rm -it corona:latest
## ci: Run CI pipeline locally (format, vet, lint, test, build)
ci: fmt vet lint test-race coverage build
@echo "CI pipeline complete"
## check: Quick check (format, vet, test)
check: fmt vet test-short
@echo "Quick check complete"
## update: Update dependencies to latest versions
update:
@echo "Updating dependencies..."
$(GOGET) -u ./...
$(GOMOD) tidy
@echo "Dependencies updated"
## version: Display Go version and module info
version:
@echo "Go version:"
@$(GOCMD) version
@echo ""
@echo "Module info:"
@$(GOCMD) list -m all | head -5
## stats: Display code statistics
stats:
@echo "Code statistics:"
@echo " Lines of code:"
@find . -name "*.go" -not -path "./vendor/*" | xargs wc -l | tail -1
@echo " Number of Go files:"
@find . -name "*.go" -not -path "./vendor/*" | wc -l
@echo " Number of test files:"
@find . -name "*_test.go" -not -path "./vendor/*" | wc -l
# Create necessary directories
init:
@mkdir -p bin
.DEFAULT_GOAL := help