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

C bindings for verkle ipa #227

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Richa-iitr
Copy link

No description provided.

@Richa-iitr Richa-iitr changed the title C bindings for verily spa C bindings for verily ipa Dec 14, 2024
@Richa-iitr Richa-iitr marked this pull request as draft December 14, 2024 07:56
@Richa-iitr Richa-iitr changed the title C bindings for verily ipa C bindings for verkle ipa Dec 14, 2024
Copy link
Contributor

@NickSneo NickSneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didnt go through constantine repo files, initial review.
Will need to update the JAVA functions according to the current implementation as in ipa-multipoint module

}

// Declare native methods
public static native int ipa_commit(byte[] r, int r_len, byte[] inputs, int inputs_len);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need to change the params of these functions according to current implementation. For example like this -

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes for verkle we need all the methods listed in LibIpaMulitpoint

you can ignore verifyPreStateRoot for the moment

// Declare native methods
public static native int ipa_commit(byte[] r, int r_len, byte[] inputs, int inputs_len);
public static native int ipa_prove(byte[] r, int r_len, byte[] inputs, int inputs_len);
public static native int ipa_verify(byte[] r, int r_len, byte[] inputs, int inputs_len);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for all other functions, check with current implementation of what args it is taking and what should be the return type.

public void testCommit() {
byte[] inputs = new byte[128];

byte[] result = LibConstantineEIP196.add(inputs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests shall be updated

}

// Verkle functions
int ipa_commit_aff(const ctt_eth_verkle_ipa_polynomial_eval_crs *crs, banderwagon_ec_aff res, const ctt_eth_verkle_ipa_polynomial_eval_poly *poly) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update JAVA bindings functions according to these

@NickSneo
Copy link
Contributor

Also sign DCO for all commits

@matkt
Copy link
Contributor

matkt commented Dec 16, 2024

you have a list of tests in this package that you can use to verify your implementation https://github.com/hyperledger/besu-native/tree/d5504630332af07a22d519436dcfcbda2de3b134/ipa-multipoint/src/test/java/org/hyperledger/besu/nativelib/ipa_multipoint .
Not complete but a good starting point

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 this pull request may close these issues.

3 participants