Commit fae8daca authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

Add a comment explaining Mark's latest fix

parent 19a7fb5d
...@@ -116,6 +116,11 @@ void megolm_advance_to(Megolm *megolm, uint32_t advance_to) { ...@@ -116,6 +116,11 @@ void megolm_advance_to(Megolm *megolm, uint32_t advance_to) {
((advance_to >> shift) - (megolm->counter >> shift)) & 0xff; ((advance_to >> shift) - (megolm->counter >> shift)) & 0xff;
if (steps == 0) { if (steps == 0) {
/* deal with the edge case where megolm->counter is slightly larger
* than advance_to. This should only happen for R(0), and implies
* that advance_to has wrapped around and we need to advance R(0)
* 256 times.
*/
if (advance_to < megolm->counter) { if (advance_to < megolm->counter) {
steps = 0x100; steps = 0x100;
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment