Skip to content

tfm fp_exptmod_nct: set result to zero when base is zero#6622

Merged
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
philljj:zd16426
Jul 17, 2023
Merged

tfm fp_exptmod_nct: set result to zero when base is zero#6622
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
philljj:zd16426

Conversation

@philljj
Copy link
Copy Markdown
Contributor

@philljj philljj commented Jul 14, 2023

Description

Fix fp_exptmod_nct to handle special cases:

  • mod = 0: return FP_VAL
  • mod = 1: set result 0
  • exp = 0: set result 1
  • base = 0: set result 0

This makes fp_exptmod_nct behave consistently with sp_exptmod_nct.

Fixes zd#16426

Testing

Tested with reproducers in ticket.

@philljj philljj self-assigned this Jul 14, 2023
@philljj
Copy link
Copy Markdown
Contributor Author

philljj commented Jul 14, 2023

Guido confirmed issue fixed, but he found a second issue. Will put all fixes in this PR.

@philljj
Copy link
Copy Markdown
Contributor Author

philljj commented Jul 17, 2023

Guido confirmed rest of issues fixed.

@philljj philljj assigned JacobBarthelmeh and unassigned philljj Jul 17, 2023
@JacobBarthelmeh JacobBarthelmeh merged commit 67d35ea into wolfSSL:master Jul 17, 2023
@JacobBarthelmeh JacobBarthelmeh mentioned this pull request Jul 17, 2023
@philljj philljj deleted the zd16426 branch July 18, 2023 14:15
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