init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using System;
namespace Org.BouncyCastle.Crypto.Tls;
internal class DtlsEpoch
{
private readonly DtlsReplayWindow mReplayWindow = new DtlsReplayWindow();
private readonly int mEpoch;
private readonly TlsCipher mCipher;
private long mSequenceNumber = 0L;
internal TlsCipher Cipher => mCipher;
internal int Epoch => mEpoch;
internal DtlsReplayWindow ReplayWindow => mReplayWindow;
internal long SequenceNumber => mSequenceNumber;
internal DtlsEpoch(int epoch, TlsCipher cipher)
{
if (epoch < 0)
{
throw new ArgumentException("must be >= 0", "epoch");
}
if (cipher == null)
{
throw new ArgumentNullException("cipher");
}
mEpoch = epoch;
mCipher = cipher;
}
internal long AllocateSequenceNumber()
{
return mSequenceNumber++;
}
}