diff options
Diffstat (limited to 'src/lib/math/numbertheory/numthry.cpp')
-rw-r--r-- | src/lib/math/numbertheory/numthry.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/math/numbertheory/numthry.cpp b/src/lib/math/numbertheory/numthry.cpp index 6c3d2c931..71dbf6aba 100644 --- a/src/lib/math/numbertheory/numthry.cpp +++ b/src/lib/math/numbertheory/numthry.cpp @@ -358,6 +358,9 @@ word monty_inverse(word input) y1 = y; } + const word check = y2 * input; + BOTAN_ASSERT_EQUAL(check, 1, "monty_inverse result is inverse of input"); + // Now invert in addition space y2 = (MP_WORD_MAX - y2) + 1; |