Skip to content

Instantly share code, notes, and snippets.

@tjsharp1
Created January 16, 2024 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjsharp1/6cc5423f161b0a74c7398d62f905f34b to your computer and use it in GitHub Desktop.
Save tjsharp1/6cc5423f161b0a74c7398d62f905f34b to your computer and use it in GitHub Desktop.
ZK Hack puzzle #1 write-up
The solution to this puzzle has to do with the fact that only the x-coordinate
of an elliptic curve point is used as the leaf node. However there are 2 possible
points with the same x-coordinate, so we just need to find the other one.
If the given point is (secret * G), we need to find (-secret * G), to find the other point.
`leaked_secret` is specified in `MNT4BigFr`, but the x-coordinate is computed over `MNT6BigFr`,
so we need to compute `-leaked_secret % M` with `M` being the modulus of `MNT6BigFr`.
We can do that by computing MNT6BigFr::MODULUS - leaked_secret.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment