Skip to content

Commit

Permalink
Secp256k1.java: Override close() to throw now exception
Browse files Browse the repository at this point in the history
This gives the API close() method the same exception signature as the implementations.
close() should never throw a _checked_ exception.
  • Loading branch information
msgilligan committed Apr 10, 2024
1 parent 3d0f393 commit f2c34c8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.bitcoinj.secp256k1.api;

import java.io.Closeable;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.spec.ECFieldFp;
Expand All @@ -25,7 +26,7 @@
/**
*
*/
public interface Secp256k1 extends AutoCloseable {
public interface Secp256k1 extends Closeable {


ECFieldFp FIELD = new ECFieldFp(new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16));
Expand Down Expand Up @@ -69,4 +70,9 @@ default byte[] taggedSha256(String tag, String message) {
byte[] schnorrSigSign32(byte[] msg_hash, P256K1KeyPair keyPair);

Result<Boolean> schnorrSigVerify(byte[] signature, byte[] msg_hash, P256K1XOnlyPubKey pubKey);

/**
* Override close and declare that no checked exceptions are thrown
*/
void close();
}

0 comments on commit f2c34c8

Please sign in to comment.