fn KeccakF(comptime f: u11) type

The Keccak-f permutation.

Parameters

f: u11,

Fields

st: [25]block_comptime = array_mul,

Functions

fn addByte(self: *Self, byte: u8, offset: usize) void

XOR a byte into the state at a given offset.

fn addBytes(self: *Self, bytes: []const u8) void

XOR bytes into the beginning of the state.

fn asBytes(self: *Self) *[block_bytes]u8

A representation of the state as bytes. The byte order is architecture-dependent…

A representation of the state as bytes. The byte order is architecture-dependent.

fn clear(self: *Self, from: usize, to: usize) void

Set the words storing the bytes of a given range to zero.

fn endianSwap(self: *Self) void

Byte-swap the entire state if the architecture doesn’t match the required endian…

Byte-swap the entire state if the architecture doesn’t match the required endianness.

fn extractBytes(self: *Self, out: []u8) void

Extract the first bytes of the state.

fn init(bytes: [block_bytes]u8) Self

Initialize the state from a slice of bytes.

fn permute(self: *Self) void

Apply a full-round permutation to the state.

fn permuteR(self: *Self, comptime rounds: u5) void

Apply a (possibly) reduced-round permutation to the state.

fn secureZero(self: *Self) void

Clear the entire state, disabling compiler optimizations.

fn setBytes(self: *Self, bytes: []const u8) void

Set bytes starting at the beginning of the state.

fn xorBytes(self: *Self, out: []u8, in: []const u8) void

XOR the first bytes of the state into a slice of bytes.

Values

block_bytes
type

Number of bytes in the state.

max_rounds
type

Maximum number of rounds for the given f parameter.