77![ Rust Version] [ rustc-image ]
88[ ![ Project Chat] [ chat-image ]] [ chat-link ]
99
10- Pure Rust implementation of the [ Ascon-XOF128] extendable output function (XOF).
10+ Pure Rust implementation of the Ascon-XOF128 and Ascon-СXOF128 extendable output functions (XOF)
11+ specified in [ NIST SP 800-232] .
1112
1213## Examples
1314
@@ -23,7 +24,21 @@ xof.update(b"some bytes");
2324let mut reader = xof . finalize_xof ();
2425let mut dst = [0u8 ; 5 ];
2526reader . read (& mut dst );
26- assert_eq! (dst , hex! (" 8c7dd114a0" ));
27+ assert_eq! (dst , hex! (" 8C7DD114A0" ));
28+ ```
29+
30+ Ascon-CXOF128 works similarly, but you must specify a customization string to initialize it:
31+
32+ ``` rust
33+ use ascon_xof128 :: {AsconCxof128 , CustomizedInit , ExtendableOutput , Update , XofReader };
34+ use hex_literal :: hex;
35+
36+ let mut xof = AsconCxof128 :: new_customized (b " some customization string" );
37+ xof . update (b " some bytes" );
38+ let mut reader = xof . finalize_xof ();
39+ let mut dst = [0u8 ; 5 ];
40+ reader . read (& mut dst );
41+ assert_eq! (dst , hex! (" 7824810FF7" ));
2742```
2843
2944See the [ ` digest ` ] crate docs for additional examples.
@@ -58,5 +73,5 @@ dual licensed as above, without any additional terms or conditions.
5873
5974[ // ] : # ( general links )
6075
61- [ Ascon-XOF128 ] : https://doi.org/10.6028/ NIST.SP.800-232.ipd
76+ [ NIST SP 800-232 ] : https://nvlpubs.nist.gov/nistpubs/SpecialPublications/ NIST.SP.800-232.ipd.pdf
6277[ `digest` ] : https://docs.rs/digest
0 commit comments