franckverrot / blake2 Goto Github PK
View Code? Open in Web Editor NEWBLAKE2 - fast secure hashing - for Ruby
Home Page: https://rubygems.org/gems/blake2
License: MIT License
BLAKE2 - fast secure hashing - for Ruby
Home Page: https://rubygems.org/gems/blake2
License: MIT License
Are there any dependencies I'm missing?
When I try to install blake2 gem I get...
Building native extensions. This could take a while...
ERROR: Error installing blake2:
ERROR: Failed to build gem native extension.
/home/phil/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
creating Makefile
make
compiling rbext.c
In file included from rbext.c:1:0:
/home/phil/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:48:21: fatal error: string.h: No such file or directory
compilation terminated.
make: *** [rbext.o] Error 1
Gem files will remain installed in /home/phil/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/blake2-0.1.0 for inspection.
Results logged to /home/phil/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/blake2-0.1.0/ext/blake2_ext/gem_make.out
As discussed in #6, I would like to change the license from GPL to MIT.
Hopefully there’s only one contributor, @grempe : please respond to this issue with “OK”, or “not OK”. Should you not be OK with the change please respond to the private email I sent you today but feel free to respond here too.
If you’re OK, I’ll change the license ASAP.
Thanks in advance!
Otherwise it's hard to use and I'll need to remove it from fingerprint
.
Building native extensions. This could take a while...
ERROR: Error installing blake2:
ERROR: Failed to build gem native extension.
/home/phil/.rbenv/versions/2.1.2/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling rbext.c
In file included from /home/phil/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:29:0,
from rbext.c:1:
/home/phil/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:26:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make: *** [rbext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/phil/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/blake2-0.1.0 for inspection.
Results logged to /home/phil/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/blake2-0.1.0/gem_make.out
Hi,
I accidentally mess my data up after I set the blake2 key using input larger than 32 bytes, which result in broken hashes.
It would be nice if the library raises an error when encountering an unexpectedly large key than the function supports.
Hi, I am working on a pretty significant pull request to this gem that I would like to submit very soon. However I have run into a showstopper issue with the gem as it is right now. There is apparently some kind of a memory allocation or cleanup issue in the C extension code that causes a segfault if Ruby Garbage collection is turned on (as it generally always is). Here is some sample code I have created that demonstrates the issue every time on my machine (OS X El Capitan). I also tried this under several versions of Ruby with the same outcome. The segfault messages are always different since I think the segfault happens at random times based on when Ruby decides to do a GC sweep so they are pretty much useless as far as I can tell. I suspect something is getting GC'ed while it is still in use.
#!/usr/bin/env ruby
require 'blake2'
# If GC is disabled this will run cleanly through
# thousands of iterations. If GC is running normally
# if will crash after a couple of thousand hashes pretty
# much every time. Uncomment this to allow clean runs.
#GC.disable
i = 0
100000.times do
puts i if i % 1000 == 0
Blake2.new(32, Blake2::Key.none).digest('abc', :to_hex)
i += 1
end
Unless I uncomment the GC.disable
line this fails after a few thousand hashes every time for me.
Unfortunately, I don't have much experience with C or Ruby C extensions. Do you think you could take a look?
Cheers,
Glenn
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.