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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
NAME
anysum - compute or verify against multiple checksums
SYNOPSIS
anysum (-c [-w] | [-a algoritms] ...) [-W options] ...
[-z] [file] ...
DESCRIPTION
The anysum utility can calculate checksums of a file using
multiple hash functions, or using different parameters for
the function, in parallel (the utility can calculate checksums
for multiple files, but these are not calculated in parallel).
The anysum utility can also check a file against multiple
checksums using multiple hash function and hash function
parameters in parallel, and check that the file matches at
least one of the listed checksums.
OPTIONS
The anysum utility conforms to the Base Definitions volume of
POSIX.1-2017, Section 12.2, Utility Syntax Guidelines.
The following options are supported:
-a algorithms
Comma-separated list of hash functions and
parameters to compute checksums with.
Currently supported values are:
md2
For MD2.
md4
For MD4.
md5
For MD5.
ripemd128 or rmd128
For RIPEMD-128.
ripemd160 or rmd160
For RIPEMD-160.
ripemd256 or rmd256
For RIPEMD-256.
ripemd320 or rmd320
For RIPEMD-320.
sha0
For SHA-0.
sha1
For SHA-1.
sha224
For the 224 bit version of SHA-2.
sha256
For the 256 bit version of SHA-2.
sha384
For the 384 bit version of SHA-2.
sha512
For the 512 bit version of SHA-2.
sha512/224
For the 224 bit output variant of the
512 (and 384) bit version of SHA-2.
sha512/256
For the 256 bit output variant of the
512 (and 384) bit version of SHA-2.
keccak[r=BITRATE,c=CAPACITY,n=LENGTH,z=SQUEEZES]
For Keccak. The brackets and there parameter
list, and each parameter, are optional. Any
parameter the is skipped is automatically
determined. BITRATE and CAPACITY are the
Keccak function's bitrate and capacity bit
bits, and LENGTH is the hash length is bits.
SQUEEZES is the number of squeezes to perform
after a input has been feed into the function;
the default is one, and any number in excess
of this is the number of squeezes to perform
before squeezing out the hash.
keccak-224
For Keccak[r=1152,c=448,n=224].
keccak-256
For Keccak[r=1088,c=512,n=256].
keccak-384
For Keccak[r=832,c=768,n=384].
keccak-512
For Keccak[r=576,c=1024,n=512].
sha3-224
For the 224 bit version of SHA-3.
sha3-256
For the 256 bit version of SHA-3.
sha3-384
For the 384 bit version of SHA-3.
sha3-512
For the 512 bit version of SHA-3.
shake-128[n=LENGTH]
For the 128 bit version of SHAKE. The brackets
and n=LENGTH are optional; LENGTH shall the
output size in bits (default is 128).
shake-256[n=LENGTH]
For the 256 bit version of SHAKE. The brackets
and n=LENGTH are optional; LENGTH shall the
output size in bits (default is 256).
shake-512[n=LENGTH]
For the 512 bit version of SHAKE. The brackets
and n=LENGTH are optional; LENGTH shall the
output size in bits (default is 512).
rawshake-128[n=LENGTH]
For the 128 bit version of RawSHAKE. The
brackets and n=LENGTH are optional; LENGTH
shall the output size in bits (default is 128).
rawshake-256[n=LENGTH]
For the 256 bit version of RawSHAKE. The
brackets and n=LENGTH are optional; LENGTH
shall the output size in bits (default is 256).
rawshake-512[n=LENGTH]
For the 512 bit version of RawSHAKE. The
brackets and n=LENGTH are optional; LENGTH
shall the output size in bits (default is 512).
blake224[salt=SALT] or b224[salt=SALT]
For the 224 bit version of BLAKE. The brackets
and salt=SALT are optional; SALT shall be a 32
character long hexadecimal value.
blake256[salt=SALT] or b256[salt=SALT]
For the 256 bit version of BLAKE. The brackets
and salt=SALT are optional; SALT shall be a 32
character long hexadecimal value.
blake384[salt=SALT] or b384[salt=SALT]
For the 384 bit version of BLAKE. The brackets
and salt=SALT are optional; SALT shall be a 64
character long hexadecimal value.
blake512[salt=SALT] or b512[salt=SALT]
For the 512 bit version of BLAKE. The brackets
and salt=SALT are optional; SALT shall be a 64
character long hexadecimal value.
The utility does also recognise similar values
that are obviously equivalent.
-b
Read in binary mode when computing hashes.
-c
Verify the the files listed in file against the
checksums listed on the same lines. The file
shall be formatted as the output of the utility
when this option is not used. See the STDOUT
section for more information. If a file is listed
multiple times, it need only match one of the
checksums listed for the file.
The length of the listed checksums need not match
the length output by this utility; before the
checksums are compared, they are truncated to the
shorter of the two checksums.
-t
Read in text mode when computing hashes.
-W options
Comma-sepearated list of implementation-specific
options. The following options are supported:
output=format
format shall be "lowercase" if the checksums
shall be printed in lowercase hexadecimal
format (default), "uppercase" for uppercase
hexadecimal format, or "binary" for binary
format without anything but the checksum
printed to standard output. This option is
ignored if the -c option is used.
input=format
format shall be "binary" if the files are
be read in binary mode, "text" if the files
shall be read in text mode, or "hexadecimal"
they shall be decoded from hexadecimal to
binary. If the -c option is used, the mode
specification associated with a file is
overrides this behaviour for that file if
the line specifies hexadecimal mode.
threads=count
The maximum number of threads that the
utility may use. If "auto" is specified,
the utility selects a default value, which
currently is the number of online CPU threads
(at any time; assumed to be 8 if it cannot
be determined) minus 2, or 1 if this would
be less than 1.
recursive
If a file operand is a directory, the checksum
is computed for all files recursively.
This option is ignored if the -c option is
used.
no-recursive
The utility shall traverse directories.
(This is the default behaviour).
-w
Warn about, but skip, lines that are not properly
formatted.
-z
Use NUL byte as line ending instead of LF.
There is no difference between binary mode and text mode,
so the -b and -t options are ignored.
OPERANDS
The following operand is supported:
file
The file to read and compute the checksum for, or if
the -c option is used, use as the listing of files
and checksums to verify the files against. If dash
('-') is used or if no file operand is specified,
standard input will be used.
STDOUT
If the -c option is not used, the utility shall print the
following line for each calculated checksum, however there
are options that modify the format; see the OPTIONS section
for more information:
"%s:%s %c%s\n", <hash function>, <hash>, <mode>,
<file>
where <mode> is SP (' ') for text mode, an asterisk ('*')
for binary mode, or a pound sign ('#') for hexadecimal
mode; however if there is no difference between binary
mode and text mode and either is selected, SP (' ')
(text mode) is used.
If the -c option the output shall be on the format:
"%s: %s\n", <file>, <validity>
where <validity> is an implementation specified string
that describes whether the checksum was valid (possibly
with remarks), the file did not exist, the file could
not be read (possibly with error information), or if
the checksum was invalid or could not be compared
(possibly with remarks). The -z option does not modify
the line ending.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 Checksums did not match or a file did not exist.
2 An error occurred.
NOTES
Other implementations do not necessarily recognise the
'#' mode specifier in checksum list files.
|