authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-09-28 11:49:15+02:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2026-10-01 12:06:17+02:00
logcdc92b64bd1e1ae3b54b9cc77b2e646e47dd88cd
tree6d5f4bc94ab0fc752c4d588285303052e9c104d7
parent71341840a0040835002c430c45f266500853b2f5

crypto.ff: Use more descriptive names


1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/crypto/ff.zig+4-4
...@@ -252,7 +252,7 @@ pub fn Uint(comptime max_bits: comptime_int) type {...@@ -252,7 +252,7 @@ pub fn Uint(comptime max_bits: comptime_int) type {
252 const n = acc.limbs_len;252 const n = acc.limbs_len;
253 var wide: [2 * max_limbs_count]Limb = undefined;253 var wide: [2 * max_limbs_count]Limb = undefined;
254 @memcpy(wide[0..n], acc.limbsConst());254 @memcpy(wide[0..n], acc.limbsConst());
255 addMulVV(wide[0 .. 2 * n], x.limbsConst(), y.limbsConst());255 mulAddWide(wide[0 .. 2 * n], x.limbsConst(), y.limbsConst());
256 @memcpy(acc.limbs(), wide[0..n]);256 @memcpy(acc.limbs(), wide[0..n]);
257 return @intFromBool(!ct.eql(orLimbs(wide[n..][0..n]), 0));257 return @intFromBool(!ct.eql(orLimbs(wide[n..][0..n]), 0));
258 }258 }
...@@ -545,7 +545,7 @@ fn orLimbs(limbs: []const Limb) Limb {...@@ -545,7 +545,7 @@ fn orLimbs(limbs: []const Limb) Limb {
545}545}
546546
547// Adds `x * y` to `z` and returns the carry.547// Adds `x * y` to `z` and returns the carry.
548fn addMulVVW(z: []Limb, x: []const Limb, y: Limb) Limb {548fn mulAddLimb(z: []Limb, x: []const Limb, y: Limb) Limb {
549 assert(z.len == x.len);549 assert(z.len == x.len);
550 var carry: Limb = 0;550 var carry: Limb = 0;
551 for (z, x) |*z_limb, x_limb| {551 for (z, x) |*z_limb, x_limb| {
...@@ -561,10 +561,10 @@ fn addMulVVW(z: []Limb, x: []const Limb, y: Limb) Limb {...@@ -561,10 +561,10 @@ fn addMulVVW(z: []Limb, x: []const Limb, y: Limb) Limb {
561}561}
562562
563// Adds `x * y` to the low `x.len` limbs of `z`. The upper limbs need no initialization.563// Adds `x * y` to the low `x.len` limbs of `z`. The upper limbs need no initialization.
564fn addMulVV(z: []Limb, x: []const Limb, y: []const Limb) void {564fn mulAddWide(z: []Limb, x: []const Limb, y: []const Limb) void {
565 assert(z.len == x.len + y.len);565 assert(z.len == x.len + y.len);
566 for (y, 0..) |y_limb, i| {566 for (y, 0..) |y_limb, i| {
567 z[i + x.len] = addMulVVW(z[i..][0..x.len], x, y_limb);567 z[i + x.len] = mulAddLimb(z[i..][0..x.len], x, y_limb);
568 }568 }
569}569}
570570