mirror of
https://github.com/vacp2p/zerokit.git
synced 2026-01-09 22:47:56 -05:00
feat(rln): Add custom iden3 graph data support for RLN (#286)
Brought back functionality that was removed during the migration to iden3 - Modify circuit module to include graph data loading and calculation - Update RLN struct to store graph data - Adjust proof generation and FFI methods to use graph data - Update benchmarks and tests to use sample size instead of measurement time - Add new methods for graph data retrieval and handling
This commit is contained in:
committed by
GitHub
parent
5c60ec7cce
commit
de9c0d5072
@@ -428,6 +428,16 @@ mod test {
|
||||
let zkey_data = &Buffer::from(&zkey_buffer[..]);
|
||||
let vk_data = &Buffer::from(&vk_buffer[..]);
|
||||
|
||||
let graph_data = "./resources/tree_height_20/graph.bin";
|
||||
let mut graph_file = File::open(&graph_data).expect("no file found");
|
||||
let metadata = std::fs::metadata(&graph_data).expect("unable to read metadata");
|
||||
let mut graph_buffer = vec![0; metadata.len() as usize];
|
||||
graph_file
|
||||
.read_exact(&mut graph_buffer)
|
||||
.expect("buffer overflow");
|
||||
|
||||
let graph_data = &Buffer::from(&graph_buffer[..]);
|
||||
|
||||
// Creating a RLN instance passing the raw data
|
||||
let mut rln_pointer_raw_bytes = MaybeUninit::<*mut RLN>::uninit();
|
||||
let tree_config = "".to_string();
|
||||
@@ -436,6 +446,7 @@ mod test {
|
||||
TEST_TREE_HEIGHT,
|
||||
zkey_data,
|
||||
vk_data,
|
||||
graph_data,
|
||||
tree_config_buffer,
|
||||
rln_pointer_raw_bytes.as_mut_ptr(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user