Open gnarea opened 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
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):
SignedData.sign()
.SignedData.verify()
.
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.