Skip to content

Commit

Permalink
XChaCha20Poly1305Tests.cs: Improve secretstream.Reinitialize() test.
Browse files Browse the repository at this point in the history
Just to make sure Reinitialize() with encryption doesn't throw any errors.
  • Loading branch information
samuel-lucas6 committed Aug 17, 2024
1 parent c81fa0a commit caacb06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Geralt.Tests/XChaCha20Poly1305Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ public void Incremental_Reinitialize_Valid(string key, string plaintext, string

using var secretstream = new IncrementalXChaCha20Poly1305(decryption: false, h, k);
secretstream.Push(c, p, IncrementalXChaCha20Poly1305.ChunkFlag.Final);

secretstream.Reinitialize(decryption: false, h, k);
secretstream.Push(c, p, IncrementalXChaCha20Poly1305.ChunkFlag.Final);
p.Clear();

secretstream.Reinitialize(decryption: true, h, k);
Expand Down

0 comments on commit caacb06

Please sign in to comment.