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

Added support for argon2 pwhash (requires libsodium >= 1.0.9) #142

Merged
merged 1 commit into from Nov 28, 2016

Conversation

elijh
Copy link
Contributor

@elijh elijh commented Nov 26, 2016

No description provided.

@tarcieri
Copy link
Contributor

Thanks for the PR!

Looks like there might be a bit of necessary upstream work to get the build going again. I'll take a look, and then you can rebase.

@elijh elijh force-pushed the feature/argon2 branch 2 times, most recently from 156ebe7 to 3652f68 Compare November 27, 2016 00:08
@elijh
Copy link
Contributor Author

elijh commented Nov 27, 2016

Thanks! I forgot to include the spec in the PR. fixed.

@elijh
Copy link
Contributor Author

elijh commented Nov 27, 2016

OK, I fix the test when running with older versions of libsodium. Alas, the CI is not run with a libsodium that has argon2, so argon2 test is just skipped.

@tarcieri
Copy link
Contributor

@elijh can you rebase against master?

# but that's okay, because it's pretty awesome.
# scrypt
#
# deprecated in favor of argon2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrypt isn't "deprecated". It's actually still my preferred choice (I say this as a PHC judge)

@elijh
Copy link
Contributor Author

elijh commented Nov 27, 2016

I will remove the deprecation note. Although the scrypt code is still there, and can be called directly, it can no longer be used via libsodium's crypto_pwhash function (src/libsodium/crypto_pwhash/crypto_pwhash.c).

int
crypto_pwhash(unsigned char * const out, unsigned long long outlen,
              const char * const passwd, unsigned long long passwdlen,
              const unsigned char * const salt,
              unsigned long long opslimit, size_t memlimit, int alg)
{
    if (alg != crypto_pwhash_ALG_ARGON2I13) {
        errno = EINVAL;
        return -1;
    }
    return crypto_pwhash_argon2i(out, outlen, passwd, passwdlen, salt,
                                 opslimit, memlimit, alg);
}

I took this to mean it is deprecated, but only by inference. I am fond of scrypt, but I can understand the libsodium philosophy of reducing programmer choice.

@elijh
Copy link
Contributor Author

elijh commented Nov 27, 2016

ok, rebased and deprecation text made.

@tarcieri tarcieri merged commit 6c48ff8 into RubyCrypto:master Nov 28, 2016
@tarcieri
Copy link
Contributor

Looks good, thanks!

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

2 participants