An Ascon state.
The state is represented as 5 64-bit words.
The NIST submission (v1.2) serializes these words as big-endian, but software implementations are free to use native endianness.
Functions
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 initFromWords(initial_state: [5]u64) Self
Initialize the state from u64 words in native endianness.
inline fn permuteR(state: *Self, comptime rounds: u4) void
Apply a reduced-round permutation to the state.
inline fn permuteRatchet(state: *Self, comptime rounds: u4, comptime rate: u6) void
Apply a permutation to the state and prevent backtracking. The rate is expresse…
Apply a permutation to the state and prevent backtracking. The rate is expressed in bytes and must be a multiple of the word size (8).