Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d22d835a5 | ||
|
|
bb25eb21b7 | ||
|
|
6a67dbe9f6 | ||
|
|
7272a55b8a |
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@@ -28,6 +28,35 @@ jobs:
|
|||||||
path: ~/.gradle
|
path: ~/.gradle
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle-
|
restore-keys: ${{ runner.os }}-gradle-
|
||||||
|
- name: Android environment
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "ANDROID_NDK_VERSION=21.3.6528147" >> $GITHUB_ENV
|
||||||
|
- name: Cached Android NDK
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }}
|
||||||
|
key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }}
|
||||||
|
- name: Set up shell
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: |
|
||||||
|
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
rm.exe "C:/WINDOWS/system32/bash.EXE"
|
||||||
|
- name: Set up JDK 8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
- name: Setup Android
|
||||||
|
if: matrix.os != 'windows-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$ANDROID_HOME/tools/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION"
|
||||||
|
- name: Setup Android
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$ANDROID_HOME\\tools\\bin\\sdkmanager.bat "ndk;$ANDROID_NDK_VERSION"
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
@@ -35,11 +64,6 @@ jobs:
|
|||||||
- name: Install Automake
|
- name: Install Automake
|
||||||
if: matrix.os == 'macOS-latest'
|
if: matrix.os == 'macOS-latest'
|
||||||
run: brew install automake
|
run: brew install automake
|
||||||
- name: Set up shell
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
run: |
|
|
||||||
echo ::add-path::C:\msys64\usr\bin\
|
|
||||||
rm.exe "C:/WINDOWS/system32/bash.EXE"
|
|
||||||
- name: Check JVM
|
- name: Check JVM
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./gradlew jvmTest
|
run: ./gradlew jvmTest
|
||||||
@@ -56,7 +80,7 @@ jobs:
|
|||||||
uses: reactivecircus/android-emulator-runner@v2
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
with:
|
with:
|
||||||
api-level: 29
|
api-level: 29
|
||||||
ndk: 21.3.6528147
|
ndk: ${{ env.ANDROID_NDK_VERSION }}
|
||||||
cmake: 3.10.2.4988404
|
cmake: 3.10.2.4988404
|
||||||
script: ./gradlew connectedCheck
|
script: ./gradlew connectedCheck
|
||||||
- name: Publish Linux
|
- name: Publish Linux
|
||||||
|
|||||||
36
.github/workflows/snapshot.yml
vendored
36
.github/workflows/snapshot.yml
vendored
@@ -36,6 +36,35 @@ jobs:
|
|||||||
path: ~/.gradle
|
path: ~/.gradle
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle-
|
restore-keys: ${{ runner.os }}-gradle-
|
||||||
|
- name: Android environment
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "ANDROID_NDK_VERSION=21.3.6528147" >> $GITHUB_ENV
|
||||||
|
- name: Cached Android NDK
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }}
|
||||||
|
key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }}
|
||||||
|
- name: Set up shell
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: |
|
||||||
|
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
rm.exe "C:/WINDOWS/system32/bash.EXE"
|
||||||
|
- name: Set up JDK 8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
- name: Setup Android
|
||||||
|
if: matrix.os != 'windows-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$ANDROID_HOME/tools/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION"
|
||||||
|
- name: Setup Android
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$ANDROID_HOME\\tools\\bin\\sdkmanager.bat "ndk;$ANDROID_NDK_VERSION"
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
@@ -43,11 +72,6 @@ jobs:
|
|||||||
- name: Install Automake
|
- name: Install Automake
|
||||||
if: matrix.os == 'macOS-latest'
|
if: matrix.os == 'macOS-latest'
|
||||||
run: brew install automake
|
run: brew install automake
|
||||||
- name: Set up shell
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
run: |
|
|
||||||
echo ::add-path::C:\msys64\usr\bin\
|
|
||||||
rm.exe "C:/WINDOWS/system32/bash.EXE"
|
|
||||||
- name: Check JVM
|
- name: Check JVM
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./gradlew jvmTest
|
run: ./gradlew jvmTest
|
||||||
@@ -64,7 +88,7 @@ jobs:
|
|||||||
uses: reactivecircus/android-emulator-runner@v2
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
with:
|
with:
|
||||||
api-level: 29
|
api-level: 29
|
||||||
ndk: 21.3.6528147
|
ndk: ${{ env.ANDROID_NDK_VERSION }}
|
||||||
cmake: 3.10.2.4988404
|
cmake: 3.10.2.4988404
|
||||||
script: ./gradlew connectedCheck
|
script: ./gradlew connectedCheck
|
||||||
- name: Publish Linux
|
- name: Publish Linux
|
||||||
|
|||||||
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
@@ -42,6 +42,35 @@ jobs:
|
|||||||
path: ~/.gradle
|
path: ~/.gradle
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle-
|
restore-keys: ${{ runner.os }}-gradle-
|
||||||
|
- name: Android environment
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
|
||||||
|
echo "ANDROID_NDK_VERSION=21.3.6528147" >> $GITHUB_ENV
|
||||||
|
- name: Cached Android NDK
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }}
|
||||||
|
key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }}
|
||||||
|
- name: Set up shell
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: |
|
||||||
|
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
rm.exe "C:/WINDOWS/system32/bash.EXE"
|
||||||
|
- name: Set up JDK 8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
- name: Setup Android
|
||||||
|
if: matrix.os != 'windows-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$ANDROID_HOME/tools/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION"
|
||||||
|
- name: Setup Android
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$ANDROID_HOME\\tools\\bin\\sdkmanager.bat "ndk;$ANDROID_NDK_VERSION"
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
@@ -49,11 +78,6 @@ jobs:
|
|||||||
- name: Install Automake
|
- name: Install Automake
|
||||||
if: matrix.os == 'macOS-latest'
|
if: matrix.os == 'macOS-latest'
|
||||||
run: brew install automake
|
run: brew install automake
|
||||||
- name: Set up shell
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
run: |
|
|
||||||
echo ::add-path::C:\msys64\usr\bin\
|
|
||||||
rm.exe "C:/WINDOWS/system32/bash.EXE"
|
|
||||||
- name: Check JVM
|
- name: Check JVM
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./gradlew jvmTest
|
run: ./gradlew jvmTest
|
||||||
@@ -70,6 +94,6 @@ jobs:
|
|||||||
uses: reactivecircus/android-emulator-runner@v2
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
with:
|
with:
|
||||||
api-level: 29
|
api-level: 29
|
||||||
ndk: 21.3.6528147
|
ndk: ${{ env.ANDROID_NDK_VERSION }}
|
||||||
cmake: 3.10.2.4988404
|
cmake: 3.10.2.4988404
|
||||||
script: ./gradlew connectedCheck
|
script: ./gradlew connectedCheck
|
||||||
|
|||||||
@@ -8,24 +8,24 @@ import org.gradle.internal.os.OperatingSystem
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.4.0"
|
kotlin("multiplatform") version "1.4.31"
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:4.0.1")
|
classpath("com.android.tools.build:gradle:4.0.2")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "fr.acinq.secp256k1"
|
group = "fr.acinq.secp256k1"
|
||||||
version = "0.3.0"
|
version = "0.5.0"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
@@ -66,7 +66,6 @@ kotlin {
|
|||||||
|
|
||||||
ios {
|
ios {
|
||||||
secp256k1CInterop("ios")
|
secp256k1CInterop("ios")
|
||||||
// https://youtrack.jetbrains.com/issue/KT-39396
|
|
||||||
compilations["main"].defaultSourceSet.dependsOn(nativeMain)
|
compilations["main"].defaultSourceSet.dependsOn(nativeMain)
|
||||||
// https://youtrack.jetbrains.com/issue/KT-39396
|
// https://youtrack.jetbrains.com/issue/KT-39396
|
||||||
compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/ios/libsecp256k1.a")
|
compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-include-binary", "$rootDir/native/build/ios/libsecp256k1.a")
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ afterEvaluate {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("android") {
|
create<MavenPublication>("android") {
|
||||||
artifactId = "secp256k1-jni-android"
|
artifactId = "secp256k1-kmp-jni-android"
|
||||||
from(components["release"])
|
from(components["release"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ val generateHeaders by tasks.creating(JavaCompile::class) {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("jvm") {
|
create<MavenPublication>("jvm") {
|
||||||
artifactId = "secp256k1-jni-common"
|
artifactId = "secp256k1-kmp-jni-common"
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ dependencies {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("jvm") {
|
create<MavenPublication>("jvm") {
|
||||||
artifactId = "secp256k1-jni-jvm"
|
artifactId = "secp256k1-kmp-jni-jvm"
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ dependencies {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("jvm") {
|
create<MavenPublication>("jvm") {
|
||||||
artifactId = "secp256k1-jni-jvm-extract"
|
artifactId = "secp256k1-kmp-jni-jvm-extract"
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ val copyJni by tasks.creating(Sync::class) {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
val pub = create<MavenPublication>("jvm") {
|
val pub = create<MavenPublication>("jvm") {
|
||||||
artifactId = "secp256k1-jni-jvm-darwin"
|
artifactId = "secp256k1-kmp-jni-jvm-darwin"
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
}
|
}
|
||||||
if (!org.gradle.internal.os.OperatingSystem.current().isMacOsX) {
|
if (!org.gradle.internal.os.OperatingSystem.current().isMacOsX) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ val copyJni by tasks.creating(Sync::class) {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
val pub = create<MavenPublication>("jvm") {
|
val pub = create<MavenPublication>("jvm") {
|
||||||
artifactId = "secp256k1-jni-jvm-linux"
|
artifactId = "secp256k1-kmp-jni-jvm-linux"
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
}
|
}
|
||||||
if (!org.gradle.internal.os.OperatingSystem.current().isLinux) {
|
if (!org.gradle.internal.os.OperatingSystem.current().isLinux) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ val copyJni by tasks.creating(Sync::class) {
|
|||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
val pub = create<MavenPublication>("jvm") {
|
val pub = create<MavenPublication>("jvm") {
|
||||||
artifactId = "secp256k1-jni-jvm-mingw"
|
artifactId = "secp256k1-kmp-jni-jvm-mingw"
|
||||||
from(components["java"])
|
from(components["java"])
|
||||||
}
|
}
|
||||||
if (!org.gradle.internal.os.OperatingSystem.current().isWindows) {
|
if (!org.gradle.internal.os.OperatingSystem.current().isWindows) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ pluginManagement {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rootProject.name = "secp256k1"
|
rootProject.name = "secp256k1-kmp"
|
||||||
|
|
||||||
include(
|
include(
|
||||||
":native",
|
":native",
|
||||||
@@ -17,4 +17,4 @@ include(
|
|||||||
":jni:jvm:mingw",
|
":jni:jvm:mingw",
|
||||||
":jni:jvm:all",
|
":jni:jvm:all",
|
||||||
":tests"
|
":tests"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public object Secp256k1Native : Secp256k1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override fun signatureNormalize(sig: ByteArray): Pair<ByteArray, Boolean> {
|
public override fun signatureNormalize(sig: ByteArray): Pair<ByteArray, Boolean> {
|
||||||
require(sig.size == 64 || sig.size in 70..73)
|
require(sig.size >= 64){ "invalid signature ${Hex.encode(sig)}" }
|
||||||
memScoped {
|
memScoped {
|
||||||
val nSig = allocSignature(sig)
|
val nSig = allocSignature(sig)
|
||||||
val isHighS = secp256k1_ecdsa_signature_normalize(ctx, nSig.ptr, nSig.ptr)
|
val isHighS = secp256k1_ecdsa_signature_normalize(ctx, nSig.ptr, nSig.ptr)
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ kotlin {
|
|||||||
}
|
}
|
||||||
sourceSets["androidTest"].dependencies {
|
sourceSets["androidTest"].dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
implementation("androidx.test.ext:junit:1.1.1")
|
implementation("androidx.test.ext:junit:1.1.2")
|
||||||
implementation("androidx.test.espresso:espresso-core:3.2.0")
|
implementation("androidx.test.espresso:espresso-core:3.3.0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user