1
$\begingroup$

I'm trying to setup an ECDSA math example using just integer math and multiply (no EC). The purpose is just to help people understand why this works with out the added complication of understanding EC. However, it looks like I either don't understand something or I'm making a simple math mistake.

Can someone help me fix this?

Here is what I'm doing:

Signer workflow:

private da = 7

G = 2

pubkey = da * G = 14

message z = 10

n = 17

k = 13

k^-1 = 4

x1 = 26

r = 26 mod 17 = 9

s = 4(10 - 9 * 7) mod 17 = 8

Verify workflow:

w = s^-1 = 15

u1 = z * w mod n = 14

u2 = r * w mod n = 16

x2 = u1*G + u2*pubkey = 252

r2 = x2 mod n = 14 <=== failed...??

$\endgroup$
1
$\begingroup$

s = 4(10 - 9 * 7) mod 17 = 8

That should be:

s = 4(10 + 9 * 7) mod 17 = 3

If you modify the rest of the example to account for this, the example works.

$\endgroup$
  • $\begingroup$ Thanks, I stared at that forever and didn't see that :) $\endgroup$ – big_fish_small_pond Apr 16 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.