Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Megolm doc: nitpicking question about ratchet #15

Closed
dest4 opened this issue Sep 27, 2018 · 6 comments
Closed

Megolm doc: nitpicking question about ratchet #15

dest4 opened this issue Sep 27, 2018 · 6 comments

Comments

@dest4
Copy link

dest4 commented Sep 27, 2018

Hi,
I do not fully understand the following sentence in the Megolm doc.

This scheme allows the ratchet to be advanced an arbitrary amount forwards while needing at most 1023 hash computations.

If I understood correctly the way the ratchet advances, the worst case scenario would be to advance from i=0 to i=2^32 - 1, assuming that i is a 32-bit counter that cannot overflow (can it?).

  • 255 forwards would be needed to go from i=0 to i=2^32 - 2^24
  • 255 forwards would be needed to go from i=2^32 - 2^24 to i=2^32 - 2^16
  • 255 forwards would be needed to go from i=2^32 - 2^16 to i=2^32 - 2^8
  • 255 forwards would be needed to go from i=2^32 - 2^8 to i=2^32 - 1

That makes 1020 hash computations, not 1023. Am I wrong?
Not that it's particularly important, but I am afraid to have an erroneous understanding of the whole thing.

@ara4n
Copy link
Member

ara4n commented Sep 27, 2018

it sounds to me like a mental arithmetic thinko; the difference between 4*(2^8 - 1) and (4*2^8) - 1. @richvdh, does this sound right?

@richvdh
Copy link
Member

richvdh commented Sep 27, 2018

@richvdh, does this sound right?

yes.

@dest4
Copy link
Author

dest4 commented Sep 28, 2018

OK thanks for the clarification

@ara4n
Copy link
Member

ara4n commented May 20, 2019

this got fixed back in sept.

@ara4n ara4n closed this as completed May 20, 2019
@ara4n
Copy link
Member

ara4n commented May 20, 2019

...except it didn't.

@ara4n ara4n reopened this May 20, 2019
@ara4n
Copy link
Member

ara4n commented May 20, 2019

now fixed in https://gitlab.matrix.org/matrix-org/olm/commit/214908ace54604da669b015cfda7c0496918dfc0

@ara4n ara4n closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants