staticrypt icon indicating copy to clipboard operation
staticrypt copied to clipboard

Refactor signedMsg buffer to avoid large buffer copy.

Open jimhark opened this issue 5 months ago • 0 comments

Summary

Replace signedMsg buffer with authEncryptionData object with iv, encrypted, and hmac properties.

Problem or Use Case

signedMsg is a buffer built by appending hmac + iv + encrypted data. Encrypted data is (about) the size of the .html file which can be arbitrarily large. Creating multiple copies increases RAM requirements and limits the maximum file size that can be supported.

Proposed Solution

To avoid an in-memory copy, instead use an authEncryptionData object with iv, encrypted, and hmac properties, so references are used instead of copies.

Additional Context

This is part of a push to reduce RAM requirements so larger HTML files can be supported.

Related Issues or Pull Requests

Builds on issue #215

jimhark avatar Jul 20 '25 20:07 jimhark