Documentation

CslibFrontier.Crypto.Primitives.ByteString.Blocks

Fixed byte pairs #

This module supplies the two-block convenience wrapper used by hash functions with a 2n-byte input. General indexed block concatenation is already provided, for every carrier, by Cslib.BitString.blocksEquiv.symm.

Main definitions #

Main results #

References #

This is general byte-string infrastructure rather than a formalization of an external result.

def Cslib.Crypto.FixedBytes.pairBlocks {width : ℕ} (left right : FixedBytes width) :
FixedBytes (2 * width)

Concatenate two equal-width byte strings as consecutive blocks, using Fin.append.

@[simp]
theorem Cslib.Crypto.FixedBytes.pairBlocks_left {width : ℕ} (left right : FixedBytes width) (offset : Fin width) :
left.pairBlocks right (finProdFinEquiv (0, offset)) = left offset

The first block of a two-block concatenation is its left input.

@[simp]
theorem Cslib.Crypto.FixedBytes.pairBlocks_right {width : ℕ} (left right : FixedBytes width) (offset : Fin width) :
left.pairBlocks right (finProdFinEquiv (1, offset)) = right offset

The second block of a two-block concatenation is its right input.