We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ddc97f commit eb0437eCopy full SHA for eb0437e
soroban-sdk/src/crypto/bls12_381.rs
@@ -168,6 +168,11 @@ impl Fp {
168
self.0.env()
169
}
170
171
+ // `Fp` represents an element in the base field of the BLS12-381 elliptic curve.
172
+ // For an element a ∈ Fp, its negation `-a` is defined as:
173
+ // a + (-a) = 0 (mod p)
174
+ // where `p` is the field modulus, and to make a valid point coordinate on the
175
+ // curve, `a` also must be within the field range (i.e., 0 ≤ a < p).
176
fn checked_neg(&self) -> Option<Fp> {
177
let fp_bigint: BigInt<6> = (&self.0).into();
178
if fp_bigint.is_zero() {
0 commit comments