diff --git a/build.gradle b/build.gradle index 9345192..ba4adeb 100644 --- a/build.gradle +++ b/build.gradle @@ -44,10 +44,12 @@ dependencies { implementation ('org.bouncycastle:bcprov-jdk15on:1.64') { exclude group: 'org.hamcrest', module: 'hamcrest-core' } - implementation ('de.mkammerer:argon2-jvm:2.7') { + implementation ('de.mkammerer:argon2-jvm:2.11') { exclude group: 'org.hamcrest', module: 'hamcrest-core' exclude group: 'junit', module: 'junit' + exclude group: 'net.java.dev.jna', module: 'jna' } + implementation ('net.java.dev.jna:jna:5.8.0') implementation ('ch.qos.logback:logback-classic:1.2.8') { exclude group: 'org.hamcrest', module: 'hamcrest-core' exclude group: 'org.slf4j' diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 49bb37b..8e48428 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,6 +1,6 @@ open module com.sparrowwallet.drongo { requires org.bouncycastle.provider; - requires de.mkammerer.argon2; + requires de.mkammerer.argon2.nolibs; requires org.slf4j; requires logback.core; requires logback.classic; diff --git a/src/main/java/org/bitcoin/Secp256k1Context.java b/src/main/java/org/bitcoin/Secp256k1Context.java index 2e8909e..39494b5 100644 --- a/src/main/java/org/bitcoin/Secp256k1Context.java +++ b/src/main/java/org/bitcoin/Secp256k1Context.java @@ -35,7 +35,10 @@ public class Secp256k1Context { private static boolean loadLibrary() { try { String osName = System.getProperty("os.name"); - if(osName.startsWith("Mac")) { + String osArch = System.getProperty("os.arch"); + if(osName.startsWith("Mac") && osArch.equals("aarch64")) { + NativeUtils.loadLibraryFromJar("/native/osx/aarch64/libsecp256k1.dylib"); + } else if(osName.startsWith("Mac")) { NativeUtils.loadLibraryFromJar("/native/osx/x64/libsecp256k1.dylib"); } else if(osName.startsWith("Windows")) { NativeUtils.loadLibraryFromJar("/native/windows/x64/libsecp256k1-0.dll"); diff --git a/src/main/resources/native/osx/aarch64/libsecp256k1.dylib b/src/main/resources/native/osx/aarch64/libsecp256k1.dylib new file mode 100755 index 0000000..02aa2ff Binary files /dev/null and b/src/main/resources/native/osx/aarch64/libsecp256k1.dylib differ