Loading src/crypto/ecc_p256.cpp +8 −1 Changes for src/crypto/ecc_p256.cpp: 8 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ static const P256Point P256_G_STD = []{ g.mont = false; g.x = u256::fromBigEndian(P256_GX_BE); g.y = u256::fromBigEndian(P256_GY_BE); g.z = u256::zero(); // unused in affine representation, zeroed for hygiene return g; }(); Loading @@ -51,6 +52,7 @@ P256Point P256Point::toAffine() const if (inf) { P.inf = true; P.x = u256::zero(); P.y = u256::zero(); P.z = u256::zero(); return P; } Loading @@ -58,6 +60,7 @@ P256Point P256Point::toAffine() const u256 z_std = z.fromMontgomery(); if (z_std.isZero()) { P.inf = true; P.x = u256::zero(); P.y = u256::zero(); P.z = u256::zero(); return P; } Loading Loading @@ -143,7 +146,10 @@ P256Point P256Point::addJacobian(const P256Point& other) const { if (u1 == u2) { if (s1 == s2) return doubled(); P256Point r; r.inf = true; r.mont = true; return r; P256Point r; r.inf = true; r.mont = true; r.x = u256::zero(); r.y = u256::zero(); r.z = u256::zero(); return r; } u256 h = u2.montgomerySub(u1); Loading Loading @@ -261,6 +267,7 @@ P256Point P256Point::scalarMulBase(const uint8_t priv[32]) P256Point R; R.inf = true; R.mont = false; R.x = u256::zero(); R.y = u256::zero(); R.z = u256::zero(); return R; } return basePoint().scalarMul(priv); Loading Loading
src/crypto/ecc_p256.cpp +8 −1 Changes for src/crypto/ecc_p256.cpp: 8 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ static const P256Point P256_G_STD = []{ g.mont = false; g.x = u256::fromBigEndian(P256_GX_BE); g.y = u256::fromBigEndian(P256_GY_BE); g.z = u256::zero(); // unused in affine representation, zeroed for hygiene return g; }(); Loading @@ -51,6 +52,7 @@ P256Point P256Point::toAffine() const if (inf) { P.inf = true; P.x = u256::zero(); P.y = u256::zero(); P.z = u256::zero(); return P; } Loading @@ -58,6 +60,7 @@ P256Point P256Point::toAffine() const u256 z_std = z.fromMontgomery(); if (z_std.isZero()) { P.inf = true; P.x = u256::zero(); P.y = u256::zero(); P.z = u256::zero(); return P; } Loading Loading @@ -143,7 +146,10 @@ P256Point P256Point::addJacobian(const P256Point& other) const { if (u1 == u2) { if (s1 == s2) return doubled(); P256Point r; r.inf = true; r.mont = true; return r; P256Point r; r.inf = true; r.mont = true; r.x = u256::zero(); r.y = u256::zero(); r.z = u256::zero(); return r; } u256 h = u2.montgomerySub(u1); Loading Loading @@ -261,6 +267,7 @@ P256Point P256Point::scalarMulBase(const uint8_t priv[32]) P256Point R; R.inf = true; R.mont = false; R.x = u256::zero(); R.y = u256::zero(); R.z = u256::zero(); return R; } return basePoint().scalarMul(priv); Loading