We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3f4dd2 commit 6df1b29Copy full SHA for 6df1b29
Src/Autarkysoft.Bitcoin/Cryptography/EllipticCurve/Scalar8x32.cs
@@ -319,7 +319,8 @@ public Scalar8x32 Half()
319
// - the right summand is: a&1 ? n//2+1 : 0 = n//2+1 = (n-1)//2 + 2//2 = (n+1)//2
320
// Together they sum to (n-3)//2 + (n+1)//2 = (2n-2)//2 = n - 1, which is less than n.
321
322
- uint mask = (uint)-(b0 & 1U);
+ // uint32_t mask = -(uint32_t)(a->d[0] & 1U);
323
+ uint mask = (b0 & 1U) * 0xFFFFFFFFU;
324
ulong t = (b0 >> 1) | (b1 << 31);
325
Debug.Assert(GetOverflow(this) == 0);
326
0 commit comments