ext/phc-winner-argon2/src/argon2.h in argon2-0.1.1 vs ext/phc-winner-argon2/src/argon2.h in argon2-0.1.2

- old
+ new

@@ -192,10 +192,18 @@ } argon2_context; /* Argon2 primitive type */ typedef enum Argon2_type { Argon2_d = 0, Argon2_i = 1 } argon2_type; + +/* + * Function that performs memory-hard hashing with certain degree of parallelism + * @param context Pointer to the Argon2 internal structure + * @return Error code if smth is wrong, ARGON2_OK otherwise + */ +int argon2_core(argon2_context *context, argon2_type type); + /** * Hashes a password with Argon2i, producing an encoded hash * @param t_cost Number of iterations * @param m_cost Sets memory usage to 2^m_cost kibibytes * @param parallelism Number of threads and compute lanes @@ -316,9 +324,18 @@ * @param hash The password hash to verify. The length of the hash is * specified by the context outlen member * @return Zero if successful, a non zero error code otherwise */ int verify_d(argon2_context *context, const char *hash); + +/* + * Verify if a given password is correct for Argon2i hashing + * @param context Pointer to current Argon2 context + * @param hash The password hash to verify. The length of the hash is + * specified by the context outlen member + * @return Zero if successful, a non zero error code otherwise + */ +int verify_i(argon2_context *context, const char *hash); /* * Get the associated error message for given error code * @return The error message associated with the given error code */