Skip to main content
Computes the Keccak-256 hash of a byte sequence with custom padding. This function allows hashing arbitrary byte sequences by providing the input as 64-bit words in little-endian format and a final partial word.

Signature

Arguments

  • input - Array of complete 64-bit words in little-endian format
  • last_input_word - Final partial word (if any)
  • last_input_num_bytes - Number of valid bytes in the final word (0-7)

Returns

The 32-byte Keccak-256 hash as a little-endian u256

Panics

Panics if last_input_num_bytes is greater than 7.

Examples