Giter Club home page Giter Club logo

argon2-kdf's People

Contributors

ankane avatar mtomov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

argon2-kdf's Issues

Apple M1 Chip Compatibility

Hi @ankane ! Thank you for your awesome work on this project (blind_index is amazing!)

Currently, this repo only bundles the Mac x86 version of the dylib for argon instead of including an arm64 build. This means when run on a new Mac computer, the following happens:

Fiddle::DLError:
   dlopen(/Users/hcatlin/.rvm/gems/ruby-2.7.2/gems/argon2-kdf-0.1.3/vendor/libargon2.dylib, 9): no suitable image found.  Did find:
      	/Users/hcatlin/.rvm/gems/ruby-2.7.2/gems/argon2-kdf-0.1.3/vendor/libargon2.dylib: mach-o, but wrong architecture
        /Users/hcatlin/.rvm/gems/ruby-2.7.2/gems/argon2-kdf-0.1.3/vendor/libargon2.dylib: mach-o, but wrong architecture
      

dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin

Having this issue with macOS High Sierra version 10.13.4 (17E199).

Installed blind_index gem (version 2.0.1) which has a dependency with this gem. The following error message is given while trying to run rails db:seed:

dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
  Referenced from: 

/Users/santiagollapur/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/argon2-kdf-0.1.2/vendor/libargon2.dylib (which was built for Mac OS X 10.15)

  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin

  Referenced from: 

/Users/santiagollapur/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/argon2-kdf-0.1.2/vendor/libargon2.dylib (which was built for Mac OS X 10.15)

  Expected in: /usr/lib/libSystem.B.dylib

[1]    4807 abort      rails db:seed

Ideas

  • Support for password hashing
  • Rails integration - has_argon2_password
  • Devise integration

Fiddle::DLError: dlopen(ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib, 9): no suitable image found.

I'm getting the error argon2-kdf-0.1.4/vendor/libargon2.dylib, 9): no suitable image found on new MacBook Pro with M1 chip:

Fiddle::DLError: dlopen(/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib, 9): no suitable image found.  Did find:
	/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib: mach-o, but wrong architecture
	/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/vendor/libargon2.dylib: mach-o, but wrong architecture
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:8:in `<module:FFI>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:3:in `<module:KDF>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:2:in `<module:Argon2>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf/ffi.rb:1:in `<main>'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf.rb:49:in `kdf'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/argon2-kdf-0.1.4/lib/argon2/kdf.rb:40:in `argon2id'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/blind_index-2.2.0/lib/blind_index.rb:68:in `generate_bidx'
/Users/dale/.rvm/gems/ruby-2.6.6/gems/blind_index-2.2.0/lib/blind_index/extensions.rb:42:in `build'

Is there a known problem with blind_index on M1 chips? Or do you think something else is causing this error?

libargon2.so shared object file not found even if the file exists

I am using blind_index gem to enforce uniqueness of the email field on the users table but it seems like blind_index cannot find the shared object file even if the file is there, any idea on how to fix this?

Here is the error:

irb(main):008:0> user = User.create(email: '[email protected]')
Traceback (most recent call last):
        1: from (irb):8
Fiddle::DLError (/usr/local/bundle/gems/argon2-kdf-0.1.5/vendor/libargon2.so: cannot open shared object file: No such file or directory)

But the file is there:

irb(main):009:0> Dir.entries('/usr/local/bundle/gems/argon2-kdf-0.1.5/vendor')
=> ["LICENSE", "..", "libargon2.dylib", "argon2.dll", "libargon2.so", ".", "libargon2.arm64.dylib"]

Also, I have access to it (also tried to touch it and it works):

marco@3846cfe592f3:/app$ ls -l /usr/local/bundle/gems/argon2-kdf-0.1.5/vendor/
total 396
-rw-r--r-- 1 marco marco  17879 Mar  9 15:03 LICENSE
-rw-r--r-- 1 marco marco  32768 Mar  9 15:03 argon2.dll
-rw-r--r-- 1 marco marco  87486 Mar  9 15:03 libargon2.arm64.dylib
-rw-r--r-- 1 marco marco  46340 Mar  9 15:03 libargon2.dylib
-rw-r--r-- 1 marco marco 212664 Mar  9 15:08 libargon2.so

I am developing in Docker, my container is the standard ruby:2.7.1. Some more details:

irb(main):010:0> RbConfig::CONFIG["arch"]
=> "aarch64-linux"
irb(main):011:0> RbConfig::CONFIG["host_cpu"]
=> "aarch64"
irb(main):012:0> Gem::Platform.local
=> #<Gem::Platform:0x0000aaab1ad90f38 @cpu="aarch64", @os="linux", @version=nil @cpu="aarch64", @os="linux", @version=nil>
irb(main):013:0> Gem::Platform.local.to_s
=> "aarch64-linux"

Thank you for all the help and your wonderful gems @ankane!

EDIT: This could be because I am on a Mac M1?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.