| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); |
| 2 | 3 | const crypto = std.crypto; |
| 3 | 4 | const readIntLittle = std.mem.readIntLittle; |
| 4 | 5 | const writeIntLittle = std.mem.writeIntLittle; |
| ... | ... | @@ -6,6 +7,12 @@ const writeIntLittle = std.mem.writeIntLittle; |
| 6 | 7 | const NonCanonicalError = crypto.errors.NonCanonicalError; |
| 7 | 8 | const NotSquareError = crypto.errors.NotSquareError; |
| 8 | 9 | |
| 10 | // Inline conditionally, when it can result in large code generation. |
| 11 | const bloaty_inline = switch (builtin.mode) { |
| 12 | .ReleaseSafe, .ReleaseFast => .Inline, |
| 13 | .Debug, .ReleaseSmall => .Unspecified, |
| 14 | }; |
| 15 | |
| 9 | 16 | pub const Fe = struct { |
| 10 | 17 | limbs: [5]u64, |
| 11 | 18 | |
| ... | ... | @@ -264,7 +271,7 @@ pub const Fe = struct { |
| 264 | 271 | } |
| 265 | 272 | |
| 266 | 273 | /// Multiply two field elements |
| 267 | | pub inline fn mul(a: Fe, b: Fe) Fe { |
| 274 | pub fn mul(a: Fe, b: Fe) callconv(bloaty_inline) Fe { |
| 268 | 275 | var ax: [5]u128 = undefined; |
| 269 | 276 | var bx: [5]u128 = undefined; |
| 270 | 277 | var a19: [5]u128 = undefined; |