File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ mutable struct ChaChaStream <: AbstractChaChaStream
54
54
nonce,
55
55
counter = UInt64 (0 ),
56
56
position = 1 ;
57
- doublerounds = 10
57
+ doublerounds = 4
58
58
)
59
59
if doublerounds ≤ 0
60
60
error (" `doublerounds` must be an even positive number" )
75
75
"""
76
76
ChaCha20Stream(args...)
77
77
78
- Create a keystream for a ChaCha20 stream cipher.
78
+ Create a random stream from the ChaCha20 stream cipher.
79
79
"""
80
80
ChaCha20Stream (args... ) = ChaChaStream (args... ; doublerounds= 10 )
81
81
82
82
"""
83
83
ChaCha12Stream(args...)
84
84
85
- Create a keystream for a ChaCha12 stream cipher.
85
+ Create a random stream from the ChaCha12 stream cipher.
86
86
"""
87
87
ChaCha12Stream (args... ) = ChaChaStream (args... ; doublerounds= 6 )
88
88
89
+ """
90
+ ChaCha8Stream(args...)
91
+
92
+ Create a random stream from the ChaCha8 stream cipher.
93
+ """
94
+ ChaCha8Stream (args... ) = ChaChaStream (args... ; doublerounds= 4 )
95
+
89
96
function Base. show (io:: IO , rng:: ChaChaStream )
90
97
msg = """
91
98
ChaChaStream(
Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ using Test
12
12
stream = ChaChaStream ()
13
13
@test stream. nonce == 0
14
14
@test stream. position == 1
15
-
16
- stream = ChaChaStream (; doublerounds= 4 )
17
15
@test stream. doublerounds == 4
18
16
17
+ stream = ChaChaStream (; doublerounds= 6 )
18
+ @test stream. doublerounds == 6
19
+
19
20
# We should receive an error if we try to create a
20
21
# keystream with non-positive number of doublerounds
21
22
@test_throws ErrorException ChaChaStream (; doublerounds= 0 )
You can’t perform that action at this time.
0 commit comments