Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SHA512 #3967

Closed
wants to merge 1 commit into from
Closed

Conversation

denysvitali
Copy link

@denysvitali denysvitali commented Feb 1, 2017

puts OpenSSL::SHA512.hash("test").to_slice.hexstring #ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff

@asterite
Copy link
Member

@denysvitali Thank you! I guess this is OK, but could you add a spec to show that it compiles and works correctly?

@asterite
Copy link
Member

Oh, wait... actually, we have OpenSSL::Digest which allows all of these algorithms. Maybe OpenSSL::Sha1 is a remanent and should be removed.

@RX14
Copy link
Member

RX14 commented Feb 10, 2017

@asterite Looks like sha1/md5 use a more direct/simple call than Digest though. I'll try benchmarking them to see if there's any difference.

@RX14
Copy link
Member

RX14 commented Feb 10, 2017

Benchmark results here: https://gist.github.com/RX14/c031d230346cc7d0b78b453c65c0a6a7

However the man page states:

Applications should use the higher level functions EVP_DigestInit(3) etc. instead of calling the hash functions directly.

I think we should eventually (before 1.0) provide more high-level interfaces to crypto functions like SHA1 which we could optimise behind the scenes as we wish.

@akzhan
Copy link
Contributor

akzhan commented Jun 7, 2017

I suppose that it should be closed and stay unmerged.

@denysvitali denysvitali closed this Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants