Skip to content

Conversation

twiss
Copy link
Member

@twiss twiss commented Dec 10, 2024

Also, set the AEAD chunk size to twice the message size hint (or the actual message size, when known), so that we don't generate an overly large chunk size when the message could fit in a smaller chunk size.

This is useful to reduce the memory usage when en/decrypting AEAD message once ProtonMail/go-crypto#259 is merged.

@twiss twiss requested a review from lubux December 10, 2024 17:39
@twiss twiss force-pushed the message-size-hint branch 2 times, most recently from 704c5e2 to d9f3052 Compare December 10, 2024 17:56
Also, set the AEAD chunk size to twice the message size hint (or the
actual message size, when known), so that we don't generate an overly
large chunk size when the message could fit in a smaller chunk size.
@twiss twiss force-pushed the message-size-hint branch from d9f3052 to 07a6094 Compare December 10, 2024 18:07

type EncryptionProfile interface {
EncryptionConfig() *packet.Config
EncryptionConfig(messageSizeHint uint64) *packet.Config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need more options here in the future without breaking backward compatibility.
What about introducing a struct EncHandleSettings and passing &encHandleSettings instead with default nil?

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