diff --git a/.github/workflows/tests_ios.yml b/.github/workflows/tests_ios.yml index 921b6d2..d000592 100644 --- a/.github/workflows/tests_ios.yml +++ b/.github/workflows/tests_ios.yml @@ -23,4 +23,4 @@ jobs: run: | flutter pub get cd example/ios && pod install - - run: "cd example && flutter test integration_test/app_test.dart" \ No newline at end of file + - run: "cd example && flutter test --verbose integration_test/app_test.dart" \ No newline at end of file diff --git a/.github/workflows/tests_macos.yml b/.github/workflows/tests_macos.yml index 3bf6c3a..ec33d8f 100644 --- a/.github/workflows/tests_macos.yml +++ b/.github/workflows/tests_macos.yml @@ -21,5 +21,5 @@ jobs: flutter config --enable-macos-desktop flutter pub get cd example/macos && pod install - - run: "cd example && flutter test -d macos integration_test/app_test.dart" - - run: "cd example && flutter test test/app_test.dart" \ No newline at end of file + - run: "cd example && flutter test --verbose -d macos integration_test/app_test.dart" + - run: "cd example && flutter test --verbose test/app_test.dart" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 030ec6a..37e3876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.6.0 + +- Updated binaries to v1.4.1 + ## 3.5.7 - Refactored `Isolate.spawn` logic to make sure we are closing after execution diff --git a/android/src/main/jniLibs/arm64-v8a/librsa_bridge.so b/android/src/main/jniLibs/arm64-v8a/librsa_bridge.so index 6522723..7b5a6a9 100644 Binary files a/android/src/main/jniLibs/arm64-v8a/librsa_bridge.so and b/android/src/main/jniLibs/arm64-v8a/librsa_bridge.so differ diff --git a/android/src/main/jniLibs/armeabi-v7a/librsa_bridge.so b/android/src/main/jniLibs/armeabi-v7a/librsa_bridge.so index fe29deb..466231d 100644 Binary files a/android/src/main/jniLibs/armeabi-v7a/librsa_bridge.so and b/android/src/main/jniLibs/armeabi-v7a/librsa_bridge.so differ diff --git a/android/src/main/jniLibs/x86/librsa_bridge.so b/android/src/main/jniLibs/x86/librsa_bridge.so index 2d7d8d8..907b58f 100644 Binary files a/android/src/main/jniLibs/x86/librsa_bridge.so and b/android/src/main/jniLibs/x86/librsa_bridge.so differ diff --git a/android/src/main/jniLibs/x86_64/librsa_bridge.so b/android/src/main/jniLibs/x86_64/librsa_bridge.so index 7f1bc0f..70909b3 100644 Binary files a/android/src/main/jniLibs/x86_64/librsa_bridge.so and b/android/src/main/jniLibs/x86_64/librsa_bridge.so differ diff --git a/example/pubspec.lock b/example/pubspec.lock index f014342..b5265ac 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -111,7 +111,7 @@ packages: path: ".." relative: true source: path - version: "3.5.7" + version: "3.6.0" ffi: dependency: transitive description: diff --git a/ios/librsa_bridge.a b/ios/librsa_bridge.a index 3ad15d6..995b568 100644 Binary files a/ios/librsa_bridge.a and b/ios/librsa_bridge.a differ diff --git a/ios/librsa_bridge.h b/ios/librsa_bridge.h index 9bbafbc..ff18cc0 100644 --- a/ios/librsa_bridge.h +++ b/ios/librsa_bridge.h @@ -5,7 +5,7 @@ #line 1 "cgo-builtin-export-prolog" -#include /* for ptrdiff_t below */ +#include #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H @@ -46,11 +46,17 @@ typedef long long GoInt64; typedef unsigned long long GoUint64; typedef GoInt64 GoInt; typedef GoUint64 GoUint; -typedef __SIZE_TYPE__ GoUintptr; +typedef size_t GoUintptr; typedef float GoFloat32; typedef double GoFloat64; +#ifdef _MSC_VER +#include +typedef _Fcomplex GoComplex64; +typedef _Dcomplex GoComplex128; +#else typedef float _Complex GoComplex64; typedef double _Complex GoComplex128; +#endif /* static assertion to make sure the file is being used on architecture diff --git a/lib/bridge/binding.dart b/lib/bridge/binding.dart index b5068ac..49a8895 100644 --- a/lib/bridge/binding.dart +++ b/lib/bridge/binding.dart @@ -137,7 +137,7 @@ class Binding { if (Platform.isAndroid || Platform.isLinux) { if (isFlutterTest) { var arch = - Platform.resolvedExecutable.contains("linux-x64") ? "x64" : "arm64"; + Platform.resolvedExecutable.contains("linux-x64") ? "x64" : "arm64"; var ffiFile = 'build/linux/$arch/debug/bundle/lib/$_libraryName.so'; validateTestFFIFile(ffiFile); @@ -151,7 +151,7 @@ class Binding { print(e); var binary = File("/proc/self/cmdline").readAsStringSync(); var suggestedFile = - Path.join(Path.dirname(binary), "lib", "$_libraryName.so"); + Path.join(Path.dirname(binary), "lib", "$_libraryName.so"); return ffi.DynamicLibrary.open(suggestedFile); } } diff --git a/lib/web/assets/rsa.wasm b/lib/web/assets/rsa.wasm index 175071a..39e28e0 100755 Binary files a/lib/web/assets/rsa.wasm and b/lib/web/assets/rsa.wasm differ diff --git a/lib/web/assets/wasm_exec.js b/lib/web/assets/wasm_exec.js old mode 100755 new mode 100644 index 9ce6a20..bc6f210 --- a/lib/web/assets/wasm_exec.js +++ b/lib/web/assets/wasm_exec.js @@ -19,8 +19,8 @@ outputBuf += decoder.decode(buf); const nl = outputBuf.lastIndexOf("\n"); if (nl != -1) { - console.log(outputBuf.substr(0, nl)); - outputBuf = outputBuf.substr(nl + 1); + console.log(outputBuf.substring(0, nl)); + outputBuf = outputBuf.substring(nl + 1); } return buf.length; }, @@ -113,6 +113,10 @@ this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true); } + const setInt32 = (addr, v) => { + this.mem.setUint32(addr + 0, v, true); + } + const getInt64 = (addr) => { const low = this.mem.getUint32(addr + 0, true); const high = this.mem.getInt32(addr + 4, true); @@ -206,7 +210,10 @@ const timeOrigin = Date.now() - performance.now(); this.importObject = { - go: { + _gotest: { + add: (a, b) => a + b, + }, + gojs: { // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function). @@ -269,7 +276,7 @@ this._resume(); } }, - getInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early + getInt64(sp + 8), )); this.mem.setInt32(sp + 16, id, true); }, diff --git a/linux/shared/aarch64/librsa_bridge.h b/linux/shared/aarch64/librsa_bridge.h index 9bbafbc..ff18cc0 100644 --- a/linux/shared/aarch64/librsa_bridge.h +++ b/linux/shared/aarch64/librsa_bridge.h @@ -5,7 +5,7 @@ #line 1 "cgo-builtin-export-prolog" -#include /* for ptrdiff_t below */ +#include #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H @@ -46,11 +46,17 @@ typedef long long GoInt64; typedef unsigned long long GoUint64; typedef GoInt64 GoInt; typedef GoUint64 GoUint; -typedef __SIZE_TYPE__ GoUintptr; +typedef size_t GoUintptr; typedef float GoFloat32; typedef double GoFloat64; +#ifdef _MSC_VER +#include +typedef _Fcomplex GoComplex64; +typedef _Dcomplex GoComplex128; +#else typedef float _Complex GoComplex64; typedef double _Complex GoComplex128; +#endif /* static assertion to make sure the file is being used on architecture diff --git a/linux/shared/aarch64/librsa_bridge.so b/linux/shared/aarch64/librsa_bridge.so index 4fa66b8..096ecb7 100644 Binary files a/linux/shared/aarch64/librsa_bridge.so and b/linux/shared/aarch64/librsa_bridge.so differ diff --git a/linux/shared/x86_64/librsa_bridge.h b/linux/shared/x86_64/librsa_bridge.h index 9bbafbc..ff18cc0 100644 --- a/linux/shared/x86_64/librsa_bridge.h +++ b/linux/shared/x86_64/librsa_bridge.h @@ -5,7 +5,7 @@ #line 1 "cgo-builtin-export-prolog" -#include /* for ptrdiff_t below */ +#include #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H @@ -46,11 +46,17 @@ typedef long long GoInt64; typedef unsigned long long GoUint64; typedef GoInt64 GoInt; typedef GoUint64 GoUint; -typedef __SIZE_TYPE__ GoUintptr; +typedef size_t GoUintptr; typedef float GoFloat32; typedef double GoFloat64; +#ifdef _MSC_VER +#include +typedef _Fcomplex GoComplex64; +typedef _Dcomplex GoComplex128; +#else typedef float _Complex GoComplex64; typedef double _Complex GoComplex128; +#endif /* static assertion to make sure the file is being used on architecture diff --git a/linux/shared/x86_64/librsa_bridge.so b/linux/shared/x86_64/librsa_bridge.so index 582d76f..817c6fd 100644 Binary files a/linux/shared/x86_64/librsa_bridge.so and b/linux/shared/x86_64/librsa_bridge.so differ diff --git a/macos/librsa_bridge.dylib b/macos/librsa_bridge.dylib index 44dcb42..4812eaa 100644 Binary files a/macos/librsa_bridge.dylib and b/macos/librsa_bridge.dylib differ diff --git a/pubspec.yaml b/pubspec.yaml index 1362eb8..e3fc7ef 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fast_rsa description: library for use RSA with support for android and ios, macOS, linux, windows and web -version: 3.5.7 +version: 3.6.0 homepage: https://github.com/jerson/flutter-rsa environment: diff --git a/windows/shared/librsa_bridge.dll b/windows/shared/librsa_bridge.dll index 3cac507..9be6097 100644 Binary files a/windows/shared/librsa_bridge.dll and b/windows/shared/librsa_bridge.dll differ diff --git a/windows/shared/librsa_bridge.h b/windows/shared/librsa_bridge.h index 4c67da2..07c037c 100644 --- a/windows/shared/librsa_bridge.h +++ b/windows/shared/librsa_bridge.h @@ -5,7 +5,7 @@ #line 1 "cgo-builtin-export-prolog" -#include /* for ptrdiff_t below */ +#include #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H @@ -46,11 +46,17 @@ typedef long long GoInt64; typedef unsigned long long GoUint64; typedef GoInt64 GoInt; typedef GoUint64 GoUint; -typedef __SIZE_TYPE__ GoUintptr; +typedef size_t GoUintptr; typedef float GoFloat32; typedef double GoFloat64; +#ifdef _MSC_VER +#include +typedef _Fcomplex GoComplex64; +typedef _Dcomplex GoComplex128; +#else typedef float _Complex GoComplex64; typedef double _Complex GoComplex128; +#endif /* static assertion to make sure the file is being used on architecture