law sm3_streaming

bend-osdev-hashes@0.1.0.0 · LAWS.bend:257

import bend-osdev-hashes@0.1.0.0/LAWS.bend as LAWS
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-hashes@0.1.0.0/hashes.bend as Hs
import bend-osdev-hashes@0.1.0.0/sm3.bend as SM

257# SM3 (GB/T 32905): update over a ++ b is update over a, then b, from every state
258law sm3_streaming:
259  for s: Hs.HsMdState<Hs.HsW8>
260  for +a: B.Octets
261  for +b: B.Octets
262  {SM.HsSm3.update(s, B.Octets.append(a, b)) == SM.HsSm3.update(SM.HsSm3.update(s, a), b) : Hs.HsMdState<Hs.HsW8>}

Uses (7)

Used by (3)