aboutsummaryrefslogtreecommitdiffstats
path: root/libar2simplified_hash.3
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-15 11:49:20 +0100
committerMattias Andrée <maandree@kth.se>2022-02-15 11:49:20 +0100
commitbf71e9977f0f25c5a4eb4142355e255e08fde8a1 (patch)
treed1088dae8080803cb98a9fb27b03b7e6249f32c8 /libar2simplified_hash.3
parentRewait if sem_wait is interrupted (pthread_mutex_lock cannot be interrupted) (diff)
downloadlibar2simplified-bf71e9977f0f25c5a4eb4142355e255e08fde8a1.tar.gz
libar2simplified-bf71e9977f0f25c5a4eb4142355e255e08fde8a1.tar.bz2
libar2simplified-bf71e9977f0f25c5a4eb4142355e255e08fde8a1.tar.xz
Add readme and man pages
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libar2simplified_hash.389
1 files changed, 89 insertions, 0 deletions
diff --git a/libar2simplified_hash.3 b/libar2simplified_hash.3
new file mode 100644
index 0000000..71f0bd0
--- /dev/null
+++ b/libar2simplified_hash.3
@@ -0,0 +1,89 @@
+.TH LIBAR2SIMPLIFIED_HASH 3 LIBAR2SIMPLIFIED
+.SH NAME
+libar2simplified_hash - Hash a password with Argon2
+
+.SH SYNOPSIS
+.nf
+#include <libar2simplified.h>
+
+int libar2simplified_hash(void *\fIhash\fP, void *\fImsg\fP, size_t \fImsglen\fP, struct libar2_argon2_parameters *\fIparams\fP);
+.fi
+.PP
+Link with
+.IR "-lar2simplified -lar2 -lblake -lrt -pthread" .
+
+.SH DESCRIPTION
+The
+.BR libar2simplified_hash ()
+function calculates an Argon2 if the message
+provided in the
+.I msg
+parameter, whose length (in bytes) is provided in the
+.I msglen
+parameter, according to the hashing parameters
+specified in the
+.I params
+parameter. See
+.BR libar2_hash (3)
+for more information about
+.IR params .
+The hash (tag) is stored, in raw binary format
+(does not include the hashing parameters) in
+the buffer provided via the
+.I hash
+parameter. This buffer must be at least
+.I libar2_hash_buf_size(params)
+bytes large.
+.PP
+The
+.BR libar2simplified_hash ()
+function will erase (not deallocate) the contents of
+.I msg
+before returning.
+.PP
+Only
+.I msg
+may be
+.IR NULL ,
+but only if
+.I msglen
+is 0.
+
+.SH RETURN VALUES
+The
+.BR libar2simplified_hash ()
+function returns 0 upon successful completion.
+On error, -1 is returned and
+.I errno
+is set to describe the error.
+
+.SH ERRORS
+The
+.BR libar2simplified_hash ()
+function will fail if:
+.TP
+.B EINVAL
+The contents of
+.I str
+is invalid or unsupported.
+.TP
+.B ENOMEM
+Insufficient storage space is available.
+.TP
+.BR ENOSPC " or " EAGAIN
+A resource required to initialise some item
+needed for threading-support has been exhausted
+or the number of instances of such items have
+been reached.
+.TP
+.B EOWNERDEAD
+A thread terminated unexpectedly.
+
+.SH SEE ALSO
+.BR libar2simplified (7),
+.BR libar2simplified_decode (3),
+.BR libar2simplified_encode (3),
+.BR libar2simplified_encode_hash (3),
+.BR libar2simplified_crypt (3),
+.BR libar2_hash (3),
+.BR libar2_hash_buf_size (3)