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: Remove direct dependency on ipa-multipoint #144

Merged
merged 13 commits into from
Jan 29, 2024
Merged
3 changes: 1 addition & 2 deletions ipa-multipoint/ipa_multipoint_jni/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ repository = "https://github.com/hyperledger/besu-native"
edition = "2018"

[dependencies]
ffi_interface = { git = "https://github.com/crate-crypto/rust-verkle", rev = "ea7d2bd" }
ipa-multipoint = { git = "https://github.com/crate-crypto/rust-verkle", rev = "ea7d2bd" }
ffi_interface = { git = "https://github.com/crate-crypto/rust-verkle", rev = "185ccf14678ae4d2277547e2f2615933f10553b5" }
jni = { version = "0.19.0", features = [
"invocation",
] } # We use invocation in tests.
Expand Down
12 changes: 1 addition & 11 deletions ipa-multipoint/ipa_multipoint_jni/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@

use std::convert::TryInto;

use ipa_multipoint::committer::DefaultCommitter;
use ipa_multipoint::crs::CRS;
use jni::objects::JClass;
use jni::sys::jbyteArray;
use jni::JNIEnv;
use once_cell::sync::Lazy;

pub struct Config {
committer: DefaultCommitter,
}

// TODO: Use a pointer here instead. This is only being used so that the interface does not get changed.
// TODO: and bindings do not need to be modified.
pub static CONFIG: Lazy<Config> = Lazy::new(|| {
let crs = CRS::default();
let committer = DefaultCommitter::new(&crs.G);
Config { committer }
});
pub static CONFIG: Lazy<ffi_interface::Context> = Lazy::new(|| ffi_interface::Context::default());

/// Pedersen hash receives an address and a trie index and returns a hash calculated this way:
/// H(constant || address_low || address_high || trie_index_low || trie_index_high)
Expand Down
Loading