1
0
Fork 0
mirror of https://github.com/Luzifer/wasm-openssl.git synced 2024-11-13 00:52:48 +00:00
wasm-openssl/index.js

16 lines
443 B
JavaScript
Raw Normal View History

function decryptResponse(plaintext) {
console.log(["decryptResponse", plaintext])
}
function encryptResponse(ciphertext) {
console.log(["encryptResponse", ciphertext])
decrypt(ciphertext, "password", decryptResponse)
}
function wasmStartSuccess() {
encrypt("Knut", "password", encryptResponse)
}
const go = new Go()
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then(async obj => await go.run(obj.instance))