On 11 December 2017 at 20:28, Pierce Ng <pie...@samadhiweb.com> wrote:

> On Mon, Dec 11, 2017 at 12:46:59AM +0800, Ben Coman wrote:
> > where the "EVP function provide a high level interface to OpenSSL
> > cryptographic functions."
>
> Hi Ben,
>
> As it happened, over the weekend I implemented the Pharo wrappers for the
> EVP_DigestSign* and EVP_DigestVerify* APIs. It is straightforward to add
> the
> non-public key-using message digest functions, so I've just done it. Code
> snippets:
>
>   | msg st c |
>   msg := 'Grumpy wizards make toxic brew for the evil Queen and Jack.'.
>   st := SHA256 hashMessage: msg asByteArray.
>   c := LcEvpSHA256 new hashMessage: msg asByteArray.
>   st = c
>   => true
>
> Using Sven's example:
>
>   | msg st c |
>   key := ByteArray new: 32.
>   msg := 'Grumpy wizards make toxic brew for the evil Queen and Jack.'.
>   st := (HMAC on: SHA256) key: key; digestMessage: msg asByteArray.
>   c := (HMAC on: LcEvpSHA256) key: key; digestMessage: msg asByteArray.
>   st = c
>   => true
>
> Code at http://smalltalkhub.com/#!/~PierceNg/OpenSSL-Pharo.
>
>
Great! Looks like you've been busy!

I was going to ask why these updates aren't being pushed an OpenSSL repo
shared with Squeak,
since things should not be much different at this low level, but actually
it was hard to
determine which was the original repo. I see...
   http://www.squeaksource.com/SqueakSSL.html
seems to have not beenupdated since 2012.

cheers -ben


I've also added tests for SHA256 similar to the snippets above.  I will add
> SHA512 tests when I find the test vectors.
>
> In the next two weeks when I have some time off from work, I will attempt
> to
> move the repo to GH. Meanwhile, I've added you as a contributor to the STH
> repo if you'd like to hack on it.
>

Reply via email to