Diff
Not logged in

Differences From Artifact [0743a52f91]:

To Artifact [f81754edf1]:


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
..
49
50
51
52
53
54
55

56
57
58
59
60
61
62
..
86
87
88
89
90
91
92
93
94
95
96
97
//!
//! # Alternate primitives
//! `NaCl` supports the following secret-key encryption functions:
//!
//! ----------------------------------------------------------------
//! |`crypto_stream`           |primitive     |KEYBYTES |NONCEBYTES|
//! |--------------------------|--------------|---------|----------|
//! |`crypto_stream_aes128ctr` |`AES-128-CTR` |16       |16        |
//! |`crypto_stream_chacha20`  |`Chacha20/20` |32       |8         |
//! |`crypto_stream_salsa208`  |`Salsa20/8`   |32       |8         |
//! |`crypto_stream_salsa2012` |`Salsa20/12`  |32       |8         |
//! |`crypto_stream_salsa20`   |`Salsa20/20`  |32       |8         |
//! |`crypto_stream_xsalsa20`  |`XSalsa20/20` |32       |24        |
//! ----------------------------------------------------------------
//!
................................................................................
//! primitives it is no longer true that randomly generated nonces have negligible
//! risk of collision. Callers who are unable to count 1, 2, 3..., and who insist
//! on using these primitives, are advised to use a randomly derived key for each
//! message.
//!
//! # Example (keystream generation)
//! ```

//! use rust_sodium::crypto::stream;
//!
//! let key = stream::gen_key();
//! let nonce = stream::gen_nonce();
//! let keystream = stream::stream(128, &nonce, &key); // generate 128 bytes of keystream
//! ```
//!
................................................................................
//! assert_eq!(plaintext, &mut [0, 1, 2, 3]);
//! ```

pub use self::xsalsa20::*;
#[macro_use]
mod stream_macros;
pub mod xsalsa20;
pub mod aes128ctr;
pub mod salsa208;
pub mod salsa2012;
pub mod salsa20;
pub mod chacha20;







<







 







>







 







<




33
34
35
36
37
38
39

40
41
42
43
44
45
46
..
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
..
86
87
88
89
90
91
92

93
94
95
96
//!
//! # Alternate primitives
//! `NaCl` supports the following secret-key encryption functions:
//!
//! ----------------------------------------------------------------
//! |`crypto_stream`           |primitive     |KEYBYTES |NONCEBYTES|
//! |--------------------------|--------------|---------|----------|

//! |`crypto_stream_chacha20`  |`Chacha20/20` |32       |8         |
//! |`crypto_stream_salsa208`  |`Salsa20/8`   |32       |8         |
//! |`crypto_stream_salsa2012` |`Salsa20/12`  |32       |8         |
//! |`crypto_stream_salsa20`   |`Salsa20/20`  |32       |8         |
//! |`crypto_stream_xsalsa20`  |`XSalsa20/20` |32       |24        |
//! ----------------------------------------------------------------
//!
................................................................................
//! primitives it is no longer true that randomly generated nonces have negligible
//! risk of collision. Callers who are unable to count 1, 2, 3..., and who insist
//! on using these primitives, are advised to use a randomly derived key for each
//! message.
//!
//! # Example (keystream generation)
//! ```
//! # #![allow(unused_variables)]
//! use rust_sodium::crypto::stream;
//!
//! let key = stream::gen_key();
//! let nonce = stream::gen_nonce();
//! let keystream = stream::stream(128, &nonce, &key); // generate 128 bytes of keystream
//! ```
//!
................................................................................
//! assert_eq!(plaintext, &mut [0, 1, 2, 3]);
//! ```

pub use self::xsalsa20::*;
#[macro_use]
mod stream_macros;
pub mod xsalsa20;

pub mod salsa208;
pub mod salsa2012;
pub mod salsa20;
pub mod chacha20;