Fix deal backward compatibility#607
Conversation
|
🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer. |
|
I have been trying to wrap my head around fixing the serialization problem that we have between V3 and V4. I tried my best to boil it down to the source of the problem. Warning: pavé ahead. So, it all starts from the fact that we needed to switch all the TL;DRBecause of the changes from But, we also have 3 occurrences where |
I really need feedback to know if this is really a fair assumption. I really don't think that there is a way to make V4 compatible with V3 without forcing users to adapt how they serialize if they want to introduce V4. I especially think this is not a big deal for Kyber users (?) |
|
Tests don't pass because of |
|
For now I have skipped test with 32b architectures because the tests compare with V3 which does not handle 32b architectures (because of the use of |
| go.dedis.ch/protobuf v1.0.11 | ||
| golang.org/x/crypto v0.44.0 | ||
| golang.org/x/sys v0.38.0 | ||
| google.golang.org/protobuf v1.36.11 |
There was a problem hiding this comment.
does this remove dependency of kyber v4 on dedis version of protobuf ?
There was a problem hiding this comment.
Nope. Since Deal is encoded and decoded internally, we need in V4 to follow the same encoding as V3 to ensure compatibility and this encoding uses protobuf. Although, we only need to do this in two places so we could potentially mock the encoding/decoding process to remove this dependency.
| suitev3 "go.dedis.ch/kyber/v3/group/edwards25519" | ||
| suitev4 "go.dedis.ch/kyber/v4/group/edwards25519" | ||
|
|
||
| kyberV3 "go.dedis.ch/kyber/v3" |
There was a problem hiding this comment.
shouldn't we put this test in kyber-test to avoid direct dependency on kyber v3 ?
There was a problem hiding this comment.
Yes absolutely ! It's only there for now because I needed to be able to modify v4
There was a problem hiding this comment.
agreed, let's try not to depend on the previous version in the new version
|
I would assume you're right. It might be also very helpful for the user to have an example on what and how to adapt their code from V3 to V4. |
AnomalRoil
left a comment
There was a problem hiding this comment.
A few changes and suggestions
| suitev3 "go.dedis.ch/kyber/v3/group/edwards25519" | ||
| suitev4 "go.dedis.ch/kyber/v4/group/edwards25519" | ||
|
|
||
| kyberV3 "go.dedis.ch/kyber/v3" |
There was a problem hiding this comment.
agreed, let's try not to depend on the previous version in the new version
| message EncryptedDeal { | ||
| required bytes dhkey = 1; | ||
| required bytes signature = 2; | ||
| required bytes cipher = 4; | ||
| } | ||
|
|
||
| message EncryptedDealV3 { | ||
| required bytes dhkey = 1; | ||
| required bytes signature = 2; | ||
| optional bytes nonce = 3; | ||
| required bytes cipher = 4; | ||
| } |
There was a problem hiding this comment.
do you really need both? I thought Protobuf would handle "unknown" fields like nonce nicely, thus only needing the first one
There was a problem hiding this comment.
Make sure to add a note to the README.md about how to generate this, and potentially a go generate instuction to generate these, along with a Github Action that checks generated code hasn't been changed (re-generate it in a GHA and then checks git status is clean)
|
This PR has been addressed completely by #619 |



Fix compatibility issues between V3 and V4 when
Dealstruct is being encoded in VSS (both Pedersen and Rabin) and DKG. See this comment below for more information.Depends on #604