本文整理汇总了C#中System.UInt32.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# UInt32.CopyTo方法的具体用法?C# UInt32.CopyTo怎么用?C# UInt32.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.UInt32
的用法示例。
在下文中一共展示了UInt32.CopyTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decrypt
private static UInt32[] Decrypt(UInt32[] v, UInt32[] k)
{
Int32 n = v.Length - 1;
if (n < 1) {
return v;
}
if (k.Length < 4) {
UInt32[] Key = new UInt32[4];
k.CopyTo(Key, 0);
k = Key;
}
UInt32 z = v[n], y = v[0], sum, e;
Int32 p, q = 6 + 52 / (n + 1);
unchecked {
sum = (UInt32)(q * delta);
while (sum != 0) {
e = sum >> 2 & 3;
for (p = n; p > 0; p--) {
z = v[p - 1];
y = v[p] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
}
z = v[n];
y = v[0] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
sum -= delta;
}
}
return v;
}
示例2: Encrypt
private static UInt32[] Encrypt(UInt32[] v, UInt32[] k)
{
Int32 n = v.Length - 1;
if (n < 1)
{
return v;
}
if (k.Length < 4)
{
UInt32[] Key = new UInt32[4];
k.CopyTo(Key, 0);
k = Key;
}
UInt32 z = v[n], y = v[0], delta = 0x9E3779B9, sum = 0, e;
Int32 p, q = 6 + 52 / (n + 1);
while (q-- > 0)
{
sum = unchecked(sum + delta);
e = sum >> 2 & 3;
for (p = 0; p < n; p++)
{
y = v[p + 1];
z = unchecked(v[p] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
}
y = v[0];
z = unchecked(v[n] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
}
return v;
}
示例3: Decrypt
private static UInt32[] Decrypt(UInt32[] v, UInt32[] k)
{
Int32 n = v.Length - 1;
if (n < 1)
{
return v;
}
if (k.Length < 4)
{
var key = new UInt32[4];
k.CopyTo(key, 0);
k = key;
}
UInt32 y = v[0];
Int32 q = 6 + 52 / (n + 1);
var sum = unchecked((UInt32)(q * mDelta));
while (sum != 0)
{
UInt32 e = sum >> 2 & 3;
UInt32 z;
Int32 p;
for (p = n; p > 0; p--)
{
z = v[p - 1];
y = unchecked(v[p] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
}
z = v[n];
y = unchecked(v[0] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
sum = unchecked(sum - mDelta);
}
return v;
}
示例4: Encrypt
private static UInt32[] Encrypt(UInt32[] v, UInt32[] k)
{
Int32 n = v.Length - 1;
if (n < 1)
{
return v;
}
if (k.Length < 4)
{
var key = new UInt32[4];
k.CopyTo(key, 0);
k = key;
}
UInt32 z = v[n];
UInt32 sum = 0;
Int32 q = 6 + 52 / (n + 1);
while (q-- > 0)
{
sum = unchecked(sum + mDelta);
UInt32 e = sum >> 2 & 3;
UInt32 y;
Int32 p;
for (p = 0; p < n; p++)
{
y = v[p + 1];
z = unchecked(v[p] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
}
y = v[0];
z = unchecked(v[n] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
}
return v;
}
示例5: load
//clark 2011.3.23
public rfid.Constants.Result load(
rfid.Linkage transport,
UInt32 readerHandle
)
{
UInt32[ ] tmpBuf = new UInt32[ OEMCFG_AREA_MAP_SIZE_WORDS ];
rfid.Constants.Result Result = rfid.Constants.Result.OK;
Array.Clear(tmpBuf, 0, tmpBuf.Length);
//MacReadOemData only load one ome at one time. load all ome to buf.
for (ushort index = 0; index < OEMCFG_AREA_MAP_SIZE_WORDS; index++)
{
Result = transport.API_MacReadOemData(index,
ref tmpBuf[index]);
if (rfid.Constants.Result.OK != Result)
return Result;
}
tmpBuf.CopyTo(oemDataBuffer, 0);
return Result;
}