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,33 @@
using Org.BouncyCastle.Security;
namespace Org.BouncyCastle.Crypto.Paddings;
public class ZeroBytePadding : IBlockCipherPadding
{
public string PaddingName => "ZeroBytePadding";
public void Init(SecureRandom random)
{
}
public int AddPadding(byte[] input, int inOff)
{
int result = input.Length - inOff;
while (inOff < input.Length)
{
input[inOff] = 0;
inOff++;
}
return result;
}
public int PadCount(byte[] input)
{
int num = input.Length;
while (num > 0 && input[num - 1] == 0)
{
num--;
}
return input.Length - num;
}
}