Skip to content

Heap Math exptmod: fixes for valid modulus checks#6599

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
SparkiDev:heapmath_mp_exptmod_fix
Jul 12, 2023
Merged

Heap Math exptmod: fixes for valid modulus checks#6599
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
SparkiDev:heapmath_mp_exptmod_fix

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

Description

mp_exptmod_base_2() uses Montogmery method and does not support even modulus. Added check.
mp_exptmod_fast() uses Montogmery method when odd not when dr > 0. Comment updated at call.
Reduce value of zero doesn't work for mp_reduece_2k. Changed setup of use to check for zero and won't use it. Other methods won't work either.

Fixes zd#16425

Testing

POC with
./configure --disable-shared --enable-heapmath

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

mp_exptmod_base_2() uses Montogmery method and does not support even
modulus. Added check.
mp_exptmod_fast() uses Montogmery method when odd not when dr > 0.
Comment updated at call.
Reduce value of zero doesn't work for mp_reduece_2k. Changed setup of
use to check for zero and won't use it. Other methods won't work either.
@JacobBarthelmeh JacobBarthelmeh merged commit 8c012b5 into wolfSSL:master Jul 12, 2023
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