Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argon2: reload wasm module after timeout when using memory heavy params #199

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

larabr
Copy link
Collaborator

@larabr larabr commented Apr 11, 2024

We manually reload the module if no memory-heavy (128MB+) argon2 computation has been requested in a while, to deallocate the memory.
This is better than reloading the module every time (automatically done if the memory exceeds Argon2S2K.ARGON2_WASM_MEMORY_THRESHOLD_RELOAD), as doing so comes with a performance hit.

…rams

We manually reload the module if no memory-heavy (128MB+) argon2 computation has been requested
in a while, to deallocate the memory.
This is better than reloading the module every time (automatically done if the memory exceeds
`Argon2S2K.ARGON2_WASM_MEMORY_THRESHOLD_RELOAD`),
as doing so comes with a performance hit.
@larabr larabr marked this pull request as draft April 11, 2024 14:49
lib/crypto/argon2.ts Outdated Show resolved Hide resolved
lib/crypto/argon2.ts Show resolved Hide resolved
@larabr larabr marked this pull request as ready for review April 12, 2024 09:21
@larabr larabr merged commit 3520bb5 into ProtonMail:main Apr 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants