You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
This is going to be similar to this issue, but I feel like this is a better place for it since it seems like the error is coming from the JS code generation. First, the code:
#[macro_use]externcrate arrayref;use wasm_bindgen::{JsValue, throw_str};use grammers_crypto::aes::{ige_encrypt as _ige_encrypt, ige_decrypt as _ige_decrypt};use wasm_bindgen::prelude::{wasm_bindgen};#[wasm_bindgen]pubfnige_encrypt(plaintext:&[u8],key:&[u8],iv:&[u8]) -> Result<Vec<u8>,JsValue>{if plaintext.len() % 16 != 0{throw_str("plaintext must be divisible by 16")}if key.len() != 32{throw_str("key must contain 32 bits")}if iv.len() != 32{throw_str("key must contain 32 bits")}Ok(_ige_encrypt(plaintext,array_ref!(key,0,32),array_ref!(iv,0,32)))}
I've omitted the ige_decrypt method for brevity.
When generating a JS file for this code using the command: rustwasmc build --target deno I end up with a mostly correct file. The error seems to be happening the it comes to setting the wasi_snapshot_preview1 key on the imports object. Instead of assigning the key to the existing object, it overwrites the object entirely.
This is going to be similar to this issue, but I feel like this is a better place for it since it seems like the error is coming from the JS code generation. First, the code:
I've omitted the
ige_decrypt
method for brevity.When generating a JS file for this code using the command:
rustwasmc build --target deno
I end up with a mostly correct file. The error seems to be happening the it comes to setting thewasi_snapshot_preview1
key on theimports
object. Instead of assigning the key to the existing object, it overwrites the object entirely.Here are the relevant code snippets:
Hope this is enough info. I'm running the latest version of rustwasmc currently, 0.1.28.
The text was updated successfully, but these errors were encountered: