aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory/monty_exp.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-11-28 10:35:17 -0500
committerJack Lloyd <[email protected]>2018-11-28 10:35:17 -0500
commit007314c530eb12d414ced07515f8cbc25a0f64f5 (patch)
treedc887f97efa0248aa5e7b8468c94145f6a1305f8 /src/lib/math/numbertheory/monty_exp.cpp
parentb03f38f57d4f50ace1ed8b57d83ba70eb5bc1dfb (diff)
Add CT::Mask type
Diffstat (limited to 'src/lib/math/numbertheory/monty_exp.cpp')
-rw-r--r--src/lib/math/numbertheory/monty_exp.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/math/numbertheory/monty_exp.cpp b/src/lib/math/numbertheory/monty_exp.cpp
index 2b5bbd81d..7590005a0 100644
--- a/src/lib/math/numbertheory/monty_exp.cpp
+++ b/src/lib/math/numbertheory/monty_exp.cpp
@@ -85,10 +85,12 @@ void const_time_lookup(secure_vector<word>& output,
BOTAN_ASSERT(vec.size() >= words,
"Word size as expected in const_time_lookup");
- const word mask = CT::is_equal<word>(i, nibble);
+ const auto mask = CT::Mask<word>::is_equal(i, nibble);
for(size_t w = 0; w != words; ++w)
- output[w] |= (mask & vec[w]);
+ {
+ output[w] |= mask.if_set_return(vec[w]);
+ }
}
}