authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2020-09-29 14:01:08+02:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2020-09-29 14:01:08+02:00
log56d820087d712c3b3e93e8aeed8d556509050479
tree78e5f3ac76ec178b8ffc2b0ed5aac8b542cdb8e6
parent4194714965a8080e6faa87d9859cc90aab07fe54

gimli: make permute a constant, remove leading underscore


1 files changed, 3 insertions(+), 9 deletions(-)

lib/std/crypto/gimli.zig+3-9
......@@ -38,7 +38,7 @@ pub const State = struct {
3838 return mem.sliceAsBytes(self.data[0..]);
3939 }
4040
41 fn _permute_unrolled(self: *Self) void {
41 fn permute_unrolled(self: *Self) void {
4242 const state = &self.data;
4343 comptime var round = @as(u32, 24);
4444 inline while (round > 0) : (round -= 1) {
......@@ -66,7 +66,7 @@ pub const State = struct {
6666 }
6767 }
6868
69 fn _permute_small(self: *Self) void {
69 fn permute_small(self: *Self) void {
7070 const state = &self.data;
7171 var round = @as(u32, 24);
7272 while (round > 0) : (round -= 1) {
......@@ -94,13 +94,7 @@ pub const State = struct {
9494 }
9595 }
9696
97 pub fn permute(self: *Self) void {
98 if (std.builtin.mode == .ReleaseSmall) {
99 self._permute_small();
100 } else {
101 self._permute_unrolled();
102 }
103 }
97 pub const permute = if (std.builtin.mode == .ReleaseSmall) permute_small else permute_unrolled;
10498
10599 pub fn squeeze(self: *Self, out: []u8) void {
106100 var i = @as(usize, 0);