jam.state.utils.key_constructor module
- jam.state.utils.key_constructor.construct_state_key(input: U8 | int | Tuple[U32, U32] | Tuple[U32, ByteArray32]) ByteArray32[source]
State key constructor function C as defined in Appendix D. Maps inputs to a 32-byte hash according to three cases: 1. Single U8 index i -> [i, 0, 0, …] 2. (i, s) where i is U32 and s is ServiceId -> [i, n₀, 0, n₁, 0, n₂, 0, n₃, 0, 0, …] where n = E₄(s) 3. (s, h) where s is ServiceId and h is 32-byte array -> [n₀, h₀, n₁, h₁, n₂, h₂, n₃, h₃, h₄, h₅, …, h₂₇] where n = E₄(s)