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
EncryptionResult struct which we have to return from encrypt() because wasm-bindgen does not support returning tuples has a field ciphertext: Box<[u8]>. Box<[u8]> does not implement Copy, so the field must be private, and we have to define a getter; see rustwasm/wasm-bindgen#439.
Remove the getter when the issue is fixed, or maybe when wasm-bindgen starts supporting tuples.
The text was updated successfully, but these errors were encountered:
@fjarri
I'm not sure I understand what needs to be done here.
This struct as is provides a decent interface through JS like let { ciphertext, capsule } = umbral.encrypt(alice_pk, plaintext_bytes);
which is pretty "tuple like".
For now we're using a custom type (EncryptionResult, declared as TS [Capsule, Uint8Array]) and a manual conversion to js_sys::Array. When wasm-bindgen fixes the underlying issue, the internals can be updated too. The API is now
let [ciphertext1, capsule1] = umbral.encrypt(alice_pk, plaintext1);
EncryptionResult
struct which we have to return fromencrypt()
becausewasm-bindgen
does not support returning tuples has a fieldciphertext: Box<[u8]>
.Box<[u8]>
does not implementCopy
, so the field must be private, and we have to define a getter; see rustwasm/wasm-bindgen#439.Remove the getter when the issue is fixed, or maybe when
wasm-bindgen
starts supporting tuples.The text was updated successfully, but these errors were encountered: