以太坊椭圆曲线Specp256k1经过消息的hash和签名(对消息的hash的签名)来恢复出公钥和计算r值

源代码 https://github.com/ethereum/go-ethereum/blob/master/crypto/secp256k1/secp256.go git

// RecoverPubkey returns the the public key of the signer.
// msg must be the 32-byte hash of the message to be signed.
// sig must be a 65-byte compact ECDSA signature containing the
// recovery id as the last element.
RecoverPubkey(msg []byte, sig []byte)

其中”sig must be a 65-byte compact ECDSA signature containing the recovery id as the last element.“,说明了最后一个recovery id指的是 rG的x坐标。github

 

 

。。。细节以后解释。element

相关文章
相关标签/搜索