Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are infinite affine coordinates converted incorrectly for Ethereum compatibility? #30

Open
whyamiroot opened this issue Nov 17, 2022 · 0 comments

Comments

@whyamiroot
Copy link

whyamiroot commented Nov 17, 2022

I have noticed that ark_bn254::G1Affine and ark_bn254::G2Affine are not equal themselves after a round trip of converting to and from respective crate::ethereum::G1 and crate::ethereum::G2 types.

Example:

let g1 = G1Affine::default();
let g1_eth = G1::from(&g1);
let g1_2 = G1Affine::from(g1_eth);
assert_eq!(g1, g1_2);

g1 is represented as:

GroupAffine { x: Fp256(BigInteger256([0, 0, 0, 0])), y: Fp256(BigInteger256([15230403791020821917, 754611498739239741, 7381016538464732716, 1011752739694698287])), infinity: true }

g1_2 is represented as:
GroupAffine { x: Fp256(BigInteger256([0, 0, 0, 0])), y: Fp256(BigInteger256([15230403791020821917, 754611498739239741, 7381016538464732716, 1011752739694698287])), infinity: false }

Similar situation happens with G2Affine -> G2 -> G2Affine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@whyamiroot and others