資源簡介
輕量級算法clefia,包含詳細(xì)的說明文檔和c代碼,代碼調(diào)試通過無誤,該適合應(yīng)用在資源受限平臺,如RFID等

代碼片段和文件信息
/******************************************************************************
?*?Copyright?2007?2008?Sony?Corporation
?*
?*?clefia_ref.c
?*
?*?“The?128-bit?Blockcipher?CLEFIA“
?*?Reference?ANSI?C?code
?*
?*?Version??1.0.1?(August?26?2008)
?*
?*?NOTICE
?*?This?reference?code?is?written?for?a?clear?understanding?of?the?CLEFIA
?*?blockcipher?algorithm?based?on?the?specification?of?CLEFIA.
?*?Therefore?this?code?does?not?include?any?optimizations?for
?*?high-speed?or?low-cost?implementations?or?any?countermeasures?against
?*?implementation?attacks.
?*
?*****************************************************************************/
void?ByteCpy(unsigned?char?*dst?const?unsigned?char?*src?int?bytelen);
void?ByteXor(unsigned?char?*dst?const?unsigned?char?*a?const?unsigned?char?*b?int?bytelen);
unsigned?char?ClefiaMul2(unsigned?char?x);
void?ClefiaF0Xor(unsigned?char?*y?const?unsigned?char?*x?const?unsigned?char?*rk);
void?ClefiaF1Xor(unsigned?char?*y?const?unsigned?char?*x?const?unsigned?char?*rk);
void?ClefiaGfn4(unsigned?char?*y?const?unsigned?char?*x?const?unsigned?char?*rk?int?r);
void?ClefiaGfn8(unsigned?char?*y?const?unsigned?char?*x?const?unsigned?char?*rk?int?r);
void?ClefiaGfn4Inv(unsigned?char?*y?const?unsigned?char?*x?const?unsigned?char?*rk?int?r);
void?ClefiaDoubleSwap(unsigned?char?*lk);
void?ClefiaConSet(unsigned?char?*con?const?unsigned?char?*iv?int?lk);
void?ClefiaKeySet128(unsigned?char?*rk?const?unsigned?char?*skey);
void?ClefiaKeySet192(unsigned?char?*rk?const?unsigned?char?*skey);
void?ClefiaKeySet256(unsigned?char?*rk?const?unsigned?char?*skey);
int?ClefiaKeySet(unsigned?char?*rk?const?unsigned?char?*skey?const?int?key_bitlen);
void?ClefiaEncrypt(unsigned?char?*ct?const?unsigned?char?*pt?const?unsigned?char?*rk?const?int?r);
void?ClefiaDecrypt(unsigned?char?*pt?const?unsigned?char?*ct?const?unsigned?char?*rk?const?int?r);
/*?S0?(8-bit?S-box?based?on?four?4-bit?S-boxes)?*/
const?unsigned?char?clefia_s0[256]?=?{
??0x57U?0x49U?0xd1U?0xc6U?0x2fU?0x33U?0x74U?0xfbU
??0x95U?0x6dU?0x82U?0xeaU?0x0eU?0xb0U?0xa8U?0x1cU
??0x28U?0xd0U?0x4bU?0x92U?0x5cU?0xeeU?0x85U?0xb1U
??0xc4U?0x0aU?0x76U?0x3dU?0x63U?0xf9U?0x17U?0xafU
??0xbfU?0xa1U?0x19U?0x65U?0xf7U?0x7aU?0x32U?0x20U
??0x06U?0xceU?0xe4U?0x83U?0x9dU?0x5bU?0x4cU?0xd8U
??0x42U?0x5dU?0x2eU?0xe8U?0xd4U?0x9bU?0x0fU?0x13U
??0x3cU?0x89U?0x67U?0xc0U?0x71U?0xaaU?0xb6U?0xf5U
??0xa4U?0xbeU?0xfdU?0x8cU?0x12U?0x00U?0x97U?0xdaU
??0x78U?0xe1U?0xcfU?0x6bU?0x39U?0x43U?0x55U?0x26U
??0x30U?0x98U?0xccU?0xddU?0xebU?0x54U?0xb3U?0x8fU
??0x4eU?0x16U?0xfaU?0x22U?0xa5U?0x77U?0x09U?0x61U
??0xd6U?0x2aU?0x53U?0x37U?0x45U?0xc1U?0x6cU?0xaeU
??0xefU?0x70U?0x08U?0x99U?0x8bU?0x1dU?0xf2U?0xb4U
??0xe9U?0xc7U?0x9fU?0x4aU?0x31U?0x25U?0xfeU?0x7cU
??0xd3U?0xa2U?0xbdU?0x56U?0x14U?0x88U?0x60U?0x0bU
??0xcdU?0xe2U
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-03-22?08:11??clefia\
?????文件??????105472??2012-03-10?09:49??clefia\CLEFIA算法.doc
?????目錄???????????0??2012-03-22?08:11??clefia\code\
?????目錄???????????0??2012-03-22?08:11??clefia\code\Debug\
?????文件???????41984??2012-03-11?22:55??clefia\code\Debug\JJJJ.bsc
?????文件??????180314??2012-03-11?22:55??clefia\code\Debug\JJJJ.exe
?????文件??????182760??2012-03-11?22:55??clefia\code\Debug\JJJJ.ilk
?????文件???????22777??2012-03-11?22:55??clefia\code\Debug\JJJJ.obj
?????文件??????157344??2012-03-11?22:55??clefia\code\Debug\JJJJ.pch
?????文件??????435200??2012-03-11?22:55??clefia\code\Debug\JJJJ.pdb
?????文件???????????0??2012-03-11?22:55??clefia\code\Debug\JJJJ.sbr
?????文件???????33792??2012-03-11?22:55??clefia\code\Debug\vc60.idb
?????文件???????45056??2012-03-11?22:55??clefia\code\Debug\vc60.pdb
?????文件???????17663??2012-03-12?00:23??clefia\code\JJJJ.c
?????文件????????3379??2012-03-12?00:23??clefia\code\JJJJ.dsp
?????文件?????????533??2012-03-10?09:49??clefia\code\JJJJ.dsw
?????文件???????50176??2012-03-12?00:23??clefia\code\JJJJ.ncb
?????文件???????48640??2012-03-12?00:23??clefia\code\JJJJ.opt
?????文件????????1286??2012-03-11?22:55??clefia\code\JJJJ.plg
- 上一篇:Easyhook教程
- 下一篇:幾種常見壓縮算法
評論
共有 條評論