Skip to main content

key_to_regs

Function key_to_regs 

Source
pub fn key_to_regs(key: &Key) -> (u64, u64)
Expand description

Pack a Key (≤ MAX_KEY_LEN bytes) into two registers for storage in a kernel-assisted unit handle (Gas{meter_key} / Quota{quota_key}): the key bytes little-endian-packed into the first register, the byte length into the second. Inverse of key_from_regs.

§Panics

Panics if the key is longer than MAX_KEY_LEN (8) bytes — the register packing has no room, and silently truncating would alias two distinct keys.