aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/aead
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-05 11:18:17 -0400
committerJack Lloyd <[email protected]>2017-09-05 11:18:17 -0400
commitf5cd933003d36a725a6127fac070b76d4be6d462 (patch)
tree2765b9012c09f3f417a60b6bd0f345288a460b1c /src/lib/modes/aead
parentf82a70b5b379e947c92547cab4b4949dc9748e3d (diff)
Simplify polynomial doubling code
GCC and Clang generate effectively identical code for a template with parameters, vs completely unrolled code as was used previously. Add a little-endian variant so XTS can use it. This extends XTS support to cover 256 and 512-bit ciphers. I was not able to find another implementation that supports both XTS and ciphers with large blocks, so the XTS test vectors are self-generated.
Diffstat (limited to 'src/lib/modes/aead')
-rw-r--r--src/lib/modes/aead/ocb/ocb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/modes/aead/ocb/ocb.cpp b/src/lib/modes/aead/ocb/ocb.cpp
index 42118c25c..aa8532526 100644
--- a/src/lib/modes/aead/ocb/ocb.cpp
+++ b/src/lib/modes/aead/ocb/ocb.cpp
@@ -56,8 +56,8 @@ class L_computer
secure_vector<uint8_t> poly_double(const secure_vector<uint8_t>& in) const
{
- secure_vector<uint8_t> out = in;
- poly_double_n(out.data(), out.size());
+ secure_vector<uint8_t> out(in.size());
+ poly_double_n(out.data(), in.data(), out.size());
return out;
}