Skip to content

Instantly share code, notes, and snippets.

@nlitsme
Last active June 28, 2024 15:36
Show Gist options
  • Save nlitsme/529dcf0ba3ffa6434286dc0f9a64f373 to your computer and use it in GitHub Desktop.
Save nlitsme/529dcf0ba3ffa6434286dc0f9a64f373 to your computer and use it in GitHub Desktop.
comparing EdDSA with Secp256k1 sigining
Secp256k1 EdDSA
message m = hash(M) M, given
privkey . given
private-key x, given x = low32(sha512(privkey))
signing-secret k, given k = sha512(high32(sha512(privkey)) // M)
privkey-to-pubkey Y = G * x Y = G * x
calc-R R = G * k R = G * k
r-value r = R.x r = SHA512(R // Y // M)
s-value s = (m + x * r) / k s = k + x * r
signature (r, s) (R, s)
verify R*s = G*m + Y*r G*s == R + Y*r

with // I mean concatatation. EdDSA from rfc8032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment