oasisprotocol / deoxysii-js

JavaScript Deoxys-II-256-128
https://www.npmjs.com/package/@oasisprotocol/deoxysii
MIT License
6 stars 1 forks source link

Port to WebAssembly #39

Open CedarMist opened 6 months ago

CedarMist commented 6 months ago

Neither TypeScript nor JavaScript are great when it comes to performance or constant-time guarantees, notably they don't have a native Uint32 or Uint64 type

It would be nice to have a simple and minimal WebAssembly implementation with no dependencies which can be imported and used from any JavaScript compatible environment that also supports WebAssembly.

Not sure if we'd want to use the Rust or Go implementations, or rewrite in AssemblyScript.

kostko commented 6 months ago

Has the Wasm CT support landed by now? Otherwise Wasm is no better for CT as well.

CedarMist commented 6 months ago

Not sure tbh, the main concern is speed, both the TypeScript and JavaScript implementations are abysmally slow and there's not much that can be done there.

For the Sapphire JS client speed isn't much of a concern but would be nice. Likewise, constant-time isn't critical for the Sapphire JS client as I can't think of any situations where there's enough real-time interaction for side-channels to be a massive concern.