Skip to content

Commit

Permalink
Updated binaries to v1.4.1 (#56)
Browse files Browse the repository at this point in the history
* chore: updated libraries

* chore: add verbose for ios and macos
  • Loading branch information
jerson authored Aug 9, 2023
1 parent 7ade057 commit 7a067b1
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: |
flutter pub get
cd example/ios && pod install
- run: "cd example && flutter test integration_test/app_test.dart"
- run: "cd example && flutter test --verbose integration_test/app_test.dart"
4 changes: 2 additions & 2 deletions .github/workflows/tests_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
- run: "cd example && flutter test --verbose -d macos integration_test/app_test.dart"
- run: "cd example && flutter test --verbose test/app_test.dart"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file modified android/src/main/jniLibs/arm64-v8a/librsa_bridge.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/armeabi-v7a/librsa_bridge.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/x86/librsa_bridge.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/x86_64/librsa_bridge.so
Binary file not shown.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.5.7"
version: "3.6.0"
ffi:
dependency: transitive
description:
Expand Down
Binary file modified ios/librsa_bridge.a
Binary file not shown.
10 changes: 8 additions & 2 deletions ios/librsa_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#line 1 "cgo-builtin-export-prolog"

#include <stddef.h> /* for ptrdiff_t below */
#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H
Expand Down Expand Up @@ -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 <complex.h>
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
Expand Down
4 changes: 2 additions & 2 deletions lib/bridge/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand Down
Binary file modified lib/web/assets/rsa.wasm
Binary file not shown.
15 changes: 11 additions & 4 deletions lib/web/assets/wasm_exec.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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);
},
Expand Down
10 changes: 8 additions & 2 deletions linux/shared/aarch64/librsa_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#line 1 "cgo-builtin-export-prolog"

#include <stddef.h> /* for ptrdiff_t below */
#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H
Expand Down Expand Up @@ -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 <complex.h>
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
Expand Down
Binary file modified linux/shared/aarch64/librsa_bridge.so
Binary file not shown.
10 changes: 8 additions & 2 deletions linux/shared/x86_64/librsa_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#line 1 "cgo-builtin-export-prolog"

#include <stddef.h> /* for ptrdiff_t below */
#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H
Expand Down Expand Up @@ -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 <complex.h>
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
Expand Down
Binary file modified linux/shared/x86_64/librsa_bridge.so
Binary file not shown.
Binary file modified macos/librsa_bridge.dylib
Binary file not shown.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Binary file modified windows/shared/librsa_bridge.dll
Binary file not shown.
10 changes: 8 additions & 2 deletions windows/shared/librsa_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#line 1 "cgo-builtin-export-prolog"

#include <stddef.h> /* for ptrdiff_t below */
#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H
Expand Down Expand Up @@ -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 <complex.h>
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
Expand Down

0 comments on commit 7a067b1

Please sign in to comment.