MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / subtract

Method subtract

src/main/java/com/thealgorithms/ciphers/ECC.java:213–216  ·  view source on GitHub ↗

Subtract two points on the elliptic curve.

(ECPoint other, BigInteger p, BigInteger a)

Source from the content-addressed store, hash-verified

211 * Subtract two points on the elliptic curve.
212 */
213 public ECPoint subtract(ECPoint other, BigInteger p, BigInteger a) {
214 ECPoint negOther = new ECPoint(other.x, p.subtract(other.y)); // Negate the Y coordinate
215 return this.add(negOther, p, a); // Add the negated point
216 }
217
218 /**
219 * Multiply a point by a scalar (repeated addition).

Callers 7

decryptMethod · 0.95
compressMethod · 0.45
decompressMethod · 0.45
addMethod · 0.45
generateKeysMethod · 0.45
encryptMethod · 0.45
generateKeysMethod · 0.45

Calls 1

addMethod · 0.95

Tested by

no test coverage detected