-
Notifications
You must be signed in to change notification settings - Fork 286
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
fix signing issue if the message is leading with 0x00 #284
Conversation
Hi @zargarzadehm Thanks for submitting codes! It will work well, however The PR will change m from big.Int to bytes, it will change the interface of NewLocalParty which are highly depended by upstreams. I would recommend use big.Int.FillBytes() when necessary. Could you have an update on it accordingly? |
yeah, I will update ASAP! |
@ZhAnGeek |
@zargarzadehm Hi, Zarg I kinda get lost, the signData does not need to be changed, I push a simple codes master...ZhAnGeek:tss-lib:example-filling-bytes, you could check if this could be adapted. You could also check if any potential backoffs and we're welcome for your discussions. (maybe it is now not available to sign bytes pure less than 32) |
By If you have another option for discussion instead of Github tell me! |
Yeah I think so, what about adding an optional parameters fullBytes/fullBytesLen, and constraint them in the signing(check if consistent to the big.Int value), which could be compatible to the old function. |
We can have an optional parameter FullBytesLen to NewLocalParty for the size of bigInt and if the size is set we will use FillBytes otherwise use Bytes (like the old function) |
Sounds great! we could do that way. |
I added an interface
|
ecdsa/signing/finalize.go
Outdated
@@ -61,14 +61,20 @@ func (round *finalization) Start() *tss.Error { | |||
round.data.S = padToLengthBytesInPlace(sumS.Bytes(), bitSizeInBytes) | |||
round.data.Signature = append(round.data.R, round.data.S...) | |||
round.data.SignatureRecovery = []byte{byte(recid)} | |||
round.data.M = round.temp.m.Bytes() | |||
common.Logger.Infof("checkkkkkkk %v", round.temp.fullBytesLen == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
,logger removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
ecdsa/signing/local_party_test.go
Outdated
@@ -95,7 +95,7 @@ signing: | |||
go updater(parties[dest[0].Index], msg, errCh) | |||
} | |||
|
|||
case <-endCh: | |||
case xx := <-endCh: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg or signdata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
Ahh I suggested you can change it to optional parameters as well, this is an interface use for HD, should be dependent |
Fix leading zero
ok, as I know there isn't optional input in Golang functions but as an alternative solution I used Variadic Parameters for FullBytesLength parameter and the merge is ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg
@ZhAnGeek |
@zargarzadehm |
for issue #264