aboutsummaryrefslogblamecommitdiffstats
path: root/libar2_hash_buf_size.3
blob: dcb8285560f34e68511a64c1fc0f376a56cc3a48 (plain) (tree)



























                                                                           

                                               
                  
                    

                 








                                               



                           




                                       



                   
.TH LIBAR2_HASH_BUF_SIZE 7 LIBAR2
.SH NAME
libar2_hash_buf_size - Determine require output buffer size

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

size_t libar2_hash_buf_size(struct libar2_argon2_parameters *\fIparams\fP);
.fi
.PP
Link with
.IR -lar2 .

.SH DESCRIPTION
The
.BR libar2_hash_buf_size ()
function returns the number of bytes that the
output buffer for the
.BR libar2_hash (3)
function must fit (that it, it's first parameter).
.PP
.I params
may not be
.IR NULL .
.PP
The return value is
.I params->hashlen
if this number is 64 or less, a multiple of 128
that is around twice as large as
.I params->hashlen
(can be a bit more).

.SH RETURN VALUES
The
.BR libar2_hash_buf_size ()
function returns the number of bytes that the
output buffer size for the
.BR libar2_hash (3)
function upon successful completion. On failure
0 is returned and
.I errno
is set to describe the error.

.SH ERRORS
The
.BR libar2_hash_buf_size ()
function will fail if:
.TP
.B EOVERFLOW
The resulting value is too large to fit
in the return type.

.SH SEE ALSO
.BR libar2 (7),
.BR libar2_hash (3)