These callbacks are only triggered either by arguments do not match explicit rquirements of the sepc256k1 library, or by hardware failures, memory corruption
or bug in secp256k1, and not by misuse of the library.
In theory we do not need to implement them, except to find bugs in our own code, but the default callbacks print a message to stderr and call abort() which
is not nice especially on mobile apps.
=> Here we introduce 2 specific exceptions, Secp256k1ErrorCallbackException and Secp256k1IllegalCallbackException, which are thrown when the error callback or illegal callback are called.
Don't throw in `seckey_verify`: it's inconsistent to have this function throw
for some invalid inputs and return false for other invalid inputs.
Document public key compression and add tests.
* Android loading may fallback to standard JVM
* Java code must target JVM 1.8 in order to be compatible Android.
Co-authored-by: Salomon BRYS <salomon@kodein.net>
* Each native library is in its own jar. Got rid of cross compilation. The project is `secp256k1` and not `secp256k1-kmp`.
* Updated CI to use all 3 OS VMs
Co-authored-by: Salomon BRYS <salomon@kodein.net>
* Upgrade JNI interface
* Input signatures can be DER or compact format, output signatures are always in compact format
* Input public keys can be compressed or uncompressed, output public keys are always uncompressed
* Name and parameters match libsecp256k1's
* JNI implementation is now straightforward
No more ByteBuffers
Exceptions are thrown in case of failures
* Update src/nativeMain/kotlin/fr/acinq/secp256k1/Secp256k1Native.kt
* Add public key compression method
Co-authored-by: Salomon BRYS <salomon.brys@gmail.com>