law to_nat_pack4

lawful-words@0.1.0.0 · proof_bytes.bend:1595

import lawful-words@0.1.0.0/proof_bytes.bend as ProofBytes
import Base
import lawful-words@0.1.0.0/defs.bend as D

1595law to_nat_pack4:
1596  for +b0: U32
1597  for +b1: U32
1598  for +b2: U32
1599  for +b3: U32
1600  for +h0: {U32.is_lt(b0, 256) == True{} : Bool}
1601  for +h1: {U32.is_lt(b1, 256) == True{} : Bool}
1602  for +h2: {U32.is_lt(b2, 256) == True{} : Bool}
1603  for +h3: {U32.is_lt(b3, 256) == True{} : Bool}
1604  {U32.to_nat(D.pack4(b0, b1, b2, b3)) == Nat.add(U32.to_nat(b0), Nat.add(Nat.mul(U32.to_nat(b1), Nat.pow(2n, 8n)), Nat.add(Nat.mul(U32.to_nat(b2), Nat.pow(2n, 16n)), Nat.mul(U32.to_nat(b3), Nat.pow(2n, 24n))))) : Nat}

Uses (14)

Used by (2)