def add

bend-collections@1.0.0.0 · src/crypto/chacha/core.bend:122

import bend-collections@1.0.0.0/src/crypto/chacha/core.bend as Core
import Base

122# Word-wise sum of two states (the feed-forward).
123def add(a: State, b: State) -> State:
124  match a b:
125    case S{x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15} S{y0,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15}:
126      S{U32.add(x0,y0),U32.add(x1,y1),U32.add(x2,y2),U32.add(x3,y3),U32.add(x4,y4),U32.add(x5,y5),U32.add(x6,y6),U32.add(x7,y7),U32.add(x8,y8),U32.add(x9,y9),U32.add(x10,y10),U32.add(x11,y11),U32.add(x12,y12),U32.add(x13,y13),U32.add(x14,y14),U32.add(x15,y15)}

Uses (2)

Used by (1)