This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
b2sum.1
154 lines (154 loc) · 4.65 KB
/
b2sum.1
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
.TH B2SUM 1 blakesum
.SH NAME
b2sum - Compute and check BLAKE2 message digests
.SH SYNOPSIS
.B b2sum
[-l bits | -X bits] [-K key] [-P pepper] [-S salt] [-c | -B | -L | -U] [-sxz]
.RI [ file "] ..."
.SH DESCRIPTION
Print or check BLAKE2 checksums, using BLAKE2b by default.
.SH OPTIONS
The
.B b2sum
utility conforms to the Base Definitions volume of POSIX.1-2017,
.IR "Section 12.2" ,
.IR "Utility Syntax Guidelines" .
.PP
The following options are supported:
.TP
.B -B
Output checksums in binary representation. This suppresses
the filenames and checksum delimiters. Only the checksums
are printed.
.TP
.B -c
Read BLAKE2 sums from the file and check them against the
files on your systems. The input files files should be
formatted as the output of this program, or similarly.
This is not going to work if any of the filenames in the
input files starts with <space> or <tab>, or if they
contain a <newline>, unless the
.B -z
option is also used.
.TP
.BI "-K " key
Specify a key (which is used for MAC and PRF), that is
up to 32 bytes (if the
.B -s
option is used) or 64 bytes (otherwise) long, that the
algorithm shall use. The key shall be expressed in
hexadecimal: each byte in the key shall be expressed, from
left to right, as a pairs of hexadecimal digits where highest
bits in each byte is stored in the left digit in its pair and
the lowest bits in each byte is stored in the right digit in
its pair. No delimiters are used, so for a 4 byte key where
each byte's value is its index, the key is expessed as
.BR 00010203 ,
however each letter may be either small or capital.
The key may not be empty.
.TP
.B -L
Output checksums in lower-case hexadecimal representation. (Default)
.TP
.BI "-l " bits
Select output size, valid values are multiples of 8
between 8 and 512, inclusively, or if the
.B -s
option is used between 8 and 256, inclusively.
(Default is maximum.)
.TP
.BI "-P " pepper
Specify an 8-byte (if the
.B -s
option is used) or 16-byte pepper (\(dqpersonalisation\(dq)
(otherwise) that the algorithm shall use. This pepper shall
be expressed in full length hexadecimal: 16 (for 8-byte) or 32
(for 16-byte) hexadecimal digits, or rather 8 or 16 pairs
of hexadecimal digits, ordered from left to right to specify
the values from index 0 to the last byte. In each pair,
the left digit stores the high bits of the byte, and the
right digit stores the low bits of the byte. For example,
the digit pair
.B 80
represents a byte with the decimal value 128, whereas the
digit pair
.B 08
represents a byte with the decimal value 8. The pairs
are joined without any delimiters, and no byte may be
omitted. So, for a 8 byte pepper where each byte's value
is its index, the pepper is expressed as
.BR 0001020304050607 ,
however each letter may be either small or capital.
If no pepper is specified, an all-zeroes pepper is used.
.TP
.BI "-S " salt
Specify a 8-byte (if the
.B -s
option is used) or 16-byte salt
(otherwise) that the algorithm shall use. This salt shall
be expressed in full length hexadecimal: 16 (for 8-byte) or 32
(for 16-byte) hexadecimal digits, or rather 8 or 16 pairs
of hexadecimal digits, ordered from left to right to specify
the values from index 0 to the last byte. In each pair,
the left digit stores the high bits of the byte, and the
right digit stores the low bits of the byte. For example,
the digit pair
.B 80
represents a byte with the decimal value 128, whereas the
digit pair
.B 08
represents a byte with the decimal value 8. The pairs
are joined without any delimiters, and no byte may be
omitted. So, for a 8 byte salt where each byte's value
is its index, the salt is expressed as
.BR 0001020304050607 ,
however each letter may be either small or capital.
If no salt is specified, an all-zeroes salt is used.
.TP
.B -s
Use BLAKE2s instead of BLAKE2b.
.TP
.B -U
Output checksums in upper-case hexadecimal representation.
.TP
.BI "-X " bits
Use BLAKE2Xb instead of BLAKE2b or BLAKE2Xs instead of BLAKE2s,
and select the extended output function output length, in bits;
must be a non-zero multiple of 8, and no greater than
34359738360 or (if the
.B -s
option is used) 524280.
.TP
.B -x
Convert input files from hexadecimal form to binary form
before calculating the checksums.
.TP
.B -z
Lines end with NUL instead of LF. If used with
.BR -c ,
this applies to read files (not the output), but it will
also apply more strict parsing and allow any whitespace
in file names.
.SH OPERANDS
The following operands are supported:
.TP
.I file
File to read. The standard input will be used
.B -
or no
.I file
is specified.
.SH EXIT STATUS
.TP
0
Successful completion.
.TP
1
Checksums did not match or a file did not exist.
.TP
2
An error occurred.
.SH NOTES
BLAKE2X has not been finalised as of 2022-02-20.
.SH SEE ALSO
.BR bsum (1)