def unpack

bend-collections@1.0.0.0 · src/crypto/aes/gcm.bend:66

import bend-collections@1.0.0.0/src/crypto/aes/gcm.bend as Gcm
import Base

66# The 16 bytes of a block, and the block of 16 bytes (big-endian words).
67def unpack(z: Block) -> List<&2, U32>:
68  match z:
69    case B{+a, +b, +c, +d}:
70      [U32.and(255, U32.shrn(a, 24n)), U32.and(255, U32.shrn(a, 16n)), U32.and(255, U32.shrn(a, 8n)), U32.and(255, a),
71       U32.and(255, U32.shrn(b, 24n)), U32.and(255, U32.shrn(b, 16n)), U32.and(255, U32.shrn(b, 8n)), U32.and(255, b),
72       U32.and(255, U32.shrn(c, 24n)), U32.and(255, U32.shrn(c, 16n)), U32.and(255, U32.shrn(c, 8n)), U32.and(255, c),
73       U32.and(255, U32.shrn(d, 24n)), U32.and(255, U32.shrn(d, 16n)), U32.and(255, U32.shrn(d, 8n)), U32.and(255, d)]

Uses (5)

Used by (2)