-
Notifications
You must be signed in to change notification settings - Fork 179
Adapt protobuf test #611
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
Merged
thehoul
merged 25 commits into
backward-compatible-marshalling
from
adapt-protobuf-test
Feb 27, 2026
Merged
Adapt protobuf test #611
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
64bda1a
change tests using kyber to v4
thehoul a143d30
fix protobuf tests
thehoul 66d7bbc
fix protobuf test for 32B by removing encoding of type "int"
thehoul b87fd20
remove kyberv3 no longer needed for protobuf tests
thehoul f27f516
add back max int32 test
thehoul 5c3bd1a
add tests for errors in array_test.go
thehoul 428eeed
add exported error and match on them in tests
thehoul cb33eb1
add max int64 test in array_test.go
thehoul 5342ae4
initialize points in vartime encoding test to avoid testing with empt…
thehoul 923acff
fix max int64 test
thehoul 5711fbf
change all imports to internal protobuf
thehoul adbfe9e
remove protobuf from go.mod
thehoul d8a5d7c
add marshaling for share.PriShare
thehoul d73d712
add marshaling for Pedersen VSS Deal
thehoul 126814b
add marshaling for Rabin VSS Deal
thehoul 59db926
move Rabin VSS Deal marhsalling to vss.go
thehoul 4f4dbeb
move Pedersen VSS Deal marhsalling to vss.go
thehoul 0905d6c
use Marshal method in Rabin DKG instead of protobuf
thehoul 81a587c
fix Pedersen tests
thehoul 45d1ee0
unexport adapter structs for VSS and PriShare
thehoul 0822b59
swap TypeOf for TypeFor
thehoul 0a0985e
add check before casting int64 to uint32
thehoul 1fd29b9
add doc in v3marshaling.go
thehoul 6358fb4
add doc in vss.go for both Rabin and Pedersen
thehoul 1743700
Update internal/v3marshaling.go
thehoul 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
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
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,40 @@ | ||
| //go:build !constantTime | ||
|
|
||
| package protobuf | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| "go.dedis.ch/kyber/v4" | ||
| "go.dedis.ch/kyber/v4/suites" | ||
| ) | ||
|
|
||
| // TestInterfaceVartime runs the same test as TestInterface but using a suite available | ||
| // only in vartime (bn256) | ||
| func TestInterfaceVartime(t *testing.T) { | ||
| type Points struct { | ||
| P1 kyber.Point | ||
| P2 kyber.Point | ||
| } | ||
|
|
||
| bn256 := suites.MustFind("bn256.adapter") | ||
| ed25519 := suites.MustFind("ed25519") | ||
|
|
||
| RegisterInterface(func() interface{} { return bn256.Point() }) | ||
| RegisterInterface(func() interface{} { return ed25519.Point() }) | ||
|
|
||
| pp := Points{ | ||
| P1: bn256.Point().Pick(bn256.XOF([]byte("test"))), | ||
| P2: ed25519.Point().Pick(ed25519.XOF([]byte("test"))), | ||
| } | ||
|
|
||
| buf, err := Encode(&pp) | ||
| require.NoError(t, err) | ||
|
|
||
| var dpp Points | ||
| err = Decode(buf, &dpp) | ||
| require.NoError(t, err) | ||
| require.Equal(t, pp.P1.String(), dpp.P1.String()) | ||
| require.Equal(t, pp.P2.String(), dpp.P2.String()) | ||
| } |
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
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.