I'm trying to understand the step by step process of ECDSA signature. The function should be as follows: S = k^-1 (hash + dA * R) mod p
, but I'm trying to understand whether I'm implementing it correctly. In order to run an example, I'll borrow an actual use-case from Bitcoin.
The variables will be as follows:
hash: 13981225937542801152472832285710043259607809420725863171548640618989758767092
k: 11253563012059685825953619222107823549092147699031672238385790369351542642469
dA: 32678163117146052705943574521051490808324525286453391448021727749576063492292
p: 115792089237316195423570985008687907853269984665640564039457584007908834671663
R: 36422191471907241029883925342251831624200921388586025344128047678873736520530
First part I'm trying to understand, is what does k^-1 mean. Is it an inversed version of k (same way it's used when generating a public key)? Assuming that it is, we end up with the following equation:
S = 46845980742442032273496636384730466168994452136155887088844811385771348454723 * (13981225937542801152472832285710043259607809420725863171548640618989758767092 + 32678163117146052705943574521051490808324525286453391448021727749576063492292 * 36422191471907241029883925342251831624200921388586025344128047678873736520530) MOD 115792089237316195423570985008687907853269984665640564039457584007908834671663
Which gives us 47948206650808861643197644356522075407904568696590364200235146232910054391376
and in hex: 6A01B9263C7233181FEE2661C53E75C14312A7F4A2426EAEEA3502DCC40F7E50
.
However, its length seems to be only half of a valid signature. Did I do the math correctly? Is this only a part of the signature and the rest is generated separately?