int main(void) { tv(); tv2(); tv3(); str_tests(); assert(crypto_pwhash_argon2i_bytes_min() > 0U); assert(crypto_pwhash_argon2i_bytes_max() > crypto_pwhash_argon2i_bytes_min()); assert(crypto_pwhash_argon2i_passwd_max() > crypto_pwhash_argon2i_passwd_min()); assert(crypto_pwhash_argon2i_saltbytes() > 0U); assert(crypto_pwhash_argon2i_strbytes() > 1U); assert(crypto_pwhash_argon2i_strbytes() > strlen(crypto_pwhash_argon2i_strprefix())); assert(crypto_pwhash_argon2i_opslimit_min() > 0U); assert(crypto_pwhash_argon2i_opslimit_max() > 0U); assert(crypto_pwhash_argon2i_memlimit_min() > 0U); assert(crypto_pwhash_argon2i_memlimit_max() > 0U); assert(crypto_pwhash_argon2i_opslimit_interactive() > 0U); assert(crypto_pwhash_argon2i_memlimit_interactive() > 0U); assert(crypto_pwhash_argon2i_opslimit_moderate() > 0U); assert(crypto_pwhash_argon2i_memlimit_moderate() > 0U); assert(crypto_pwhash_argon2i_opslimit_sensitive() > 0U); assert(crypto_pwhash_argon2i_memlimit_sensitive() > 0U); assert(crypto_pwhash_argon2i_bytes_min() == crypto_pwhash_argon2i_BYTES_MIN); assert(crypto_pwhash_argon2i_bytes_max() == crypto_pwhash_argon2i_BYTES_MAX); assert(crypto_pwhash_argon2i_passwd_min() == crypto_pwhash_argon2i_PASSWD_MIN); assert(crypto_pwhash_argon2i_passwd_max() == crypto_pwhash_argon2i_PASSWD_MAX); assert(crypto_pwhash_argon2i_saltbytes() == crypto_pwhash_argon2i_SALTBYTES); assert(crypto_pwhash_argon2i_strbytes() == crypto_pwhash_argon2i_STRBYTES); assert(crypto_pwhash_argon2i_opslimit_min() == crypto_pwhash_argon2i_OPSLIMIT_MIN); assert(crypto_pwhash_argon2i_opslimit_max() == crypto_pwhash_argon2i_OPSLIMIT_MAX); assert(crypto_pwhash_argon2i_memlimit_min() == crypto_pwhash_argon2i_MEMLIMIT_MIN); assert(crypto_pwhash_argon2i_memlimit_max() == crypto_pwhash_argon2i_MEMLIMIT_MAX); assert(crypto_pwhash_argon2i_opslimit_interactive() == crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE); assert(crypto_pwhash_argon2i_memlimit_interactive() == crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE); assert(crypto_pwhash_argon2i_opslimit_moderate() == crypto_pwhash_argon2i_OPSLIMIT_MODERATE); assert(crypto_pwhash_argon2i_memlimit_moderate() == crypto_pwhash_argon2i_MEMLIMIT_MODERATE); assert(crypto_pwhash_argon2i_opslimit_sensitive() == crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE); assert(crypto_pwhash_argon2i_memlimit_sensitive() == crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE); assert(crypto_pwhash_argon2i_alg_argon2i13() == crypto_pwhash_argon2i_ALG_ARGON2I13); printf("OK\n"); return 0; }
int main(void) { tv(); tv2(); tv3(); str_tests(); assert(crypto_pwhash_bytes_min() > 0U); assert(crypto_pwhash_bytes_max() > crypto_pwhash_bytes_min()); assert(crypto_pwhash_passwd_max() > crypto_pwhash_passwd_min()); assert(crypto_pwhash_saltbytes() > 0U); assert(crypto_pwhash_strbytes() > 1U); assert(crypto_pwhash_strbytes() > strlen(crypto_pwhash_strprefix())); assert(crypto_pwhash_opslimit_min() > 0U); assert(crypto_pwhash_opslimit_max() > 0U); assert(crypto_pwhash_memlimit_min() > 0U); assert(crypto_pwhash_memlimit_max() > 0U); assert(crypto_pwhash_opslimit_interactive() > 0U); assert(crypto_pwhash_memlimit_interactive() > 0U); assert(crypto_pwhash_opslimit_moderate() > 0U); assert(crypto_pwhash_memlimit_moderate() > 0U); assert(crypto_pwhash_opslimit_sensitive() > 0U); assert(crypto_pwhash_memlimit_sensitive() > 0U); assert(strcmp(crypto_pwhash_primitive(), "argon2i") == 0); assert(crypto_pwhash_bytes_min() == crypto_pwhash_BYTES_MIN); assert(crypto_pwhash_bytes_max() == crypto_pwhash_BYTES_MAX); assert(crypto_pwhash_passwd_min() == crypto_pwhash_PASSWD_MIN); assert(crypto_pwhash_passwd_max() == crypto_pwhash_PASSWD_MAX); assert(crypto_pwhash_saltbytes() == crypto_pwhash_SALTBYTES); assert(crypto_pwhash_strbytes() == crypto_pwhash_STRBYTES); assert(crypto_pwhash_opslimit_min() == crypto_pwhash_OPSLIMIT_MIN); assert(crypto_pwhash_opslimit_max() == crypto_pwhash_OPSLIMIT_MAX); assert(crypto_pwhash_memlimit_min() == crypto_pwhash_MEMLIMIT_MIN); assert(crypto_pwhash_memlimit_max() == crypto_pwhash_MEMLIMIT_MAX); assert(crypto_pwhash_opslimit_interactive() == crypto_pwhash_OPSLIMIT_INTERACTIVE); assert(crypto_pwhash_memlimit_interactive() == crypto_pwhash_MEMLIMIT_INTERACTIVE); assert(crypto_pwhash_opslimit_moderate() == crypto_pwhash_OPSLIMIT_MODERATE); assert(crypto_pwhash_memlimit_moderate() == crypto_pwhash_MEMLIMIT_MODERATE); assert(crypto_pwhash_opslimit_sensitive() == crypto_pwhash_OPSLIMIT_SENSITIVE); assert(crypto_pwhash_memlimit_sensitive() == crypto_pwhash_MEMLIMIT_SENSITIVE); assert(crypto_pwhash_argon2id_bytes_min() == crypto_pwhash_bytes_min()); assert(crypto_pwhash_argon2id_bytes_max() == crypto_pwhash_bytes_max()); assert(crypto_pwhash_argon2id_passwd_min() == crypto_pwhash_passwd_min()); assert(crypto_pwhash_argon2id_passwd_max() == crypto_pwhash_passwd_max()); assert(crypto_pwhash_argon2id_saltbytes() == crypto_pwhash_saltbytes()); assert(crypto_pwhash_argon2id_strbytes() == crypto_pwhash_strbytes()); assert(strcmp(crypto_pwhash_argon2id_strprefix(), crypto_pwhash_strprefix()) == 0); assert(crypto_pwhash_argon2id_opslimit_min() == crypto_pwhash_opslimit_min()); assert(crypto_pwhash_argon2id_opslimit_max() == crypto_pwhash_opslimit_max()); assert(crypto_pwhash_argon2id_memlimit_min() == crypto_pwhash_memlimit_min()); assert(crypto_pwhash_argon2id_memlimit_max() == crypto_pwhash_memlimit_max()); assert(crypto_pwhash_argon2id_opslimit_interactive() == crypto_pwhash_opslimit_interactive()); assert(crypto_pwhash_argon2id_opslimit_moderate() == crypto_pwhash_opslimit_moderate()); assert(crypto_pwhash_argon2id_opslimit_sensitive() == crypto_pwhash_opslimit_sensitive()); assert(crypto_pwhash_argon2id_memlimit_interactive() == crypto_pwhash_memlimit_interactive()); assert(crypto_pwhash_argon2id_memlimit_moderate() == crypto_pwhash_memlimit_moderate()); assert(crypto_pwhash_argon2id_memlimit_sensitive() == crypto_pwhash_memlimit_sensitive()); assert(crypto_pwhash_alg_argon2id13() == crypto_pwhash_argon2id_alg_argon2id13()); assert(crypto_pwhash_alg_argon2i13() == crypto_pwhash_ALG_ARGON2I13); assert(crypto_pwhash_alg_argon2i13() != crypto_pwhash_alg_default()); assert(crypto_pwhash_alg_argon2id13() == crypto_pwhash_ALG_ARGON2ID13); assert(crypto_pwhash_alg_argon2id13() != crypto_pwhash_alg_argon2i13()); assert(crypto_pwhash_alg_argon2id13() == crypto_pwhash_alg_default()); assert(crypto_pwhash_argon2id(guard_page, 0, (const char *) guard_page, 0, guard_page, crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE, crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE, 0) == -1); assert(crypto_pwhash_argon2id(guard_page, 0, (const char *) guard_page, 0, guard_page, crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE, crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE, crypto_pwhash_ALG_ARGON2I13) == -1); assert(crypto_pwhash_argon2i(guard_page, 0, (const char *) guard_page, 0, guard_page, crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE, crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE, 0) == -1); assert(crypto_pwhash_argon2i(guard_page, 0, (const char *) guard_page, 0, guard_page, crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE, crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE, crypto_pwhash_ALG_ARGON2ID13) == -1); printf("OK\n"); return 0; }