Skip to content

Megolm doc: nitpicking question about ratchet #15

@dest4

Description

@dest4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions