ExWapp.AppState.LTHash (ExWapp v0.1.2)

Copy Markdown View Source

Linked-list Truncated Hash for WhatsApp App State integrity verification.

Maintains a 128-byte hash that tracks the state of all applied mutations via pointwise u16 little-endian arithmetic with wrapping.

Matches whatsmeow appstate/lthash/lthash.go.

Summary

Functions

Add MACs to the hash state.

Create a new empty LTHash (128 zero bytes).

Subtract MACs from the hash state.

Subtract old MACs then add new MACs to the hash state.

Functions

add(hash, macs)

@spec add(binary(), [binary()]) :: binary()

Add MACs to the hash state.

new()

@spec new() :: binary()

Create a new empty LTHash (128 zero bytes).

subtract(hash, macs)

@spec subtract(binary(), [binary()]) :: binary()

Subtract MACs from the hash state.

subtract_then_add(hash, subtract_macs, add_macs)

@spec subtract_then_add(binary(), [binary()], [binary()]) :: binary()

Subtract old MACs then add new MACs to the hash state.

Returns updated 128-byte hash.

Matches whatsmeow LTHash.SubtractThenAdd().