1
1
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2
2
// file at the top-level directory of this distribution and at
3
- // http ://rust-lang.org/COPYRIGHT.
3
+ // https ://www. rust-lang.org/COPYRIGHT.
4
4
//
5
5
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
- // http ://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
- // <LICENSE-MIT or http ://opensource.org/licenses/MIT>, at your
6
+ // https ://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or https ://opensource.org/licenses/MIT>, at your
8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
@@ -19,21 +19,21 @@ use impls;
19
19
/// A cryptographically secure random number generator that uses the HC-128
20
20
/// algorithm.
21
21
///
22
- /// HC-128 is a stream cipher designed by Hongjun Wu[1], that we use as an RNG.
22
+ /// HC-128 is a stream cipher designed by Hongjun Wu [1], that we use as an RNG.
23
23
/// It is selected as one of the "stream ciphers suitable for widespread
24
- /// adoption" by eSTREAM[2].
24
+ /// adoption" by eSTREAM [2].
25
25
///
26
26
/// HC-128 is an array based RNG. In this it is similar to RC-4 and ISAAC before
27
27
/// it, but those have never been proven cryptographically secure (or have even
28
- /// been broken ).
28
+ /// been sgnificantly coompromised, as in the case of RC-4 [5] ).
29
29
///
30
30
/// Because HC-128 works with simple indexing into a large array and with a few
31
31
/// operations that parallelize well, it has very good performance. The size of
32
32
/// the array it needs, 4kb, can however be a disadvantage.
33
33
///
34
34
/// This implementation is not based on the version of HC-128 submitted to the
35
35
/// eSTREAM contest, but on a later version by the author with a few small
36
- /// improvements from December 15, 2009[3].
36
+ /// improvements from December 15, 2009 [3].
37
37
///
38
38
/// HC-128 has no known weaknesses that are easier to exploit than doing a
39
39
/// brute-force search of 2<sup>128</sup>. A very comprehensive analysis of the
@@ -48,11 +48,15 @@ use impls;
48
48
/// (http://www.ecrypt.eu.org/stream/)
49
49
///
50
50
/// [3]: Hongjun Wu, [Stream Ciphers HC-128 and HC-256]
51
- /// (http ://www3 .ntu.edu.sg/home/wuhj/research/hc/index.html)
51
+ /// (https ://www .ntu.edu.sg/home/wuhj/research/hc/index.html)
52
52
///
53
53
/// [4]: Shashwat Raizada (January 2015),
54
54
/// ["Some Results On Analysis And Implementation Of HC-128 Stream Cipher"]
55
55
/// (http://library.isical.ac.in:8080/jspui/bitstream/123456789/6636/1/TH431.pdf).
56
+ ///
57
+ /// [5]: Internet Engineering Task Force (Februari 2015),
58
+ /// ["Prohibiting RC4 Cipher Suites"]
59
+ /// (https://tools.ietf.org/html/rfc7465).
56
60
#[ derive( Clone ) ]
57
61
pub struct Hc128Rng {
58
62
state : Hc128 ,
0 commit comments