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

chore!: Modify functionality of commitRoot to use groupToField #151

Closed
wants to merge 2 commits into from

Conversation

kevaundray
Copy link
Contributor

@kevaundray kevaundray commented Feb 18, 2024

Rationale

For the Java library, this will eventually reduce the API surface needed. commitRoot will essentially become a call to commitToScalar + groupToField.

This issue expands on the rationale: crate-crypto/rust-verkle#86


There are some geth and go-verkle PRs which would be good to merge before merging this (Leaving this as a Draft while those are open)

Signed-off-by: Kevaundray Wedderburn <[email protected]>
…se groupToField instead of commitment.to_bytes

Signed-off-by: Kevaundray Wedderburn <[email protected]>
@kevaundray kevaundray changed the title chore!: Modify functionality of commitRoot to use groupToField chore!: Modify functionality of commitRoot to use groupToField Feb 18, 2024
/// TODO: We can remove this method as its the same as calling commit and then groupToField
/// TODO: This has not been done because it is a breaking API change, that changes the bindings.
/// TODO: Once downstream besu-verkle switches to using commit and then groupToField, making this
/// TODO: method unused, then we can remove it.
#[no_mangle]
pub extern "system" fn Java_org_hyperledger_besu_nativelib_ipamultipoint_LibIpaMultipoint_commitRoot(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This means that besu-verkle does not need to be modified to make it match the other implementations.

};

let updated_commitment = ffi_interface::update_commitment_sparse(
&CONFIG,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As of the recent rust-verkle -- most methods just take a CONFIG to make the downstream callers job easier and the API simpler

@kevaundray
Copy link
Contributor Author

Tests should be failing since hard coded test vectors for commitRoot were not updated

@kevaundray
Copy link
Contributor Author

Closing as we don't want to modify commitRoot since mapToScalarField is not invertible

@kevaundray kevaundray closed this Mar 7, 2024
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.

1 participant