# Get bit representation of an elliptic curve group element

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 close merge delete

Maybe like that:

hex(hash(R))

( 2018-12-03 21:22:56 +0200 )edit

Sort by » oldest newest most voted

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.

more