ponylang / crypto

Library of common cryptographic algorithms and functions for Pony
https://ponylang.io
BSD 2-Clause "Simplified" License
11 stars 8 forks source link

Fix shake128/256 tests #31

Closed SeanTAllen closed 4 years ago

SeanTAllen commented 4 years ago

As part of the PR that added, the non-digest tests were added as digest tests.

https://github.com/ponylang/crypto/pull/28

Additionally the digest tests differ from the existing digest tests and should be updated accordingly.

Please see how the other tests work. Shake tests should be updated accordingly.

@damon-kwok can you handle this?

SeanTAllen commented 4 years ago

It appears that Shake128/256 are both missing from hash_fn.pony when those are added the test cases should be made to look like the others.

mfelsche commented 4 years ago

There is no C function we could use for creating a Shake128/256 HashFn like we do with the other functions. We would need to use the Digest.shake128 / Digest.shake256 for implementing those.

damon-kwok commented 4 years ago

@SeanTAllen Yes, I will focus on this project soon.

SeanTAllen commented 4 years ago

@mfelsche did you test that locally?

Either way, given that we have no tests that run in CI for this currently, any PR for this shouldn't be merged until https://github.com/ponylang/crypto/issues/29 is done so that we can be sure that the tests are working and passing.

mfelsche commented 4 years ago

I did not, i assumed ci was testing the openssl 1.1.1

SeanTAllen commented 4 years ago

@mfelsche it is not, it is using libressl and testing as seen here:

https://github.com/ponylang/crypto/blob/master/.github/workflows/pr.yml#L24

SeanTAllen commented 4 years ago

@mfelsche how did you determine that there are C functions that we could use for creating a Shake128/256 HashFn? Did you check the source? I'd like to know for the future if others come in the best way to determine that. I find the openssl source hard to navigate so pointers would be appreciated.

mfelsche commented 4 years ago

I was searching the index of man pages: https://www.openssl.org/docs/man1.1.1/man3/

SeanTAllen commented 4 years ago

Closed by #40