296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
|
return(TCL_ERROR);
}
password = Tcl_GetByteArrayFromObj(objv[1], &password_length);
salt = Tcl_GetByteArrayFromObj(objv[2], &salt_length);
hash_ret = argon2_hash(NANO_KDF_ARGON2_TIMING, NANO_KDF_ARGON2_MEMORY, 1,
password, password_length,
salt, salt_length,
result, sizeof(result),
NULL, 0, Argon2_d, 0x10);
if (hash_ret != ARGON2_OK) {
Tcl_SetResult(interp, (char *) argon2_error_message(hash_ret), NULL);
return(TCL_ERROR);
}
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(result, sizeof(result)));
return(TCL_OK);
|
|
>
|
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
return(TCL_ERROR);
}
password = Tcl_GetByteArrayFromObj(objv[1], &password_length);
salt = Tcl_GetByteArrayFromObj(objv[2], &salt_length);
hash_ret = argon2_hash(NANO_KDF_ARGON2_TIMING, NANO_KDF_ARGON2_MEMORY, NANO_KDF_ARGON2_THREADS,
password, password_length,
salt, salt_length,
result, sizeof(result),
NULL, 0, Argon2_d, 0x10);
if (hash_ret != ARGON2_OK) {
Tcl_SetResult(interp, (char *) argon2_error_message(hash_ret), NULL);
return(TCL_ERROR);
}
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(result, sizeof(result)));
return(TCL_OK);
|