AwalaApp / specs

Awala Protocol Suite Specifications
https://specs.awala.network
Creative Commons Attribution Share Alike 4.0 International
5 stars 1 forks source link

Signing large RAMF payloads takes too long and requires too much memory #57

Open gnarea opened 4 years ago

gnarea commented 4 years ago

Serialising payloads of up to 8 MiB takes too long in the JS library and results in heap space issues on the JVM.

Those issues go away when the content is detached, so we should detach it. This regression was introduced in #52.

This is just a tactical change for the signature of large payloads. Encrypting such payloads remains an issue and it's tracked on #14.

gnarea commented 4 years ago

This is no longer an issue on the JS implementation since changing the PKI.js backend to a pure Node.js one: https://github.com/relaycorp/relaynet-core-js/commit/d2d293476479f705051c1f1c0c6564dc096f3036

gnarea commented 2 years ago

This issue is back in the JS implementation, although I think it's for a different reason: The original problem was that we were using a slow WebCrypto implementation (for RSA-PSS+SHA-256 at least), but now the problem seems to be the ASN.1 DER serialisation... So we must absolutely detach the plaintext. (Something must've changed in asn1js or PKI.js)

This is how long it's taking to process an 8 MiB RAMF message with the JS implementation on my computer (which is quite powerful):