Skip to content

Check that integer representation of message is smaller than modulus#1503

Merged
jasonkatonica merged 1 commit into
IBM:java11from
KostasTsiounis:rsa_check_j11
Jun 2, 2026
Merged

Check that integer representation of message is smaller than modulus#1503
jasonkatonica merged 1 commit into
IBM:java11from
KostasTsiounis:rsa_check_j11

Conversation

@KostasTsiounis
Copy link
Copy Markdown
Member

In RSA cipher operations, the message is converted into an integer that needs to be smaller than the public key's modulus.

A check is added to fail early with the proper message, instead of failing during the actual operation with a not so helpful message.

An additional test to verify that behaviour is introduced as well.

Back-ported from: #1252

Signed-off-by: Kostas Tsiounis kostas.tsiounis@ibm.com

In RSA cipher operations, the message is converted into an integer
that needs to be smaller than the public key's modulus.

A check is added to fail early with the proper message, instead of
failing during the actual operation with a not so helpful message.

Additional tests to verify that behaviour are introduced as well.

Signed-off-by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
Copy link
Copy Markdown
Collaborator

@taoliult taoliult left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@jasonkatonica jasonkatonica left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonkatonica jasonkatonica merged commit 4a3f671 into IBM:java11 Jun 2, 2026
3 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.

4 participants