diff options
author | Jack Lloyd <[email protected]> | 2018-11-28 10:35:17 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-11-28 10:35:17 -0500 |
commit | 007314c530eb12d414ced07515f8cbc25a0f64f5 (patch) | |
tree | dc887f97efa0248aa5e7b8468c94145f6a1305f8 /src/lib/mac/poly1305/poly1305.cpp | |
parent | b03f38f57d4f50ace1ed8b57d83ba70eb5bc1dfb (diff) |
Add CT::Mask type
Diffstat (limited to 'src/lib/mac/poly1305/poly1305.cpp')
-rw-r--r-- | src/lib/mac/poly1305/poly1305.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/mac/poly1305/poly1305.cpp b/src/lib/mac/poly1305/poly1305.cpp index 32027b8d0..333a21a1a 100644 --- a/src/lib/mac/poly1305/poly1305.cpp +++ b/src/lib/mac/poly1305/poly1305.cpp @@ -119,10 +119,10 @@ void poly1305_finish(secure_vector<uint64_t>& X, uint8_t mac[16]) uint64_t g2 = h2 + c - (static_cast<uint64_t>(1) << 42); /* select h if h < p, or h + -p if h >= p */ - c = CT::expand_mask<uint64_t>(c); - h0 = CT::select(c, g0, h0); - h1 = CT::select(c, g1, h1); - h2 = CT::select(c, g2, h2); + const auto c_mask = CT::Mask<uint64_t>::expand(c); + h0 = c_mask.select(g0, h0); + h1 = c_mask.select(g1, h1); + h2 = c_mask.select(g2, h2); /* h = (h + pad) */ const uint64_t t0 = X[6]; |