argon2_core() -> argon2_ctx()
This commit is contained in:
parent
8bd6c9e289
commit
31a153c937
@ -19,7 +19,7 @@
|
|||||||
/*************************Argon2 internal
|
/*************************Argon2 internal
|
||||||
* constants**************************************************/
|
* constants**************************************************/
|
||||||
|
|
||||||
enum argon2_core_constants {
|
enum argon2_ctx_constants {
|
||||||
/* Version of the algorithm */
|
/* Version of the algorithm */
|
||||||
ARGON2_VERSION_NUMBER = 0x10,
|
ARGON2_VERSION_NUMBER = 0x10,
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "argon2-encoding.h"
|
#include "argon2-encoding.h"
|
||||||
#include "argon2-core.h"
|
#include "argon2-core.h"
|
||||||
|
|
||||||
int argon2_core(argon2_context *context, argon2_type type) {
|
int argon2_ctx(argon2_context *context, argon2_type type) {
|
||||||
/* 1. Validate all inputs */
|
/* 1. Validate all inputs */
|
||||||
int result = validate_inputs(context);
|
int result = validate_inputs(context);
|
||||||
uint32_t memory_blocks, segment_length;
|
uint32_t memory_blocks, segment_length;
|
||||||
@ -124,7 +124,7 @@ int argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
|||||||
context.threads = parallelism;
|
context.threads = parallelism;
|
||||||
context.flags = ARGON2_DEFAULT_FLAGS;
|
context.flags = ARGON2_DEFAULT_FLAGS;
|
||||||
|
|
||||||
result = argon2_core(&context, type);
|
result = argon2_ctx(&context, type);
|
||||||
|
|
||||||
if (result != ARGON2_OK) {
|
if (result != ARGON2_OK) {
|
||||||
sodium_memzero(out, hashlen);
|
sodium_memzero(out, hashlen);
|
||||||
@ -235,7 +235,7 @@ int argon2i_verify(const char *encoded, const void *pwd, const size_t pwdlen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int argon2i(argon2_context *context) {
|
int argon2i(argon2_context *context) {
|
||||||
return argon2_core(context, Argon2_i);
|
return argon2_ctx(context, Argon2_i);
|
||||||
}
|
}
|
||||||
|
|
||||||
int verify_i(argon2_context *context, const char *hash) {
|
int verify_i(argon2_context *context, const char *hash) {
|
||||||
@ -244,7 +244,7 @@ int verify_i(argon2_context *context, const char *hash) {
|
|||||||
return ARGON2_OUT_PTR_MISMATCH;
|
return ARGON2_OUT_PTR_MISMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = argon2_core(context, Argon2_i);
|
result = argon2_ctx(context, Argon2_i);
|
||||||
|
|
||||||
if (ARGON2_OK != result) {
|
if (ARGON2_OK != result) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -189,7 +189,7 @@ typedef enum Argon2_type { Argon2_i = 1 } argon2_type;
|
|||||||
* @param context Pointer to the Argon2 internal structure
|
* @param context Pointer to the Argon2 internal structure
|
||||||
* @return Error code if smth is wrong, ARGON2_OK otherwise
|
* @return Error code if smth is wrong, ARGON2_OK otherwise
|
||||||
*/
|
*/
|
||||||
int argon2_core(argon2_context *context, argon2_type type);
|
int argon2_ctx(argon2_context *context, argon2_type type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hashes a password with Argon2i, producing an encoded hash
|
* Hashes a password with Argon2i, producing an encoded hash
|
||||||
|
Loading…
Reference in New Issue
Block a user