求一个Camellia算法的VB源码

来源:百度知道 编辑:UC知道 时间:2024/09/23 23:16:54

留下邮箱,我给你发过去。

这个难哦!!以前看老师写过....

c++算法

#

include "pch.h"

#ifdef WORD64_AVAILABLE

#include "camellia.h"
#include "misc.h"

NAMESPACE_BEGIN(CryptoPP)

// Define internal Camellia function macros

inline word64 Camellia::Base::F(word64 X)
{
word32 t1 = (word32)(X >> 32);
word32 t2 = (word32)(X & 0xFFFFFFFFL);
t2= (s2[GETBYTE(t2, 3)] << 24) |
(s3[GETBYTE(t2, 2)] << 16) |
(s4[GETBYTE(t2, 1)] << 8) |
(s1[GETBYTE(t2, 0)]);
t1= (s1[GETBYTE(t1, 3)] << 24) |
(s2[GETBYTE(t1, 2)] << 16) |
(s3[GETBYTE(t1, 1)] << 8) |
(s4[GETBYTE(t1, 0)]);
t1 ^= rotlFixed(t2, 8);
t2 ^= rotlFixed(t1, 16);
t1 ^= rotlFixed(t2, 24);
t2 ^= rotlFixed(t1, 24);
return ((word64)t2 << 32) | (word64)t1;
}

#define ROUND2(Xp, K1, K2) \