mirror of
https://github.com/Luzifer/wasm-openssl.git
synced 2024-11-13 00:52:48 +00:00
16 lines
443 B
JavaScript
16 lines
443 B
JavaScript
|
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))
|