Skip to content

Commit

Permalink
Add a comment for exponentiation
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Dec 9, 2024
1 parent 704ed65 commit 841bc8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synedrion/src/tools/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ impl<T: Zeroize> Secret<T> {
V: Integer + crypto_bigint::Bounded + Encoding + ConditionallySelectable,
{
// TODO: do we need to implement our own windowed exponentiation to hide the secret?
// The exponent will be put in a stack array when it's decomposed with a small radix
// for windowed exponentiation. So if it's secret, it's going to leave traces on the stack.
// With the multiplication, for example, there's less danger since Uints implement *Assign traits which we use,
// so theoretically anything secret will be overwritten.
Secret::init_with(|| self.expose_secret().pow_signed_vartime(exponent))
}
}
Expand Down

0 comments on commit 841bc8f

Please sign in to comment.