Closed XuNeal closed 6 years ago
Great questions.. I need find some time to review this it has been a while. Some people that might help us (they are probably very busy too with the launch coming up): @arhag @chris-allnutt @heifner
EOS uses the compact signature serialization format, and forces it to be so, to have consistent length. It'll pump up the nonce one by one to make sure it can have a compact format. The goal is to have, for a given payload, one and only one valid signature.
That nonce in the second code is there to tweak the content (it adds "\0x00", then "\0x00\0x00", etc..) when the top-level loop (which is a few calls above in the call stack) detects it didn't produce a "canonical" signature.
You can take a look at the Go implementation (been there too) here: https://github.com/eoscanada/eos-go/blob/master/btcsuite/btcd/btcec/privkey.go#L68 and around that codebase.. like https://github.com/eoscanada/eos-go/blob/master/ecc/privkey.go#L84
https://steemit.com/steem/@dantheman/steem-and-bitshares-cryptographic-security-update
The blog show why the eos require canonical signatures. I will close this issue, thanks @abourget and @jcalfee
Hey everyone I want to known why EOS need the lenR and lenS are both 32 , It's not a requirement in ethereum.
and why to generate a new K by changing the hash.
Is it possible to get the correct K only with the following code?
Thanks