What is Nostr?
bitcoinmotherfucker / The Raven of Wall Street!
npub12lz…zgyj
2023-04-06 14:30:47
in reply to nevent1q…zaqs

bitcoinmotherfucker on Nostr: #[0] covert below ruby to to python def double(point) # slope = (3x₁² + a) / 2y₁ ...

dave (npub1tsg…htk4) covert below ruby to to python def double(point)
# slope = (3x₁² + a) / 2y₁
slope = ((3 * point[:x] ** 2 + $a) * inverse((2 * point[:y]), $p)) % $p # using inverse to help with division

# x = slope² - 2x₁
x = (slope ** 2 - (2 * point[:x])) % $p

# y = slope * (x₁ - x) - y₁
y = (slope * (point[:x] - x) - point[:y]) % $p

# Return the new point
return { x: x, y: y }
end
Author Public Key
npub12lzel6hetkr8r7vnzvh0lghgm0qr4msk4rzx2uw28amhtc83qvvq8ezgyj