Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Make sure milagro-crypto-js formats G1 and G2 points to conform to eth2.0 spec #5

Open
noot opened this issue Jan 10, 2019 · 5 comments

Comments

@noot
Copy link
Contributor

noot commented Jan 10, 2019

From the eth2.0 spec:
https://github.com/ethereum/eth2.0-specs/blob/master/specs/bls_signature.md

A point in G1 is represented as a 384-bit integer z decomposed as a 381-bit integer x and three 1-bit flags in the top bits
A point in G2 is represented as a pair of 384-bit integers (z1, z2). We decompose z1 as above into x1, a_flag1, b_flag1, c_flag1 and z2 into x2, a_flag2, b_flag2, c_flag2.

Not sure at how milagro-crypto formats G1 and G2 points. Need to make sure they conform to the spec. We will need to fork milagro-crypto if they don't.

@mpetrunic
Copy link
Member

This is format used by mcl (mcl-wasm): https://github.com/herumi/mcl#serialization-format-of-g1-and-g2 Note: everything should be little endian

This is format used by eth2.0: https://github.com/zkcrypto/pairing/tree/master/src/bls12_381#serialization

I'm not really sure if we can use this the way it is, and no idea how to implement it in c++.

@GregTheGreek
Copy link
Member

@mpetrunic Still relevant?

@mpetrunic
Copy link
Member

Only if we get someone to implement this interface using herumi implementation.

@GregTheGreek
Copy link
Member

ok ill put this on ice for now

@stale
Copy link

stale bot commented Aug 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot:stale label Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants