Ask Your Question
0

Get bit representation of an elliptic curve group element

asked 2018-12-03 04:38:55 -0600

panther gravatar image

I can define an elliptic curve using

E = EllipticCurve(GF(97), [2,3])

I can then compute a group on E using

G = E.abelian_group()

I can then sample a random element in the group using

R = G.random_element()

Is there a way I can get a bit string representation of this group element R? Actually, I am implementing a pseudo-random generator scheme, which finally outputs a group element on elliptic curve. I need to convert it to a bit string.

edit retag flag offensive close merge delete

Comments

Maybe like that:

hex(hash(R))
FrédéricC gravatar imageFrédéricC ( 2018-12-03 14:22:56 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2018-12-10 19:10:42 -0600

dan_fulea gravatar image

I tried:

sage: E = EllipticCurve(GF(97), [2,3])
sage: P = E.random_point()
sage: P
(22 : 5 : 1)
sage: x, y, z = P
sage: x, y, z
(22, 5, 1)
sage: bin(x), bin(y), bin(z)
('0b10110', '0b101', '0b1')
sage: ZZ(x).binary(), ZZ(y).binary(), ZZ(z).binary()
('10110', '101', '1')

Note that since $97$ is not a power of two, there is no structural path from the random point (components) to the binaries... It is just a way to "(en)code" the data.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-12-03 04:38:55 -0600

Seen: 54 times

Last updated: Dec 10