Check-in [78b6dd6345]
Overview
Comment:Minor cleanup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | monocypher
Files: files | file ages | folders
SHA3-256: 78b6dd6345ee2346ebaabac60e2f54626f5f79fda97ee7490446ffa243aec976
User & Date: rkeene on 2019-01-10 09:55:57
Other Links: branch diff | manifest | tags
Context
2019-01-10
20:54
Move upstream packages into a "vendor" directory check-in: 51030d9980 user: rkeene tags: monocypher
09:55
Minor cleanup check-in: 78b6dd6345 user: rkeene tags: monocypher
09:45
Added untested argon2-based key derivation check-in: 3872cde7b2 user: rkeene tags: monocypher
Changes

Modified nano.c from [2ca35184b8] to [aa5532a5f2].

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);