| ... | ... | @@ -18,7 +18,7 @@ pub const Ghash = struct { |
| 18 | 18 | pub const mac_length = 16; |
| 19 | 19 | pub const key_length = 16; |
| 20 | 20 | |
| 21 | | const pc_count = if (builtin.mode != .ReleaseSmall) 16 else 2; |
| 21 | const pc_count = if (builtin.mode != .ReleaseSmall) 16 else 4; |
| 22 | 22 | const agg_2_treshold = 5; |
| 23 | 23 | const agg_4_treshold = 22; |
| 24 | 24 | const agg_8_treshold = 84; |
| ... | ... | @@ -42,14 +42,11 @@ pub const Ghash = struct { |
| 42 | 42 | |
| 43 | 43 | var hx: [pc_count]Precomp = undefined; |
| 44 | 44 | hx[0] = h; |
| 45 | | if (block_count >= agg_2_treshold) { |
| 46 | | hx[1] = gcmReduce(clsq128(hx[0])); // h^2 |
| 47 | | } |
| 45 | hx[1] = gcmReduce(clsq128(hx[0])); // h^2 |
| 46 | hx[2] = gcmReduce(clmul128(hx[1], h)); // h^3 |
| 47 | hx[3] = gcmReduce(clsq128(hx[1])); // h^4 = h^2^2 |
| 48 | |
| 48 | 49 | if (builtin.mode != .ReleaseSmall) { |
| 49 | | if (block_count >= agg_4_treshold) { |
| 50 | | hx[2] = gcmReduce(clmul128(hx[1], h)); // h^3 |
| 51 | | hx[3] = gcmReduce(clsq128(hx[1])); // h^4 = h^2^2 |
| 52 | | } |
| 53 | 50 | if (block_count >= agg_8_treshold) { |
| 54 | 51 | hx[4] = gcmReduce(clmul128(hx[3], h)); // h^5 |
| 55 | 52 | hx[5] = gcmReduce(clsq128(hx[2])); // h^6 = h^3^2 |