further changes

This commit is contained in:
rymnc 2023-12-09 14:43:42 +05:30
parent 9a22bca6f0
commit e22535dce7
No known key found for this signature in database
GPG Key ID: AAA088D5C68ECD34
4 changed files with 9 additions and 19 deletions

12
Cargo.lock generated
View File

@ -3759,9 +3759,9 @@ dependencies = [
[[package]]
name = "wasm-encoder"
version = "0.26.0"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05d0b6fcd0aeb98adf16e7975331b3c17222aa815148f5b976370ce589d80ef"
checksum = "1ba64e81215916eaeb48fee292f29401d69235d62d8b8fd92a7b2844ec5ae5f7"
dependencies = [
"leb128",
]
@ -4100,9 +4100,9 @@ dependencies = [
[[package]]
name = "wast"
version = "57.0.0"
version = "64.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6eb0f5ed17ac4421193c7477da05892c2edafd67f9639e3c11a82086416662dc"
checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc"
dependencies = [
"leb128",
"memchr",
@ -4112,9 +4112,9 @@ dependencies = [
[[package]]
name = "wat"
version = "1.0.63"
version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab9ab0d87337c3be2bb6fc5cd331c4ba9fd6bcb4ee85048a0dd59ed9ecf92e53"
checksum = "53253d920ab413fca1c7dc2161d601c79b4fdf631d0ba51dd4343bf9b556c3f6"
dependencies = [
"wast",
]

View File

@ -2,23 +2,14 @@
#[cfg(test)]
mod tests {
use js_sys::{Object, Uint8Array};
use js_sys::Uint8Array;
use rln::circuit::Fr;
use rln::hashers::{hash_to_field, poseidon_hash};
use rln::utils::{bytes_le_to_fr, fr_to_bytes_le, normalize_usize};
use rln_wasm::*;
use wasm_bindgen::{prelude::*, JsValue};
use wasm_bindgen::JsValue;
use wasm_bindgen_test::wasm_bindgen_test;
#[wasm_bindgen(module = "src/utils.js")]
extern "C" {
#[wasm_bindgen(catch)]
fn read_file(path: &str) -> Result<Uint8Array, JsValue>;
#[wasm_bindgen(catch)]
async fn calculateWitness(circom_path: &str, input: Object) -> Result<JsValue, JsValue>;
}
#[wasm_bindgen_test]
pub async fn test_basic_flow() {
// Creating an instance of RLN

View File

@ -1 +0,0 @@
pub const VERIFICATION_KEY_20: &str = "{\"protocol\":\"groth16\",\"curve\":\"bn128\",\"nPublic\":5,\"vk_alpha_1\":[\"20491192805390485299153009773594534940189261866228447918068658471970481763042\",\"9383485363053290200918347156157836566562967994039712273449902621266178545958\",\"1\"],\"vk_beta_2\":[[\"6375614351688725206403948262868962793625744043794305715222011528459656738731\",\"4252822878758300859123897981450591353533073413197771768651442665752259397132\"],[\"10505242626370262277552901082094356697409835680220590971873171140371331206856\",\"21847035105528745403288232691147584728191162732299865338377159692350059136679\"],[\"1\",\"0\"]],\"vk_gamma_2\":[[\"10857046999023057135944570762232829481370756359578518086990519993285655852781\",\"11559732032986387107991004021392285783925812861821192530917403151452391805634\"],[\"8495653923123431417604973247489272438418190587263600148770280649306958101930\",\"4082367875863433681332203403145435568316851327593401208105741076214120093531\"],[\"1\",\"0\"]],\"vk_delta_2\":[[\"17077735495685170943380938230836408503627170115414840315502244846025577589191\",\"14030085636943255545683322474441991939484590437387381169642530788494152024614\"],[\"11568745146423307387256571230823432454624378106569286849514884592874522611163\",\"1838524899938769516485895655063198583192139511330418290063560641219523306282\"],[\"1\",\"0\"]],\"vk_alphabeta_12\":[[[\"2029413683389138792403550203267699914886160938906632433982220835551125967885\",\"21072700047562757817161031222997517981543347628379360635925549008442030252106\"],[\"5940354580057074848093997050200682056184807770593307860589430076672439820312\",\"12156638873931618554171829126792193045421052652279363021382169897324752428276\"],[\"7898200236362823042373859371574133993780991612861777490112507062703164551277\",\"7074218545237549455313236346927434013100842096812539264420499035217050630853\"]],[[\"7077479683546002997211712695946002074877511277312570035766170199895071832130\",\"10093483419865920389913245021038182291233451549023025229112148274109565435465\"],[\"4595479056700221319381530156280926371456704509942304414423590385166031118820\",\"19831328484489333784475432780421641293929726139240675179672856274388269393268\"],[\"11934129596455521040620786944827826205713621633706285934057045369193958244500\",\"8037395052364110730298837004334506829870972346962140206007064471173334027475\"]]],\"IC\":[[\"4920513730204767532050733107749276406754520419375654722016092399980613788208\",\"10950491564509418434657706642388934308456795265036074733953533582377584967294\",\"1\"],[\"6815064660695497986531118446154820702646540722664044216580897159556261271171\",\"17838140936832571103329556013529166877877534025488014783346458943575275015438\",\"1\"],[\"16364982450206976302246609763791333525052810246590359380676749324389440643932\",\"17092624338100676284548565502349491320314889021833923882585524649862570629227\",\"1\"],[\"3679639231485547795420532910726924727560917141402837495597760107842698404034\",\"16213191511474848247596810551723578773353083440353745908057321946068926848382\",\"1\"],[\"9215428431027260354679105025212521481930206886203677270216204485256690813172\",\"934602510541226149881779979217731465262250233587980565969044391353665291792\",\"1\"],[\"8935861545794299876685457331391349387048184820319250771243971382360441890897\",\"4993459033694759724715904486381952906869986989682015547152342336961693234616\",\"1\"]]}";

View File

@ -29,7 +29,7 @@ const ZKEY_BYTES: &[u8] = include_bytes!("../resources/tree_height_20/rln_final.
const VK_BYTES: &[u8] = include_bytes!("../resources/tree_height_20/verification_key.json");
const WASM_BYTES: &[u8] = include_bytes!("../resources/tree_height_20/rln.wasm");
pub const WASM_BYTES: &[u8] = include_bytes!("../resources/tree_height_20/rln.wasm");
// The following types define the pairing friendly elliptic curve, the underlying finite fields and groups default to this module
// Note that proofs are serialized assuming Fr to be 4x8 = 32 bytes in size. Hence, changing to a curve with different encoding will make proof verification to fail