private static Encrypt ( byte target, int targetOffset, byte source, int sourceOffset, int length, EncryptContext &ctx ) : void | ||
target | byte | |
targetOffset | int | |
source | byte | |
sourceOffset | int | |
length | int | |
ctx | EncryptContext | |
return | void |
private static void Encrypt(byte[] target, int targetOffset,
byte[] source, int sourceOffset, int length,
ref EncryptContext ctx)
{
int si = sourceOffset;
int ti = targetOffset;
for (int i = 0; i < length; i++, si++, ti++)
{
var p = source[si];
ctx.Hash ^= p << ((ctx.Index % 4) * 8);
target[ti] = (byte)(p ^ ctx.Key);
ctx.Index += 1;
}
}