firstfloorsoftware / flutter_sodium

Flutter bindings for libsodium
BSD 3-Clause "New" or "Revised" License
102 stars 47 forks source link

Rewrite flutter_sodium using FFI #35

Closed kozw closed 3 years ago

kozw commented 4 years ago

The FFI implementation has recently been started in the ffi branch. Tracking progress of the entire libsodium API (725 symbols):

AKushWarrior commented 4 years ago

Are the completed APIs stable with tests?

kozw commented 4 years ago

Not yet, it's work in progress. Also not released yet to pub.dartlang.org as there are still some issues to be ironed out.

AKushWarrior commented 4 years ago

Okay, I'll be keeping an eye out.

Has the potential to be the best cryptographic package for Flutter by far.

kozw commented 4 years ago

nice

p3root commented 4 years ago

Any eta when a beta version is gona be released? Your package looks pretty solid. Do you have a sponsor page as well?

qdm12 commented 4 years ago

Hello, thanks for the great library, indeed the most promising crypto library for flutter.

A quick question, would you know if using the sodium ffi would work on desktop (using go-flutter for now)? Would there be a way to bundle the sodium library in the flutter app?

Thanks!

AKushWarrior commented 4 years ago

@qdm12 not the author but... I would doubt that it works on desktop. As far as I can tell, FFI on flutter depends on some platform specific components, for which there's no desktop guide.

kozw commented 4 years ago

Any eta when a beta version is gona be released?

Dart bindings for the most interesting APIs of libsodium are complete. The release mostly depends on the FFI deployment story which doesn't work for flutter_sodium. See also https://github.com/flutter/flutter/issues/33227

Update: just published flutter_sodium 0.1.0 to pub.dev. Mind you, this is still beta.

kozw commented 4 years ago

A quick question, would you know if using the sodium ffi would work on desktop (using go-flutter for now)? Would there be a way to bundle the sodium library in the flutter app?

I'm not sure this library works with go-flutter. Probably not, there is currently no solution for packaging native libraries (in both mobile and desktop apps). See also https://github.com/flutter/flutter/issues/33227

Apart from the deployment issues, ffi seems to work fine with native libraries on a desktop. flutter_sodium FFI library works great with the MacOS installed libsodium library. This scenario is used for the unit tests.

AKushWarrior commented 4 years ago

@kozw a cursory Google search turned up an official tutorial on how to bind to native libraries from flutter.

it's kind of hacky, and I don't know if you've already considered it already, but let me know if you need a link.

kozw commented 3 years ago

As of flutter_sodium 0.2.0, the stable 1.0.0 ffi version is used. Closing this issue.

API coverage tracking has moved to #61

Sunbreak commented 3 years ago

Thanks for your article https://asim.ihsan.io/flutter-ffi-libsodium/. Got inspired with the compote function


BTW

As discussed in the article, it should be possible to automatically parse the libsodium C headers and code in order to generate the FFI bindings and wrapper Dart code.

You could use package:ffigen now. Checkout https://github.com/woodemi/libusb.dart