-
Notifications
You must be signed in to change notification settings - Fork 1
tss-lib: v3 channel-free round functions, EdDSA, security fixes #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marcopeereboom
wants to merge
55
commits into
main
Choose a base branch
from
max/tss_changes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
fd8f1df
MinerFi TSS library fork: security hardening, ZK witness support, and…
max-sanchez dd849d9
feat(tss): add CeremonyID field to SSID domain separation
marcopeereboom 68e3555
feat(tss/keygen): add channel-free round functions
marcopeereboom 68614e5
feat(tss/signing): channel-free round functions
marcopeereboom 2d24fc3
feat(tss/resharing): channel-free round functions
marcopeereboom 5b71f55
fix(tss/signing): auto-subset key for threshold
marcopeereboom 637310f
refactor(tss): v3 module, delete channel API
marcopeereboom 6b276f4
feat(tss/eddsa): keygen, signing, and resharing round functions
marcopeereboom dbb72e5
test(tss): negative and coverage tests across all packages
marcopeereboom 9d5fd6e
added test workflow for CI
ClaytonNorthey92 882e75b
remove quotes
ClaytonNorthey92 4036071
setup go wtihout setting working-dir
ClaytonNorthey92 9801477
no fail-fast in CI
ClaytonNorthey92 4c9d47e
increase test timeout
ClaytonNorthey92 00a6ef3
separate go get from go test
ClaytonNorthey92 b8efc3b
fix package name
ClaytonNorthey92 66d6499
remove go get for now
ClaytonNorthey92 f48f4ec
re-add go get
ClaytonNorthey92 906ed61
bump tss-lib to 1.25
ClaytonNorthey92 be93de3
also get test modules
ClaytonNorthey92 5662de6
build(tss): bump golangci-lint to v2.11.3
marcopeereboom 6f05c1d
test(tss): cover ValidateSaveData, CKD error paths
marcopeereboom 77d0d73
fix(tss): suppress SA1019 and add legacy build tags for CI
marcopeereboom c7424cf
reduce eth-trie test example size
AL-CT 2989c8d
address feedback
ClaytonNorthey92 5ac88ab
add tss to actions
ClaytonNorthey92 d763fad
go mod update in tss
ClaytonNorthey92 d12bf8d
introduce short-circuit
ClaytonNorthey92 8151eb1
bump to 60m timeout during tests
ClaytonNorthey92 971ca37
revert my forced bug
ClaytonNorthey92 4845299
go 1.25 + go mod tidy in tss
ClaytonNorthey92 6ad1b43
test(tss): restore MtA negative tests and enable lifecycle tests in CI
max-sanchez 65f3b78
test(tss/keygen): add negative and edge-case tests for Rounds 1–4
max-sanchez a52543c
test(tss/signing): add negative and edge-case tests for SignRound1–Fi…
max-sanchez d5cba72
test(tss): add known-answer and commitment binding tests
marcopeereboom 3a6dd37
fix(tss): lint fixes for unconvert and missing import
marcopeereboom 9e4b6bf
test(tss/resharing): add negative and edge-case tests for ReshareRoun…
max-sanchez e76000b
ci: increase test timeout from 60m to 120m
max-sanchez 55e74eb
test(tss): add culprit attribution assertions to 64 negative tests
max-sanchez dd04e5c
test(tss/keygen): fix isError comment and use tolerant culprit check
max-sanchez c48301c
test(tss): add SSID sensitivity tests for signing, keygen, and resharing
max-sanchez 03d3723
test(tss): close remaining SSID input sensitivity gaps
max-sanchez 2d9304c
revert: changes to tss/
joshuasing 8862a07
tss-lib: clean up copyright headers
joshuasing 4d73bcb
tss-lib: tidy up Makefile, re-run linter
joshuasing 64aa75b
.github/workflows: update copyright year in go.yml
joshuasing 54cf2e0
.github/workflows: remove tss from go.yml
joshuasing c32f2b7
.github/workflows: add Lint job to go.yml workflow
joshuasing 07f0c8b
fix(tss): resolve all gosec findings
marcopeereboom d58480c
test(tss): use pre-computed preparams fixture
marcopeereboom 810b475
refactor(eddsa/signing): drop binance-chain/edwards25519
marcopeereboom 3cf2c33
fix(tss): flatten all wrapped function signatures
marcopeereboom c23bec7
refactor(tss-lib): remove testify dependency
marcopeereboom 2c47d8d
fix(tss-lib): resolve gci import ordering and staticcheck findings
marcopeereboom 94574ae
fix(ecdsa/signing): eliminate data race in round 2 and 3 error slices
marcopeereboom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Copyright (c) 2024-2026 Hemi Labs, Inc. | ||
| # Use of this source code is governed by the MIT License, | ||
| # which can be found in the LICENSE file. | ||
|
|
||
| # GitHub Actions workflow to lint, build and test. | ||
| name: "Go" | ||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| concurrency: | ||
| group: "go-${{ github.workflow }}-${{ github.event.number || github.ref }}" | ||
| cancel-in-progress: "${{ github.event_name == 'pull_request' }}" | ||
|
|
||
| env: | ||
| # renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver | ||
| GOLANGCI_LINT_VERSION: "v2.11.3" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: "Test" | ||
| runs-on: "ubuntu-latest" | ||
| timeout-minutes: 150 | ||
| strategy: | ||
| fail-fast: false # if one of these fails, still run the others | ||
| matrix: | ||
| module: | ||
| - eth-trie | ||
| - merkle | ||
| - tss-lib | ||
| steps: | ||
| - name: "Checkout repository" | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: "Setup Go" | ||
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | ||
| with: | ||
| go-version-file: "${{ matrix.module }}/go.mod" | ||
|
|
||
| - name: "go get" | ||
| working-directory: ${{ matrix.module }} | ||
| run: go mod download && go mod verify | ||
|
|
||
| - name: "go test" | ||
| working-directory: ${{ matrix.module }} | ||
| run: go test -tags tssexamples -timeout 120m -v -cover ./... | ||
|
|
||
| lint: | ||
| name: "Lint" | ||
| runs-on: "ubuntu-latest" | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| module: | ||
| - tss-lib | ||
| steps: | ||
| - name: "Checkout repository" | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: "Setup Go" | ||
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | ||
| with: | ||
| go-version-file: "${{ matrix.module }}/go.mod" | ||
|
|
||
| - name: "golangci-lint" | ||
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | ||
| with: | ||
| working-directory: "${{ matrix.module }}" | ||
| version: "${{ env.GOLANGCI_LINT_VERSION }}" | ||
|
|
||
| - name: "golangci-lint fmt" | ||
| working-directory: "${{ matrix.module }}" | ||
| run: golangci-lint fmt --diff ./... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| bin/ | ||
| .gocache/ | ||
| pkg/ | ||
| coverage.out | ||
| test.log | ||
| *.swp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| version: "2" | ||
| run: | ||
| tests: true | ||
|
|
||
| issues: | ||
| max-issues-per-linter: 0 | ||
| max-same-issues: 0 | ||
|
|
||
| linters: | ||
| enable: | ||
| - "asasalint" # Check for pass []any as any in variadic func(...any). | ||
| - "dupword" # Checks for duplicate words in the source code. | ||
| - "errcheck" # Checks for unchecked errors. | ||
| - "errorlint" # Verifies errors are properly wrapped. | ||
| - "errname" # Checks that sentinel errors are prefixed with the Err. | ||
| - "gocheckcompilerdirectives" # Checks that go compiler directives are valid. | ||
| - "gochecksumtype" # Run exhaustiveness checks on Go "sum types". | ||
| - "gomoddirectives" # Manages 'replace', 'retract' and 'excludes' directives. | ||
| - "gosmopolitan" # Report certain i18n/l10n anti-patterns. | ||
| - "govet" # Runs go vet. | ||
| - "ineffassign" # Detects when assignments to variables are not used. | ||
| - "makezero" # Finds slice declarations with non-zero initial length. | ||
| - "misspell" # Finds common typing mistakes. | ||
| - "nilerr" # Finds code that returns nil even if it checks error is not nil. | ||
| - "nolintlint" # Reports ill-formed or insufficient nolint directives. | ||
| - "prealloc" # Finds slice declarations that could be pre-allocated. | ||
| - "predeclared" # Find code that shadows predeclared identifiers. | ||
| - "staticcheck" # Runs staticcheck. | ||
| - "unconvert" # Checks for unnecessary type conversions. | ||
| - "usestdlibvars" # Detects the possibility to use stdlib vars/constants. | ||
| - "usetesting" # Reports use of functions with replacements in testing. | ||
| - "unused" # Checks for unused constants, variables, functions, types. | ||
| - "whitespace" # Checks for unnecessary newlines. | ||
| settings: | ||
| gomoddirectives: | ||
| replace-local: true # tss-lib fork not yet pushed. | ||
| nolintlint: | ||
| require-explanation: true | ||
| exclusions: | ||
| generated: "strict" | ||
| presets: | ||
| - "comments" | ||
| - "common-false-positives" | ||
| - "legacy" | ||
| - "std-error-handling" | ||
| rules: | ||
| - linters: [ "staticcheck" ] | ||
| text: "QF1001:" # "could apply De Morgan's law" | ||
| - linters: [ "staticcheck" ] | ||
| text: "QF1007:" # "could merge conditional assignment" | ||
| - linters: [ "staticcheck" ] | ||
| text: "SA1019:.*elliptic\\." # tss-lib requires raw curve arithmetic (Add, ScalarMult, etc.) | ||
| - linters: [ "staticcheck" ] | ||
| text: "SA1019:.*\\.Add has been deprecated" # elliptic.Curve.Add | ||
| - linters: [ "staticcheck" ] | ||
| text: "SA1019:.*\\.ScalarMult has been deprecated" # elliptic.Curve.ScalarMult | ||
| - linters: [ "staticcheck" ] | ||
| text: "SA1019:.*\\.ScalarBaseMult has been deprecated" # elliptic.Curve.ScalarBaseMult | ||
| - linters: [ "staticcheck" ] | ||
| text: "SA1019:.*\\.IsOnCurve has been deprecated" # elliptic.Curve.IsOnCurve | ||
|
|
||
| formatters: | ||
| enable: | ||
| - "gci" # Enforces package import order. | ||
| - "gofumpt" # Extended go fmt. | ||
| settings: | ||
| gci: | ||
| sections: | ||
| - "standard" | ||
| - "default" | ||
| - "blank" | ||
| - "dot" | ||
| - "localmodule" | ||
| custom-order: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,64 @@ | ||
| MODULE = github.com/bnb-chain/tss-lib/v2 | ||
| PACKAGES = $(shell go list ./... | grep -v '/vendor/') | ||
| # Copyright (c) 2026 Hemi Labs, Inc. | ||
| # Use of this source code is governed by the MIT License, | ||
| # which can be found in the LICENSE file. | ||
|
|
||
| all: protob test | ||
| PROJECTPATH = $(abspath $(dir $(realpath $(firstword $(MAKEFILE_LIST))))) | ||
|
|
||
| ######################################## | ||
| ### Protocol Buffers | ||
| export GOBIN=$(PROJECTPATH)/bin | ||
| export GOCACHE=$(PROJECTPATH)/.gocache | ||
| export GOPKG=$(PROJECTPATH)/pkg | ||
|
|
||
| protob: | ||
| @echo "--> Building Protocol Buffers" | ||
| @for protocol in message signature ecdsa-keygen ecdsa-signing ecdsa-resharing eddsa-keygen eddsa-signing eddsa-resharing; do \ | ||
| echo "Generating $$protocol.pb.go" ; \ | ||
| protoc --go_out=. ./protob/$$protocol.proto ; \ | ||
| done | ||
| # renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver | ||
| GOLANGCI_LINT_VERSION="v2.11.3" | ||
| # renovate: datasource=github-releases depName=joshuasing/golicenser versioning=semver | ||
| GOLICENSER_VERSION="v0.3.1" | ||
| # renovate: datasource=github-releases depName=mvdan/gofumpt versioning=semver | ||
| GOFUMPT_VERSION="v0.9.2" | ||
|
|
||
| build: protob | ||
| go fmt ./... | ||
| cmds = \ | ||
| tss-ecdsa-demo \ | ||
| tss-eddsa-demo \ | ||
|
|
||
| ######################################## | ||
| ### Testing | ||
| .PHONY: all clean deps go-deps $(cmds) build lint lint-deps tidy race test vulncheck vulncheck-deps | ||
|
|
||
| test_unit: | ||
| @echo "--> Running Unit Tests" | ||
| @echo "!!! WARNING: This will take a long time :)" | ||
| go clean -testcache | ||
| go test -timeout 60m $(PACKAGES) | ||
| all: tidy build lint test | ||
|
|
||
| test_unit_race: | ||
| @echo "--> Running Unit Tests (with Race Detection)" | ||
| @echo "!!! WARNING: This will take a long time :)" | ||
| go clean -testcache | ||
| go test -timeout 60m -race $(PACKAGES) | ||
| clean: | ||
| rm -rf $(GOBIN) $(GOCACHE) $(GOPKG) | ||
|
|
||
| test: | ||
| make test_unit | ||
| deps: lint-deps vulncheck-deps go-deps | ||
|
|
||
| go-deps: | ||
| go mod download | ||
| go mod tidy | ||
| go mod verify | ||
|
|
||
| $(cmds): | ||
| go build -trimpath -ldflags "$(GO_LDFLAGS)" -o $(GOBIN)/$@ ./cmd/$@ | ||
|
|
||
| build: | ||
| go build ./... | ||
|
|
||
| ######################################## | ||
| ### Pre Commit | ||
| lint: | ||
| $(shell go env GOPATH)/bin/golangci-lint fmt ./... | ||
| $(shell go env GOPATH)/bin/golangci-lint run --fix ./... | ||
|
|
||
| pre_commit: build test | ||
| lint-deps: | ||
| @echo "Installing with $(shell go env GOVERSION)" | ||
| GOBIN=$(shell go env GOPATH)/bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) | ||
| GOBIN=$(shell go env GOPATH)/bin go install mvdan.cc/gofumpt@$(GOFUMPT_VERSION) | ||
|
|
||
| ######################################## | ||
| tidy: | ||
| go mod tidy | ||
|
|
||
| race: | ||
| go test -v -race -timeout 60m ./... | ||
|
|
||
| test: | ||
| go test -timeout 30m -coverprofile=$(PROJECTPATH)/coverage.out -covermode=atomic ./... | ||
|
|
||
| # To avoid unintended conflicts with file names, always add to .PHONY | ||
| # # unless there is a reason not to. | ||
| # # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html | ||
| .PHONY: protob build test_unit test_unit_race test | ||
| vulncheck: | ||
| $(shell go env GOPATH)/bin/govulncheck ./... | ||
|
|
||
| vulncheck-deps: | ||
| GOBIN=$(shell go env GOPATH)/bin go install golang.org/x/vuln/cmd/govulncheck@latest |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.