From b2365dbd4b6744d2ad2aacd692f63f555ff11414 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 4 Sep 2018 14:59:35 +0200 Subject: [PATCH] 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. --- sys/zuse.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/zuse.hoon b/sys/zuse.hoon index 6843f6501..70e9b9050 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -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)) ==