Skip to content

Commit

Permalink
IncrementalXChaCha20Poly1305.cs: Prevent rekey after final chunk.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-lucas6 committed Sep 30, 2023
1 parent 416423b commit 56a9c41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Geralt/Crypto/IncrementalXChaCha20Poly1305.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public unsafe ChunkFlag Pull(Span<byte> plaintextChunk, ReadOnlySpan<byte> ciphe

public void Rekey()
{
if (_finalized) { throw new InvalidOperationException("Cannot rekey after the final chunk."); }
crypto_secretstream_xchacha20poly1305_rekey(ref _state);
}

Expand Down

0 comments on commit 56a9c41

Please sign in to comment.