Function addEntropy [src]

Inserts entropy to refresh the internal state.

Prototype

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

Parameters

self: *Selfbytes: []const u8

Source

pub fn addEntropy(self: *Self, bytes: []const u8) void { comptime std.debug.assert(secret_seed_length % rate == 0); var i: usize = 0; while (i + rate < bytes.len) : (i += rate) { self.state.addBytes(bytes[i..][0..rate]); self.state.permuteR(8); } if (i != bytes.len) self.state.addBytes(bytes[i..]); self.state.permute(); }