Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Support building against system argon2. #227

Closed
wants to merge 2 commits into from

Conversation

QuLogic
Copy link

@QuLogic QuLogic commented Apr 5, 2018

This echos the option that exists in the argon2 package to not use the internal copy and build against a system version.

In a way, this is an alternate way to "fix" #109 because there wouldn't be any internal copy of the symbols that could conflict.

@ocheron
Copy link
Contributor

ocheron commented May 13, 2018

Tested on latest Ubuntu but it does not work:

$ cabal configure -fuse-system-library
Resolving dependencies...
Configuring cryptonite-0.25...
cabal: parsing output of pkg-config --modversion failed

This is related to haskell/cabal#163:

$ pkg-config --modversion libargon2
0~20161029

@QuLogic
Copy link
Author

QuLogic commented May 14, 2018

That is actually a bug in the Ubuntu/Debian packages; they should not include the 0~ prefix. Can you report a bug to one of them? I do not use either.

@QuLogic
Copy link
Author

QuLogic commented May 14, 2018

Actually, looks like there's a bug for Ubuntu and Debian already, opened by the separate argon2 Haskell package developer.

@ocheron
Copy link
Contributor

ocheron commented May 22, 2018

Thanks for pointing to the fixed packages, I tried again with that.

But regarding argon2, I don't see how that could work: the local implementation uses name cryptonite_argon2_hash instead of argon2_hash and has been simplified.
In commit 253bf0c, parameters encoded and encodedlen have been removed.
This is not the same API.

Regarding BLAKE2, when I test this gives segmentation faults. The Haskell layer in Crypto.Hash.Blake2* is tied to specific buffer sizes for hashing contexts and this approach will not be compatible with a variable implementation coming from a shared library.

@QuLogic
Copy link
Author

QuLogic commented May 24, 2018

Hmm, you're right; I think I may have written this before some of those changes. I will get back to you on this.

QuLogic added 2 commits May 26, 2018 05:47
It's not much of anything at the moment, but useful for system library.
@QuLogic QuLogic changed the title Support building against system argon2/blake2. Support building against system argon2. Jun 2, 2018
@QuLogic
Copy link
Author

QuLogic commented Jun 2, 2018

For the moment, I've cut this down to just system argon2.

With blake2, it's a bit complicated because they started with a program, that was sort-of-embeddable, and later wrote a library, but it has a different API. Cryptonite uses the files from the program, so it would need some sort of compat to work with the library. Changing to embedding the library is also possible, but it re-arranged the configuration options around and I'm not super-sure how to do that here.

@vincenthz
Copy link
Member

archiving repository

@vincenthz vincenthz closed this Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants