Skip to content

Add config.maxArgon2MemoryExponent for argon2 memory limit#1943

Merged
larabr merged 2 commits into
mainfrom
argon2-config-max-memory
Dec 11, 2025
Merged

Add config.maxArgon2MemoryExponent for argon2 memory limit#1943
larabr merged 2 commits into
mainfrom
argon2-config-max-memory

Conversation

@larabr

@larabr larabr commented Dec 5, 2025

Copy link
Copy Markdown
Collaborator

This limit is applied both on encryption (if config.s2kType is set to enums.s2k.argon2) and decryption.
If the input memory exponent exceeds this value, the library will not attempt the argon2 key derivation and instead directly throw an Argon2OutOfMemoryError error.

This setting is useful in environments with constrained memory that may crash due to large Argon2 memory allocation rather than throwing an out of memory error.

This limit is applied both on encryption (if `config.s2kType` is set to `enums.s2k.argon2`)
and decryption.
If the input memory exponent exceeds this value, the library will not attempt the argon2 key
derivation and instead directly throw an `Argon2OutOfMemoryError` error.
@larabr larabr force-pushed the argon2-config-max-memory branch from 40b071c to 870e383 Compare December 9, 2025 14:08
@larabr larabr merged commit 81d8639 into main Dec 11, 2025
18 checks passed
@twiss twiss deleted the argon2-config-max-memory branch December 11, 2025 17:11
larabr added a commit to larabr/openpgpjs that referenced this pull request Jan 21, 2026
…js#1943)

Add `config.maxArgon2MemoryExponent` for argon2 memory limit

This limit is applied both on encryption (if `config.s2kType` is set to `enums.s2k.argon2`)
and decryption.
If the input memory exponent exceeds this value, the library will not attempt the argon2 key
derivation and instead directly throw an `Argon2OutOfMemoryError` error.
larabr added a commit to ProtonMail/openpgpjs that referenced this pull request Mar 12, 2026
…js#1943)

Add `config.maxArgon2MemoryExponent` for argon2 memory limit

This limit is applied both on encryption (if `config.s2kType` is set to `enums.s2k.argon2`)
and decryption.
If the input memory exponent exceeds this value, the library will not attempt the argon2 key
derivation and instead directly throw an `Argon2OutOfMemoryError` error.
larabr added a commit to ProtonMail/openpgpjs that referenced this pull request Mar 12, 2026
…js#1943)

Add `config.maxArgon2MemoryExponent` for argon2 memory limit

This limit is applied both on encryption (if `config.s2kType` is set to `enums.s2k.argon2`)
and decryption.
If the input memory exponent exceeds this value, the library will not attempt the argon2 key
derivation and instead directly throw an `Argon2OutOfMemoryError` error.
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