I\'m trying to make my own library for the elliptic curve. Some things work, but some others don\'t.
To calculate a public key from a private key, you should multipl
Yes there is something wrong with your code; you are trying to divide in Z (using BigInteger) when you need to divide in Zp (aka Z/pZ) where p is the curve parameter defining the underlying field (for secp256k1 see SEC2). Modular division is implemented in Java by taking the modular inverse and modular-multiplying; see Scalar Multiplication of Point over elliptic Curve . Also you need to take at least the final results mod p, and it is usually more efficient to do the stepwise results as well.