Skip to content

Use byte size when padding encrypted sessions - #62

Merged
ioquatix merged 1 commit into
rack:mainfrom
OskarEichler:songstats/byte-size-session-padding
Sep 1, 2026
Merged

Use byte size when padding encrypted sessions#62
ioquatix merged 1 commit into
rack:mainfrom
OskarEichler:songstats/byte-size-session-padding

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

  • calculate encrypted-session padding from serialized bytes rather than characters
  • preserve the documented byte-multiple contract for multibyte JSON payloads
  • leave Marshal/binary payload behavior unchanged

With serialize_json: true, a multibyte value currently produces ciphertext whose payload is not a multiple of pad_size (for example, 17 bytes with pad_size: 16).

Verification

  • focused V1/V2 model fails on release/current and passes this candidate with accented and emoji JSON values
  • both versions retain successful encrypt/decrypt round trips
  • full suite: 192 runs, 307 assertions, 0 failures/errors
  • syntax and diff checks pass

@ioquatix ioquatix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@ioquatix
ioquatix merged commit 06d1b89 into rack:main Sep 1, 2026
20 checks 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