With padding guaranteeing a multiple of 64 bytes, the padded message is cut into the fixed 64-byte blocks the compression function consumes. Today you build that split and index into it.
Cut a padded byte array into consecutive 64-byte blocks.
The compression function works one 64-byte block at a time, so the last step before hashing is to cut the padded message into those blocks. Because padding always yields a multiple of 64 bytes, this is a clean walk in 64-byte strides with no remainder to worry about - a padding of 128 bytes gives 2 blocks, a padding of 64 gives 1.
This closes the input pipeline: raw bytes go in, get padded to a block boundary,
and come out as an ordered list of 64-byte blocks ready to feed the schedule and
compression stages. Pin that "abc" yields a single block whose fourth byte
(index 3) is the 0x80 marker sitting right after a, b, c - proof the
padding and the split line up. In chapter 4 you will loop over exactly these
blocks, threading the hash state from one to the next.
// padded length is always a multiple of 64, so this divides evenlyfunc Blocks(padded []byte) [][]byte {var out [][]bytefor i := 0; i < len(padded); i += 64 {out = append(out, padded[i:i+64])}return out}