aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorFrank Denis <github@pureftpd.org>2020-08-15 21:14:56 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-08-16 22:35:28 -0700
commit37ae2464053628d10c7e7e7165ba8a267006b0ad (patch)
tree3a7499eb68406f6726833c57031bf5f3035ff989 /lib/std
parentab6ffa8a3c1e3fa802cacd970d3ed415ba25a85e (diff)
downloadzig-37ae2464053628d10c7e7e7165ba8a267006b0ad.tar.gz
zig-37ae2464053628d10c7e7e7165ba8a267006b0ad.zip
Inline Fe.{sub,mul,sq} for a performance boost in release-safe mode
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/crypto/25519/field.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/crypto/25519/field.zig b/lib/std/crypto/25519/field.zig
index 59aa1e3ba9..121d187e17 100644
--- a/lib/std/crypto/25519/field.zig
+++ b/lib/std/crypto/25519/field.zig
@@ -114,7 +114,7 @@ pub const Fe = struct {
return fe;
}
- pub fn sub(a: Fe, b: Fe) Fe {
+ pub inline fn sub(a: Fe, b: Fe) Fe {
var fe = b;
comptime var i = 0;
inline while (i < 4) : (i += 1) {
@@ -200,7 +200,7 @@ pub const Fe = struct {
return .{ .limbs = rs };
}
- pub fn mul(a: Fe, b: Fe) Fe {
+ pub inline fn mul(a: Fe, b: Fe) Fe {
var ax: [5]u128 = undefined;
var bx: [5]u128 = undefined;
var a19: [5]u128 = undefined;
@@ -223,7 +223,7 @@ pub const Fe = struct {
return _carry128(&r);
}
- fn _sq(a: Fe, double: comptime bool) Fe {
+ inline fn _sq(a: Fe, double: comptime bool) Fe {
var ax: [5]u128 = undefined;
var r: [5]u128 = undefined;
comptime var i = 0;