aboutsummaryrefslogtreecommitdiffstats
path: root/libar2simplified_hash.c
blob: 20fb2c025925dd75d344329915ec31d67d446772 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* See LICENSE file for copyright and license details. */
#include "common.h"


int
libar2simplified_hash(void *hash, void *msg, size_t msglen, struct libar2_argon2_parameters *params)
{
	struct libar2_context ctx;
	int ret;

	libar2simplified_init_context(&ctx);
	ctx.autoerase_message = 1;

	ret = libar2_hash(hash, msg, msglen, params, &ctx);
	if (ret)
		libar2_erase(msg, msglen);
	return ret;
}