Presently iam working on a project that uses elliptic curve. Please provide me a solution that determines whether a point is on the elliptic curve or not? and also how to get a point on the elliptic curve
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Checking whether a point is on the elliptic curve is easy. Just check whether your point
(x,y)
fulfills the equation defining your elliptic curve :y^2 = x^3 + ax + b
(remember to perform the calculation in the correct field).Using Bouncycastle you can do it like this:
You have tagged the question with cryptography, so I assume you are asking about elliptic curves over a finite field. The curve will have a generator, g and an order. To get a random point, just generate a random integer, x, between 0 and (order - 1), and choose x * g.
You can do it using Bouncycastle like this:
without knowing what language your formula would be:
x^3+b - y^2 = 0
if this is not true then your point is not on the curve. i wrote a javascript implementation using big-integer like this:
if you would like to see an implementation of just the math for verification, addition, doubling, multiplication and subtraction see these links:
https://www.npmjs.com/package/simple-js-ec-math
https://github.com/Azero123/simple-js-ec-math
i suggest following this guide if you are learning how elliptic curve math works:
https://eng.paxos.com/blockchain-101-foundational-math
and there are numerous descriptions online of how to improve performance of your code:
https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication