Giter VIP home page Giter VIP logo

Comments (8)

cromefire avatar cromefire commented on June 12, 2024

Using wasm_bindgen you could easily call a js function the problems are:

  • dependencies are not supposed to call into js themselves
  • you would have to supply the JS side too

from crates.

cromefire avatar cromefire commented on June 12, 2024

But the pro on wasm is that everything is sandboxed and belongs to the browser, so your memory is protected, but I don't know how the browser clears that memory.

from crates.

tarcieri avatar tarcieri commented on June 12, 2024

It looks like bulk memory operations (currently design phase) might be useful for this purpose: https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md

from crates.

cromefire avatar cromefire commented on June 12, 2024

Another approach which might work on stable is to directly emit the WASM necessary to perform a volatile zeroing operation. However, I have never tried that before and wouldn't really know where to start.

Does rust have any way to include things for llvm or assembly?

from crates.

tarcieri avatar tarcieri commented on June 12, 2024

so your memory is protected, but I don't know how the browser clears that memory.

My understanding of the WASM memory model in a browser context is it's TypedArray that lives in the DOM, in which case it would be very nice to ensure secrets are cleared, as otherwise they could get potentially exposed unintentionally (ala Cloudbleed / Jetleak).

Does rust have any way to include things for llvm or assembly?

LLVM intrinsics and inline ASM are only available on nightly. But I'm already using volatile_set_memory there.

In an ELF executable, on stable Rust you can include assembly by first creating an object from it, then link that together with Rust code (by e.g. creating a static library and linking with it using FFI + attributes).

I know very little about Rust WASM so I have no idea what the analogous linking operation for that would be.

from crates.

cromefire avatar cromefire commented on June 12, 2024

Wasm is just like asm there just may be a different Syntax, but I know little about rust and asm so I can't really help there.

from crates.

tarcieri avatar tarcieri commented on June 12, 2024

FYI, I think #142 is the path forward here. I'll look into adding a wasm target to CI.

from crates.

tarcieri avatar tarcieri commented on June 12, 2024

This was fixed in #142, with CI added in #143

from crates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.