Skip to content

docs: correct RSA-OAEP plaintext size limit - #339

Merged
HamdaanAliQuatil merged 1 commit into
google:masterfrom
mfazrinizar:fix/rsa-oaep-plaintext-limit-docs
Jul 24, 2026
Merged

docs: correct RSA-OAEP plaintext size limit#339
HamdaanAliQuatil merged 1 commit into
google:masterfrom
mfazrinizar:fix/rsa-oaep-plaintext-limit-docs

Conversation

@mfazrinizar

@mfazrinizar mfazrinizar commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Corrects the documented RSA-OAEP plaintext size limit.

The previous formula mixed bit and byte units and stated that a 2048-bit RSA key with SHA-256 could encrypt 191 bytes. The PKCS #1 limit is: modulusByteLength - 2 * hashByteLength - 2

For a 2048-bit key with SHA-256, the maximum plaintext size is 190 bytes.

This updates both the reusable RSA-OAEP message-size documentation and the encryptBytes documentation. There are no behavior changes.

Testing

  • dart format --output=none --set-exit-if-changed .
  • dart analyze
  • dart doc --dry-run
  • dart test test/webcrypto_test.dart -p vm -n RSA-OAEP
  • git diff --check

@mfazrinizar
mfazrinizar marked this pull request as ready for review July 24, 2026 18:40

@HamdaanAliQuatil HamdaanAliQuatil left a comment

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.

lgtm :)

@HamdaanAliQuatil
HamdaanAliQuatil merged commit f5a2cb3 into google:master Jul 24, 2026
15 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