aboutsummaryrefslogtreecommitdiffstats
path: root/libkeccak_cshake_initialise.3
blob: a18f1bf06b0f0f4ee7ac81bd38edf9189c141276 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
.TH LIBKECCAK_CSHAKE_INITIALISE 3 LIBKECCAK
.SH NAME
libkeccak_cshake_initialise - Initialise a sponge for cSHAKE hashing
.SH SYNOPSIS
.nf
#include <libkeccak.h>

void libkeccak_cshake_initialise(struct libkeccak_state *restrict \fIstate\fP,
                                 const void *\fIn_text\fP, size_t \fIn_len\fP, size_t \fIn_bits\fP, const char *\fIn_suffix\fP,
                                 const void *\fIs_text\fP, size_t \fIs_len\fP, size_t \fIs_bits\fP, const char *\fIs_suffix\fP);
.fi
.PP
Link with
.IR -lkeccak .
.SH DESCRIPTION
The
.BR libkeccak_cshake_suffix ()
function shall be called immediately
after the
.BR libkeccak_state_initialise (3)
function (before
.BR libkeccak_update (3)
or
.BR libkeccak_digest (3),
or any variant of those functions),
to provide the initialisation blocks,
containing customisation data, to the
Keccak sponge.
.PP
The value of the
.I state
parameter shall be an initialised state
to feed the initialisation blocks to.
.PP
The value of the
.I n_text
parameter shall be the function-name
bit-string, represented in raw bytes;
.I n_len
shall be value no greater than the
number of whole bytes in
.I n_text
and
.I n_bits
shall be the number of bits in
.I n_text
sans the bytes covered by
.IR n_len ,
that is, the number of bits in
.I n_text
minus
.IR (nlen_*8) .
.I n_suffix
shall be either
.I NULL
or an appendix of bits to
.I n_suffix
(neither
.I n_len
nor
.I n_bits
shall count these), stored as a NUL-terminated
string of the ASCII digits
.B 1
and
.BR 0 .
.PP
The value of the
.I s_text
parameter shall be the customisation
bit-string, represented in raw bytes;
.I s_len
shall be value no greater than the
number of whole bytes in
.I s_text
and
.I s_bits
shall be the number of bits in
.I s_text
sans the bytes covered by
.IR s_len ,
that is, the number of bits in
.I s_text
minus
.IR (nles_*8) .
.I s_suffix
shall be either
.I NULL
or an appendix of bits to
.I s_suffix
(neither
.I s_len
nor
.I s_bits
shall count these), stored as a NUL-terminated
string of the ASCII digits
.B 1
and
.BR 0 .
.PP
For the
.I n_suffix
and
.I s_suffix
parameters,
.I NULL
is treated as the empty string.
.SH RETURN VALUES
The
.BR libkeccak_cshake_suffix ()
function does not return a value.
.SH ERRORS
The
.BR libkeccak_cshake_suffix ()
function cannot fail.
.SH SEE ALSO
.BR libkeccak_spec_cshake (3),
.BR libkeccak_generalised_spec_initialise (3),
.BR libkeccak_state_initialise (3),
.BR libkeccak_cshake_initialise (3),
.BR libkeccak_fast_update (3),
.BR libkeccak_zerocopy_update (3),
.BR libkeccak_update (3),
.BR libkeccak_fast_digest (3),
.BR libkeccak_zerocopy_digest (3),
.BR libkeccak_digest (3)