DoxigAlpha

addByte

XOR a byte into the state at a given offset.

Function parameters

Parameters

#
self:*Self
byte:u8
offset:usize

An Ascon state.

Functions

#
State
An Ascon state.

Source

Implementation

#
pub fn addByte(self: *Self, byte: u8, offset: usize) void {
    const z = switch (endian) {
        .big => 64 - 8 - 8 * @as(u6, @truncate(offset % 8)),
        .little => 8 * @as(u6, @truncate(offset % 8)),
    };
    self.st[offset / 8] ^= @as(u64, byte) << z;
}