Author

Topic: how to pow work with elliptic curve (Read 40 times)

legendary
Activity: 2128
Merit: 1884
Verified Bitcoin Hodler
GPT is silly:)

I have readed a lot of sources.

in all exponential in ecdlp is rewriten as multiplicative in the group.

and I really do not know why.


Are you sure? It is supposed to be additive. DLP is multiplicative.
jr. member
Activity: 211
Merit: 105
GPT is silly:)

I have readed a lot of sources.

in all exponential in ecdlp is rewriten as multiplicative in the group.

and I really do not know why.
legendary
Activity: 2128
Merit: 1884
Verified Bitcoin Hodler
scalar multiplication on elliptic curves and exponentiation modulo n are governed by different mathematical structures.

That is why you got two different results.

Ain't ChatGPT a beautiful thing?
jr. member
Activity: 211
Merit: 105
I will explain:


let n -> order of the group - choosed as secp256k1

 n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141


we have our generaror as G in secp256k1:

G.x = 55066263022277343669578718895168534326250603453777594175500187360389116729240
G.y = 32670510020758816978083085130507043184471273380659243275938904335757337482424


now when I do :
res = G * (n-2)

result  is  -2*G but with negate y.


now lets :
generator is 2 as DLP:

when I will do with the same order:
pow(2,n-2,n)

I got resultat 57896044618658097711785492504343953926418782139537452191302581570759080747169

which is half point of G of secp256k1

why not n-2?
legendary
Activity: 2128
Merit: 1884
Verified Bitcoin Hodler


HI , it is maybe silly questions.

I have something like in pure python:

d = pow(g, f*(n-2) ,n)

where:  g - generator as integer
            f -  some int value
            n - order

I would like to know how to write in elliptic curve where g is a point?



You mean something like this?: https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication

COBRAS is right, it is easy to find out the answer on this one. Literally just inserted your question into ChatGPT:

Code:
from ecdsa import SECP256k1, ellipticcurve

# SECP256k1 curve
curve = SECP256k1.curve
G = SECP256k1.generator

# Parameters
f = 5  # some integer value
n = G.order()  # the order of the generator point

# Scalar multiplication on elliptic curve
scalar = f * (n - 2)

# Perform scalar multiplication with the generator point
D = scalar * G

# The result D is a point on the elliptic curve
print(f"Resulting point D: ({D.x()}, {D.y()})")

member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
jr. member
Activity: 211
Merit: 105


HI , it is maybe silly questions.

I have something like in pure python:

d = pow(g, f*(n-2) ,n)

where:  g - generator as integer
            f -  some int value
            n - order

I would like to know how to write in elliptic curve where g is a point?

Jump to: