~/bend-docscommunity

src/crypto/blake/blake3/compress.bend checks

raw source on the hub · import 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/compress.bend as Compress

2 imports
import Base
import ./types.bend as T

Definitions

def rot16 source · line 6 · raw

@+x:U32 -> U32

def rot12 source · line 9 · raw

@+x:U32 -> U32

def rot8 source · line 12 · raw

@+x:U32 -> U32

def rot7 source · line 15 · raw

@+x:U32 -> U32

def column source · line 19 · raw

@s:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St -> @+m0:U32 -> @+m1:U32 -> @+m2:U32 -> @+m3:U32 -> @+m4:U32 -> @+m5:U32 -> @+m6:U32 -> @+m7:U32 -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St

G on the four columns, message words m0..m7.

def diagonal source · line 57 · raw

@s:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St -> @+m8:U32 -> @+m9:U32 -> @+m10:U32 -> @+m11:U32 -> @+m12:U32 -> @+m13:U32 -> @+m14:U32 -> @+m15:U32 -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St

G on the four diagonals, message words m8..m15.

def round source · line 95 · raw

@s:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St -> @+m0:U32 -> @+m1:U32 -> @+m2:U32 -> @+m3:U32 -> @+m4:U32 -> @+m5:U32 -> @+m6:U32 -> @+m7:U32 -> @+m8:U32 -> @+m9:U32 -> @+m10:U32 -> @+m11:U32 -> @+m12:U32 -> @+m13:U32 -> @+m14:U32 -> @+m15:U32 -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St

One round: the column step then the diagonal step.

def fold source · line 98 · raw

@s:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.CV

def init source · line 106 · raw

@cv:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.CV -> @+t:U32 -> @+len:U32 -> @+flags:U32 -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St

The initial state: the chaining value, IV[0..3], the counter (low word, then the high word, 0: an input has fewer than 2^32 chunks), the block length and the flags.

def rounds7 source · line 113 · raw

@s:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St -> @b:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.Block -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.St

Seven rounds; round r takes the message words in the order of the permutation applied r times (the fixed BLAKE3 schedule).

def compress source · line 120 · raw

@cv:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.CV -> @b:0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.Block -> @+t:U32 -> @+len:U32 -> @+flags:U32 -> 0xd9a2fae439ac7ff9e21e0853948f94fe/src/crypto/blake/blake3/types.CV

The compression function (hash mode, 32-byte output): the new chaining value is the low half of the final state xor its high half.