aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-05-16 23:23:17 +0000
committerlloyd <[email protected]>2014-05-16 23:23:17 +0000
commitc7f871820646481207532e051fb464ede3f028ba (patch)
treeddf73fa79b161870656f3ad946ccb99faeaeac86 /src/lib/modes
parent6c9a2d2ebe59b7c5a501c86f7f080696ac2ea5b3 (diff)
Correct CCM for L != 2. Bugzilla 270
Diffstat (limited to 'src/lib/modes')
-rw-r--r--src/lib/modes/aead/ccm/ccm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/modes/aead/ccm/ccm.cpp b/src/lib/modes/aead/ccm/ccm.cpp
index 50fc38738..7fd92e149 100644
--- a/src/lib/modes/aead/ccm/ccm.cpp
+++ b/src/lib/modes/aead/ccm/ccm.cpp
@@ -118,7 +118,7 @@ void CCM_Mode::encode_length(size_t len, byte out[])
BOTAN_ASSERT(len_bytes < sizeof(size_t), "Length field fits");
for(size_t i = 0; i != len_bytes; ++i)
- out[i] = get_byte(sizeof(size_t)-i, len);
+ out[len_bytes-1-i] = get_byte(sizeof(size_t)-1-i, len);
BOTAN_ASSERT((len >> (len_bytes*8)) == 0, "Message length fits in field");
}