vacp2p / zerokit

A set of Zero Knowledge modules, written in Rust and designed to be used in other system programming environments.
Apache License 2.0
131 stars 7 forks source link

fix: u64 to usize conversion #153

Closed richard-ramos closed 1 year ago

richard-ramos commented 1 year ago

usize::from_le_bytes will take an array of length 2, 4 or 8 bytes depending on the target pointer size. Since wasm is a 32b platform, it will take 4 bytes instead of the 8 bytes defined by the protocol, so there was a failure while reading serialized values due to the number of bytes read being incorrect. I also update version rln-wasm to 0.0.9 (npm package needs to be updated to include this fix)