aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-03-01 18:06:53 -0500
committerJack Lloyd <[email protected]>2020-03-01 18:06:53 -0500
commit82f70474edd9da7a14f4b398df95b93c15ee608a (patch)
tree9f57845855db447f1e6bd03424344e25e8f2bfbc /src/lib
parent2bd07b94d00bde361163c05cd209214803863535 (diff)
Clarify const-time guarantees of inverse_mod function [ci skip]
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/math/numbertheory/numthry.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/math/numbertheory/numthry.h b/src/lib/math/numbertheory/numthry.h
index 831636490..4266543cf 100644
--- a/src/lib/math/numbertheory/numthry.h
+++ b/src/lib/math/numbertheory/numthry.h
@@ -77,8 +77,11 @@ BigInt BOTAN_PUBLIC_API(2,0) lcm(const BigInt& x, const BigInt& y);
BigInt BOTAN_PUBLIC_API(2,0) square(const BigInt& x);
/**
-* Modular inversion. This algorithm is const time as long as
-* x is less than modulus
+* Modular inversion. This algorithm is const time with respect to x,
+* as long as x is less than modulus. It also avoids leaking
+* information about the modulus, except that it does leak which of 3
+* categories the modulus is in: an odd integer, a power of 2, or some
+* other even number.
*
* @param x a positive integer
* @param modulus a positive integer