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
5454 nonce,
5555 counter = UInt64 (0 ),
5656 position = 1 ;
57- doublerounds = 10
57+ doublerounds = 4
5858 )
5959 if doublerounds ≤ 0
6060 error (" `doublerounds` must be an even positive number" )
7575"""
7676 ChaCha20Stream(args...)
7777
78- Create a keystream for a ChaCha20 stream cipher.
78+ Create a random stream from the ChaCha20 stream cipher.
7979"""
8080ChaCha20Stream (args... ) = ChaChaStream (args... ; doublerounds= 10 )
8181
8282"""
8383 ChaCha12Stream(args...)
8484
85- Create a keystream for a ChaCha12 stream cipher.
85+ Create a random stream from the ChaCha12 stream cipher.
8686"""
8787ChaCha12Stream (args... ) = ChaChaStream (args... ; doublerounds= 6 )
8888
89+ """
90+ ChaCha8Stream(args...)
91+
92+ Create a random stream from the ChaCha8 stream cipher.
93+ """
94+ ChaCha8Stream (args... ) = ChaChaStream (args... ; doublerounds= 4 )
95+
8996function Base. show (io:: IO , rng:: ChaChaStream )
9097 msg = """
9198 ChaChaStream(
Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ using Test
1212 stream = ChaChaStream ()
1313 @test stream. nonce == 0
1414 @test stream. position == 1
15-
16- stream = ChaChaStream (; doublerounds= 4 )
1715 @test stream. doublerounds == 4
1816
17+ stream = ChaChaStream (; doublerounds= 6 )
18+ @test stream. doublerounds == 6
19+
1920 # We should receive an error if we try to create a
2021 # keystream with non-positive number of doublerounds
2122 @test_throws ErrorException ChaChaStream (; doublerounds= 0 )
You can’t perform that action at this time.
0 commit comments