aboutsummaryrefslogtreecommitdiffstats
path: root/libar2simplified_encode.3
blob: 1329e281084ea8654d46c145d6063e77a4cfcd1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.TH LIBAR2SIMPLIFIED_ENCODE 3 LIBAR2SIMPLIFIED
.SH NAME
libar2simplified_encode - Encode hashing parameters, with or without hashing result

.SH SYNOPSIS
.nf
#include <libar2simplified.h>

char *libar2simplified_encode(const struct libar2_argon2_parameters *\fIparams\fP, void *\fIhash\fP);
.fi
.PP
Link with
.IR "-lar2simplified -lar2" .

.SH DESCRIPTION
The
.BR libar2simplified_encode ()
function encode hashing parameters provided via the
.I params
parameter, with or without the tag (hashing result)
provided in the
.I hash
parameter.
.PP
This function extends the standard format for Argon2
by letting the exact salt or tag (hash) be unspecified,
but the length specified using an asterisk-prefixed,
decimal integer. See
.BR libar2_encode_params (3)
for details about the standard format. To set the salt
to unspecified, set
.I params->salt
to
.IR NULL .
To set the tag to unspecified, set
.I hash
to
.IR NULL .
See
.BR libar2_hash (3)
for details about
.IR params .
.PP
The secret (pepper) and associated data, which may be
set in
.I params
will not be included in the returned string.
.PP
.I params
may not be
.IR NULL .

.SH RETURN VALUES
The
.BR libar2simplified_encode ()
function returns a dynamically allocated string
detailing the contents of
.I params
and
.IR hash ,
which can be deallocated using the
.BR free (3)
function, upon successful completion. On error,
.I NULL
is returned and
.I errno
is set to describe the error.

.SH ERRORS
The
.BR libar2simplified_encode ()
function will fail if:
.TP
.B EINVAL
The contents of
.I params
is invalid or unsupported.
.TP
.B ENOMEM
Insufficient storage space is available.

.SH SEE ALSO
.BR libar2simplified (7),
.BR libar2simplified_encode_hash (3),
.BR libar2simplified_decode (3),
.BR libar2simplified_hash (3),
.BR libar2_encode_params (3),
.BR libar2_validate_params (3),
.BR libar2_hash (3)