diff --git a/src/uint/gcd.rs b/src/uint/gcd.rs index 1b7959291..777cdd0fc 100644 --- a/src/uint/gcd.rs +++ b/src/uint/gcd.rs @@ -398,7 +398,15 @@ impl Xgcd for Uint { } fn xgcd_vartime(&self, rhs: &Uint) -> Self::Output { - // TODO(#853): implement vartime + // TODO(#853): implement variable-time version. + // + // NOTE: this currently delegates to the constant-time `xgcd` implementation. + // Callers expecting variable-time performance should be aware that this runs + // in constant time and may be significantly slower than a true vartime algorithm. + // + // WARNING: when issue #853 is resolved, this will switch to a variable-time + // implementation. Callers that currently rely on constant-time behavior for + // security properties MUST NOT use `xgcd_vartime`. self.xgcd(rhs) } } @@ -411,7 +419,15 @@ impl Xgcd for NonZeroUint { } fn xgcd_vartime(&self, rhs: &NonZeroUint) -> Self::Output { - // TODO(#853): implement vartime + // TODO(#853): implement variable-time version. + // + // NOTE: this currently delegates to the constant-time `xgcd` implementation. + // Callers expecting variable-time performance should be aware that this runs + // in constant time and may be significantly slower than a true vartime algorithm. + // + // WARNING: when issue #853 is resolved, this will switch to a variable-time + // implementation. Callers that currently rely on constant-time behavior for + // security properties MUST NOT use `xgcd_vartime`. self.xgcd(rhs) } } @@ -424,7 +440,15 @@ impl Xgcd for OddUint { } fn xgcd_vartime(&self, rhs: &OddUint) -> Self::Output { - // TODO(#853): implement vartime + // TODO(#853): implement variable-time version. + // + // NOTE: this currently delegates to the constant-time `xgcd` implementation. + // Callers expecting variable-time performance should be aware that this runs + // in constant time and may be significantly slower than a true vartime algorithm. + // + // WARNING: when issue #853 is resolved, this will switch to a variable-time + // implementation. Callers that currently rely on constant-time behavior for + // security properties MUST NOT use `xgcd_vartime`. self.xgcd(rhs) } }