-
Notifications
You must be signed in to change notification settings - Fork 14
/
README
65 lines (42 loc) · 1.96 KB
/
README
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
This is a C++ implementation of the SHA-3 family of hash functions, based on
the documentation found at
http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
Download binaries at: http://www.danielhorne.co.uk/Projects/SHA-3/SHA3.html
Usage: sha3sum [command]* file*
where command is an optional parameter that can set either the algorithm, as
there is a slight difference between the bare keccak function and the SHA-3
variant.
Algorithm
-a=s : Set algorithm to SHA-3 (default).
-a=k : Set algotithm to Keccak.
-a=h : Set algorithm to SHAKE
Size
-w=224 : Set width to 224 bits.
-w=256 : Set width to 256 bits.
-w=384 : Set width to 384 bits.
-w=512 : Set width to 512 bits (default).
Digest size (SHAKE)
-d=number : Set the SHAKE digest size. Should be less than or equal to the hash size.
Should be multiple of 8
Only relevant for SHAKE - For SHA-3 and keccak, digest size is equal to sponge size.
Output format
-o=b : Base 64 encoded.
-o=h : hexadecimal (default)
Any number of files can be specified. Files will be processed with the most
recently specified options - for example:
sha3sum test.txt -a=k -w=384 test.txt -a=s -w=256 text.txt
will hash "test.txt" three times - First with 512-bit SHA-3, then with 384-bit
keccak, then finally with 256-bit SHA-3.
The intent with this implementation is to make a performant implementation in
pure C++, following modern idioms: Favouring inline functions over macros,
leaning on the compiler's optimiser instead of resorting to inline assembly,
for example.
ToDo:
- Add command option to set the chunk size for reading.
- Attempt formal proof of important aspects of this implementation.
Bugs:
- Any bugs, please either add them to the github repo
(https://github.com/DuSTman31/SHA-3/issues), or e-mail me at
[email protected] (remove "-"s).
- Will document the design and verification on www.danielhorne.co.uk when I
get round to it.