Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Test.java
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public static void testSecKeyVerifyPos() throws AssertFailException{ | ||||
byte[] sec = BaseEncoding.base16().lowerCase().decode("67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530".toLowerCase()); | byte[] sec = BaseEncoding.base16().lowerCase().decode("67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530".toLowerCase()); | ||||
result = NativeSecp256k1.secKeyVerify( sec ); | result = NativeSecp256k1.secKeyVerify( sec ); | ||||
//System.out.println(" TEST " + new BigInteger(1, resultbytes).toString(16)); | //System.out.println(" TEST " + new BigInteger(1, resultbytes).toString(16)); | ||||
assertEquals( result, true , "testSecKeyVerifyPos"); | assertEquals( result, true , "testSecKeyVerifyPos"); | ||||
} | } | ||||
/** | /** | ||||
* This tests secret key verify() for a invalid secretkey | * This tests secret key verify() for an invalid secretkey | ||||
*/ | */ | ||||
public static void testSecKeyVerifyNeg() throws AssertFailException{ | public static void testSecKeyVerifyNeg() throws AssertFailException{ | ||||
boolean result = false; | boolean result = false; | ||||
byte[] sec = BaseEncoding.base16().lowerCase().decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF".toLowerCase()); | byte[] sec = BaseEncoding.base16().lowerCase().decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF".toLowerCase()); | ||||
result = NativeSecp256k1.secKeyVerify( sec ); | result = NativeSecp256k1.secKeyVerify( sec ); | ||||
//System.out.println(" TEST " + new BigInteger(1, resultbytes).toString(16)); | //System.out.println(" TEST " + new BigInteger(1, resultbytes).toString(16)); | ||||
assertEquals( result, false , "testSecKeyVerifyNeg"); | assertEquals( result, false , "testSecKeyVerifyNeg"); | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |