Skip to content

Pad to multiples of 128 bytes, rather than to a random length.#58

Merged
rfk merged 1 commit intomainfrom
pad-to-fixed-size
Mar 24, 2021
Merged

Pad to multiples of 128 bytes, rather than to a random length.#58
rfk merged 1 commit intomainfrom
pad-to-fixed-size

Conversation

@rfk
Copy link
Copy Markdown
Contributor

@rfk rfk commented Mar 24, 2021

This is one of the padding techniques suggested in the RFC, and while
we can't choose a default scheme that will work well for all applications,
this one at least seems easier to reason about.

Fixes #54.

This is one of the padding techniques suggested in the RFC, and while
we can't choose a default scheme that will work well for all applications,
this one at least seems easier to reason about.

Fixes #54.
@rfk rfk requested a review from jrconlin March 24, 2021 07:28
@rfk
Copy link
Copy Markdown
Contributor Author

rfk commented Mar 24, 2021

@jrconlin thank you for your review on #59! Just a friendly /cc to make sure you saw this one as well, as this PR needs to land first to avoid conflicting changes.

Comment thread src/aes128gcm.rs
// the "key_id" to store the exchanged public key since we don't cache the key_ids.
// Code fails if the key_id is not a public key length field.
const ECE_AES128GCM_PAD_SIZE: usize = 1;
pub(crate) const ECE_AES128GCM_PAD_SIZE: usize = 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

part of me REALLY wants this to be just ECE_PAD_SIZE and kinda force the point by requiring the package if you want to use both (e.g. aes128gcm.ECE_PAD_SIZE), but that might lead to unintended bugs.

@rfk rfk merged commit dc1c446 into main Mar 24, 2021
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.

Pad to multiples of a fixed size, rather than padding randomly

2 participants