mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-16 02:22:12 +03:00
Remove nonstandard 27 minimum value from ecdsa signature v
Ethereum uses 27/28 (superseded) or 35/36 for the v value. Other use cases may want the recovery value directly. This makes it produce 0/1.
This commit is contained in:
parent
abd6329725
commit
b2365dbd4b
@ -4188,7 +4188,7 @@
|
||||
=+ [r y]=(jc-mul g k)
|
||||
=/ s (pro.n `@`(inv.n k) `@`(sum.n z (mul r prv)))
|
||||
=/ big-s (gte (mul 2 s) ^n)
|
||||
:* v=(add 27 (mix (end 0 1 y) ?:(big-s 1 0)))
|
||||
:* v=(mix (end 0 1 y) ?:(big-s 1 0))
|
||||
r=r
|
||||
s=?.(big-s s (sub ^n s))
|
||||
==
|
||||
|
Loading…
Reference in New Issue
Block a user