99
1010Implementation of the [ SHA-3] family of cryptographic hash algorithms.
1111
12- There are 6 standard algorithms specified in the SHA-3 standard:
12+ There are 4 standard fixed-size algorithms specified in the SHA-3 standard:
13+ ` SHA3-224 ` , ` SHA3-256 ` , ` SHA3-384 ` , ` SHA3-512 ` .
1314
14- - ` SHA3-224 ` , ` SHA3-256 ` , ` SHA3-384 ` , ` SHA3-512 `
15- - ` SHAKE128 ` and ` SHAKE256 ` (an extendable output function (XOF))
15+ ` SHAKE128 ` and ` SHAKE256 ` extendable output functions (XOF) are defined in the [ ` shake ` ] crate
1616
1717Additionally, this crate supports:
18- - ` KeccakFull ` : CryptoNight variant of SHA-3
1918- ` Keccak224 ` , ` Keccak256 ` , ` Keccak384 ` , ` Keccak512 ` : NIST submission without padding changes
19+ - ` Keccak256Full ` : CryptoNight variant of SHA-3
2020
2121## Examples
2222
@@ -34,25 +34,6 @@ let hash = hasher.finalize();
3434assert_eq! (hash , hex! (" 3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532" ));
3535```
3636
37- SHAKE functions have an extendable output, so finalization method returns
38- XOF reader from which results of arbitrary length can be read. Note that
39- these functions do not implement ` Digest ` , so lower-level traits have to
40- be imported:
41-
42- ``` rust
43- use sha3 :: {shake :: Shake128 , digest :: {Update , ExtendableOutput , XofReader }};
44- use hex_literal :: hex;
45-
46- let mut hasher = Shake128 :: default ();
47- hasher . update (b " abc" );
48- let mut reader = hasher . finalize_xof ();
49- let mut buf = [0u8 ; 10 ];
50- reader . read (& mut buf );
51- assert_eq! (buf , hex! (" 5881092dd818bf5cf8a3" ));
52- reader . read (& mut buf );
53- assert_eq! (buf , hex! (" ddb793fbcba74097d5c5" ));
54- ```
55-
5637See the [ ` digest ` ] crate docs for additional examples.
5738
5839## License
@@ -86,4 +67,5 @@ dual licensed as above, without any additional terms or conditions.
8667[ // ] : # ( general links )
8768
8869[ SHA-3 ] : https://en.wikipedia.org/wiki/SHA-3
70+ [ `shake` ] : http://docs.rs/shake
8971[ `digest` ] : https://docs.rs/digest
0 commit comments