Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/java/org/bitcoin/NativeSecp256k1.java
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | public static boolean verify(byte[] data, byte[] signature, byte[] pub) { | ||||
byteBuff.order(ByteOrder.nativeOrder()); | byteBuff.order(ByteOrder.nativeOrder()); | ||||
nativeECDSABuffer.set(byteBuff); | nativeECDSABuffer.set(byteBuff); | ||||
} | } | ||||
byteBuff.rewind(); | byteBuff.rewind(); | ||||
byteBuff.put(data); | byteBuff.put(data); | ||||
byteBuff.put(signature); | byteBuff.put(signature); | ||||
byteBuff.put(pub); | byteBuff.put(pub); | ||||
byte[][] retByteArray; | |||||
r.lock(); | r.lock(); | ||||
try { | try { | ||||
return secp256k1_ecdsa_verify(byteBuff, Secp256k1Context.getContext(), signature.length, pub.length) == 1; | return secp256k1_ecdsa_verify(byteBuff, Secp256k1Context.getContext(), signature.length, pub.length) == 1; | ||||
} finally { | } finally { | ||||
r.unlock(); | r.unlock(); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 369 Lines • Show Last 20 Lines |