/* Copyright (c) 2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "password-scheme.h"
#ifdef HAVE_LIBSODIUM
#include <sodium.h>
static void
{
if (rounds == 0)
else if (rounds >= crypto_pwhash_argon2i_OPSLIMIT_MODERATE)
else
i_fatal("crypto_pwhash_argon2i_str failed: %m");
}
#ifdef crypto_pwhash_ALG_ARGON2ID13
static void
{
if (rounds == 0)
else if (rounds >= crypto_pwhash_argon2id_OPSLIMIT_MODERATE)
else
/* XXX: Bug in sodium-1.0.13, it expects rounds to be 3 */
if (rounds < 3)
rounds = 3;
i_fatal("crypto_pwhash_argon2id_str failed: %m");
}
#endif
static int
const char **error_r ATTR_UNUSED)
{
return 0;
return 1;
}
#ifdef crypto_pwhash_ALG_ARGON2ID13
#endif
};
void password_scheme_register_sodium(void)
{
if (sodium_init() != 0)
i_fatal("sodium_init() failed");
}
#endif