| ... | ... | @@ -374,7 +374,7 @@ pub const State = struct { |
| 374 | 374 | |
| 375 | 375 | const Halves = struct { l: u32, r: u32 }; |
| 376 | 376 | |
| 377 | | fn halfRound(state: State, i: u32, j: u32, n: usize) u32 { |
| 377 | fn halfRound(state: *const State, i: u32, j: u32, n: usize) u32 { |
| 378 | 378 | var r = state.sboxes[0][@truncate(u8, j >> 24)]; |
| 379 | 379 | r +%= state.sboxes[1][@truncate(u8, j >> 16)]; |
| 380 | 380 | r ^= state.sboxes[2][@truncate(u8, j >> 8)]; |
| ... | ... | @@ -382,7 +382,7 @@ pub const State = struct { |
| 382 | 382 | return i ^ r ^ state.subkeys[n]; |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | | fn encipher(state: State, halves: *Halves) void { |
| 385 | fn encipher(state: *const State, halves: *Halves) void { |
| 386 | 386 | halves.l ^= state.subkeys[0]; |
| 387 | 387 | comptime var i = 1; |
| 388 | 388 | inline while (i < 16) : (i += 2) { |
| ... | ... | @@ -393,7 +393,7 @@ pub const State = struct { |
| 393 | 393 | halves.* = halves_last; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | | fn encrypt(state: State, data: []u32) void { |
| 396 | fn encrypt(state: *const State, data: []u32) void { |
| 397 | 397 | debug.assert(data.len % 2 == 0); |
| 398 | 398 | var i: usize = 0; |
| 399 | 399 | while (i < data.len) : (i += 2) { |