-
Notifications
You must be signed in to change notification settings - Fork 6
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
How can I use sha3 with OpenSSL in ruby? #9
Comments
Is there an error message you're receiving when trying to use it? What happens if you run the following code from IRB or Pry (assuming your already installed the gem
Please post any error message(s), and operating system information (sample code would be great too).
I'd love to help, but I'm unsure how you're trying to "combine" them. Please provide more context. |
Sorry, pardon the ambiguities, here are the details 😄 I was attempting to do the below:
Because sha3 isn't a subclass of
And I am stuck ... |
That's helpful, but unfortunately I don't have a solution for your particular use case. I suppose it would be possible to change the base class to Assuming that you must use SHA3, you can either fork this project, and change the base class to Line 234 in 2534b73
|
Thanks @johanns , I will try forking the project |
Hmm still no good. It looks like the error message comes from the C extension within ruby's openssl code. I read it on stackoverflow (lost the link) that in order to add a custom digest, a C struct needs to be used as the context, like this line: https://github.com/ruby/openssl/blob/master/ext/openssl/ossl_digest.h#L16 The type error comes from this line: https://github.com/ruby/openssl/blob/fdcda971a26895ea5c5015a90671ee73039d55e8/ext/openssl/ossl.h#L59 I am not good with C tho ... |
Actually I made it work via pure Ruby by subclassing |
Hi @DaHoopster, How were you able to make it work? Did you actually monkeypatch the SHA3::Digest class? Can you point me to the right direction? Thanks. |
I am trying to use sha3 as the digest to sign a message with OpenSSL. But it looks like Ruby 2.5.1 doesn't work with this library. Any thoughts on how I can combine the two? Thanks!
The text was updated successfully, but these errors were encountered: