| ... | @@ -13,8 +13,6 @@ fn rotw(w: u32) u32 { | ... | @@ -13,8 +13,6 @@ fn rotw(w: u32) u32 { |
| 13 | return w << 8 | w >> 24; | 13 | return w << 8 | w >> 24; |
| 14 | } | 14 | } |
| 15 | | 15 | |
| 16 | // TODO: encrypt and decrypt could probably be unified | | |
| 17 | | | |
| 18 | // Encrypt one block from src into dst, using the expanded key xk. | 16 | // Encrypt one block from src into dst, using the expanded key xk. |
| 19 | fn encryptBlock(xk: []const u32, dst: []u8, src: []const u8) void { | 17 | fn encryptBlock(xk: []const u32, dst: []u8, src: []const u8) void { |
| 20 | var s0 = mem.readIntSliceBig(u32, src[0..4]); | 18 | var s0 = mem.readIntSliceBig(u32, src[0..4]); |
| ... | @@ -270,8 +268,6 @@ test "expand key" { | ... | @@ -270,8 +268,6 @@ test "expand key" { |
| 270 | | 268 | |
| 271 | // constants | 269 | // constants |
| 272 | | 270 | |
| 273 | // TODO: generate these at comptime? | | |
| 274 | | | |
| 275 | const poly = 1 << 8 | 1 << 4 | 1 << 3 | 1 << 1 | 1 << 0; | 271 | const poly = 1 << 8 | 1 << 4 | 1 << 3 | 1 << 1 | 1 << 0; |
| 276 | | 272 | |
| 277 | var powx = [16]u8{ | 273 | var powx = [16]u8{ |