哪位高手帮忙把C翻译成delphi,多谢
static void encipher(unsigned int *const v, const unsigned int *const k, unsigned int *const w)
{
register unsigned int
y = ntohl(v[0]),
z = ntohl(v[1]),
a = ntohl(k[0]),
b = ntohl(k[1]),
c = ntohl(k[2]),
d = ntohl(k[3]),
n = 0x10, /* do encrypt 16 (0x10) times */
sum = 0,
delta = 0x9E3779B9; /* 0x9E3779B9 - 0x100000000 = -0x61C88647 */
while (n-- > 0) {
sum += delta;
y += ((z < < 4) + a) ^ (z + sum) ^ ((z >> 5) + b);
z += ((y < < 4) + c) ^ (y + sum) ^ ((y >> 5) + d);
}
w[0] = htonl(y); w[1] = htonl(z);
}
static void decipher(unsigned int *const v, const unsigned int *const k, unsigned int *const w)
{
register unsigned int
y = ntohl(v[0]),
z = ntohl(v[1]),
a = ntohl(k[0]),
b = ntohl(k[1]),
c = ntohl(k[2]),
d = ntohl(k[3]),
n = 0x10,
sum = 0xE3779B90,
/* why this ? must be related with n value*/
delta = 0x9E3779B9;
/* sum = delta < <5, in general sum = delta *
有一10*10矩阵,除去第一个点(0,0)和最后一点(9,9),还有八个点为1,其他都为0,要求用二维数组表示。八个点是随机生成的,编写相关程序表示矩阵所有可能情况。
真心求教各位高手,哎!本人太菜了!呵呵!
......