亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? aescrypt.c

?? EJB,business logic 處理程序。 主要想找一點(diǎn)關(guān)于加密方面的程序。
?? C
字號(hào):
/*
 ---------------------------------------------------------------------------
 Copyright (c) 2003, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
 All rights reserved.

 LICENSE TERMS

 The free distribution and use of this software in both source and binary
 form is allowed (with or without changes) provided that:

   1. distributions of this source code include the above copyright
      notice, this list of conditions and the following disclaimer;

   2. distributions in binary form include the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other associated materials;

   3. the copyright holder's name is not used to endorse products
      built using this software without specific written permission.

 ALTERNATIVELY, provided that this notice is retained in full, this product
 may be distributed under the terms of the GNU General Public License (GPL),
 in which case the provisions of the GPL apply INSTEAD OF those given above.

 DISCLAIMER

 This software is provided 'as is' with no explicit or implied warranties
 in respect of its properties, including, but not limited to, correctness
 and/or fitness for purpose.
 ---------------------------------------------------------------------------
 Issue Date: 1/06/2003

 This file contains the code for implementing encryption and decryption
 for AES (Rijndael) for block and key sizes of 16, 24 and 32 bytes. It
 can optionally be replaced by code written in assembler using NASM. For
 further details see the file aesopt.h
*/

#include "aesopt.h"

#if defined(__cplusplus)
extern "C"
{
#endif

#define si(y,x,k,c) (s(y,c) = word_in(x, c) ^ (k)[c])
#define so(y,x,c)   word_out(y, c, s(x,c))

#if defined(ARRAYS)
#define locals(y,x)     x[4],y[4]
#else
#define locals(y,x)     x##0,x##1,x##2,x##3,y##0,y##1,y##2,y##3
#endif

#define l_copy(y, x)    s(y,0) = s(x,0); s(y,1) = s(x,1); \
                        s(y,2) = s(x,2); s(y,3) = s(x,3);
#define state_in(y,x,k) si(y,x,k,0); si(y,x,k,1); si(y,x,k,2); si(y,x,k,3)
#define state_out(y,x)  so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)
#define round(rm,y,x,k) rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)

#if defined(ENCRYPTION) && !defined(AES_ASM)

/* Visual C++ .Net v7.1 provides the fastest encryption code when using
   Pentium optimiation with small code but this is poor for decryption
   so we need to control this with the following VC++ pragmas
*/

#if defined(_MSC_VER)
#pragma optimize( "s", on )
#endif

/* Given the column (c) of the output state variable, the following
   macros give the input state variables which are needed in its
   computation for each row (r) of the state. All the alternative
   macros give the same end values but expand into different ways
   of calculating these values.  In particular the complex macro
   used for dynamically variable block sizes is designed to expand
   to a compile time constant whenever possible but will expand to
   conditional clauses on some branches (I am grateful to Frank
   Yellin for this construction)
*/

#define fwd_var(x,r,c)\
 ( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
 : r == 1 ? ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0))\
 : r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
 :          ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2)))

#if defined(FT4_SET)
#undef  dec_fmvars
#define fwd_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c))
#elif defined(FT1_SET)
#undef  dec_fmvars
#define fwd_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ one_table(x,upr,t_use(f,n),fwd_var,rf1,c))
#else
#define fwd_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ fwd_mcol(no_table(x,t_use(s,box),fwd_var,rf1,c)))
#endif

#if defined(FL4_SET)
#define fwd_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,c))
#elif defined(FL1_SET)
#define fwd_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ one_table(x,ups,t_use(f,l),fwd_var,rf1,c))
#else
#define fwd_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ no_table(x,t_use(s,box),fwd_var,rf1,c))
#endif

aes_rval aes_encrypt(const void *in_blk, void *out_blk, const aes_encrypt_ctx cx[1])
{   aes_32t			locals(b0, b1);
	const aes_32t	*kp = cx->ks;
#ifdef dec_fmvars
    dec_fmvars; /* declare variables for fwd_mcol() if needed */
#endif

    aes_32t nr = (kp[45] ^ kp[52] ^ kp[53] ? kp[52] : 14);

#ifdef AES_ERR_CHK
	if(   (nr != 10 || !(kp[0] | kp[3] | kp[4])) 
	   && (nr != 12 || !(kp[0] | kp[5] | kp[6]))
	   && (nr != 14 || !(kp[0] | kp[7] | kp[8])) )
		return aes_error;
#endif

    state_in(b0, in_blk, kp);

#if (ENC_UNROLL == FULL)

    switch(nr)
    {
    case 14:
        round(fwd_rnd,  b1, b0, kp + 1 * N_COLS);
        round(fwd_rnd,  b0, b1, kp + 2 * N_COLS);
        kp += 2 * N_COLS;
    case 12:
        round(fwd_rnd,  b1, b0, kp + 1 * N_COLS);
        round(fwd_rnd,  b0, b1, kp + 2 * N_COLS);
        kp += 2 * N_COLS;
    case 10:
        round(fwd_rnd,  b1, b0, kp + 1 * N_COLS);
        round(fwd_rnd,  b0, b1, kp + 2 * N_COLS);
        round(fwd_rnd,  b1, b0, kp + 3 * N_COLS);
        round(fwd_rnd,  b0, b1, kp + 4 * N_COLS);
        round(fwd_rnd,  b1, b0, kp + 5 * N_COLS);
        round(fwd_rnd,  b0, b1, kp + 6 * N_COLS);
        round(fwd_rnd,  b1, b0, kp + 7 * N_COLS);
        round(fwd_rnd,  b0, b1, kp + 8 * N_COLS);
        round(fwd_rnd,  b1, b0, kp + 9 * N_COLS);
        round(fwd_lrnd, b0, b1, kp +10 * N_COLS);
    }

#else

#if (ENC_UNROLL == PARTIAL)
    {   aes_32t    rnd;
        for(rnd = 0; rnd < (nr >> 1) - 1; ++rnd)
        {
            kp += N_COLS;
            round(fwd_rnd, b1, b0, kp);
            kp += N_COLS;
            round(fwd_rnd, b0, b1, kp);
        }
        kp += N_COLS;
        round(fwd_rnd,  b1, b0, kp);
#else
    {   aes_32t    rnd;
        for(rnd = 0; rnd < nr - 1; ++rnd)
        {
            kp += N_COLS;
            round(fwd_rnd, b1, b0, kp);
			l_copy(b0, b1);
        }
#endif
        kp += N_COLS;
        round(fwd_lrnd, b0, b1, kp);
    }
#endif

    state_out(out_blk, b0);
#ifdef AES_ERR_CHK
	return aes_good;
#endif
}

#endif

#if defined(DECRYPTION) && !defined(AES_ASM)

/* Visual C++ .Net v7.1 provides the fastest encryption code when using
   Pentium optimiation with small code but this is poor for decryption
   so we need to control this with the following VC++ pragmas
*/

#if defined(_MSC_VER)
#pragma optimize( "t", on )
#endif

/* Given the column (c) of the output state variable, the following
   macros give the input state variables which are needed in its
   computation for each row (r) of the state. All the alternative
   macros give the same end values but expand into different ways
   of calculating these values.  In particular the complex macro
   used for dynamically variable block sizes is designed to expand
   to a compile time constant whenever possible but will expand to
   conditional clauses on some branches (I am grateful to Frank
   Yellin for this construction)
*/

#define inv_var(x,r,c)\
 ( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
 : r == 1 ? ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2))\
 : r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
 :          ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0)))

#if defined(IT4_SET)
#undef  dec_imvars
#define inv_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))
#elif defined(IT1_SET)
#undef  dec_imvars
#define inv_rnd(y,x,k,c)    (s(y,c) = (k)[c] ^ one_table(x,upr,t_use(i,n),inv_var,rf1,c))
#else
#define inv_rnd(y,x,k,c)    (s(y,c) = inv_mcol((k)[c] ^ no_table(x,t_use(i,box),inv_var,rf1,c)))
#endif

#if defined(IL4_SET)
#define inv_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,c))
#elif defined(IL1_SET)
#define inv_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ one_table(x,ups,t_use(i,l),inv_var,rf1,c))
#else
#define inv_lrnd(y,x,k,c)   (s(y,c) = (k)[c] ^ no_table(x,t_use(i,box),inv_var,rf1,c))
#endif

aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx[1])
{   aes_32t        locals(b0, b1);
#ifdef dec_imvars
    dec_imvars; /* declare variables for inv_mcol() if needed */
#endif

    aes_32t nr = (cx->ks[45] ^ cx->ks[52] ^ cx->ks[53] ? cx->ks[52] : 14);
    const aes_32t *kp = cx->ks + nr * N_COLS;

#ifdef AES_ERR_CHK
	if(   (nr != 10 || !(cx->ks[0] | cx->ks[3] | cx->ks[4])) 
	   && (nr != 12 || !(cx->ks[0] | cx->ks[5] | cx->ks[6]))
	   && (nr != 14 || !(cx->ks[0] | cx->ks[7] | cx->ks[8])) )
		return aes_error;
#endif

	state_in(b0, in_blk, kp);

#if (DEC_UNROLL == FULL)

    switch(nr)
    {
    case 14:
        round(inv_rnd,  b1, b0, kp -  1 * N_COLS);
        round(inv_rnd,  b0, b1, kp -  2 * N_COLS);
        kp -= 2 * N_COLS;
    case 12:
        round(inv_rnd,  b1, b0, kp -  1 * N_COLS);
        round(inv_rnd,  b0, b1, kp -  2 * N_COLS);
        kp -= 2 * N_COLS;
    case 10:
        round(inv_rnd,  b1, b0, kp -  1 * N_COLS);
        round(inv_rnd,  b0, b1, kp -  2 * N_COLS);
        round(inv_rnd,  b1, b0, kp -  3 * N_COLS);
        round(inv_rnd,  b0, b1, kp -  4 * N_COLS);
        round(inv_rnd,  b1, b0, kp -  5 * N_COLS);
        round(inv_rnd,  b0, b1, kp -  6 * N_COLS);
        round(inv_rnd,  b1, b0, kp -  7 * N_COLS);
        round(inv_rnd,  b0, b1, kp -  8 * N_COLS);
        round(inv_rnd,  b1, b0, kp -  9 * N_COLS);
        round(inv_lrnd, b0, b1, kp - 10 * N_COLS);
    }

#else

#if (DEC_UNROLL == PARTIAL)
    {   aes_32t    rnd;
        for(rnd = 0; rnd < (nr >> 1) - 1; ++rnd)
        {
            kp -= N_COLS;
            round(inv_rnd, b1, b0, kp);
            kp -= N_COLS;
            round(inv_rnd, b0, b1, kp);
        }
        kp -= N_COLS;
        round(inv_rnd, b1, b0, kp);
#else
    {   aes_32t    rnd;
        for(rnd = 0; rnd < nr - 1; ++rnd)
        {
            kp -= N_COLS;
            round(inv_rnd, b1, b0, kp);
			l_copy(b0, b1);
        }
#endif
        kp -= N_COLS;
        round(inv_lrnd, b0, b1, kp);
    }
#endif

    state_out(out_blk, b0);
#ifdef AES_ERR_CHK
	return aes_good;
#endif
}

#endif

#if defined(__cplusplus)
}
#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲三级免费观看| 日本大香伊一区二区三区| 日韩理论片网站| 欧美一级二级在线观看| 不卡欧美aaaaa| 国产在线视频精品一区| 亚洲午夜一二三区视频| 国产精品无圣光一区二区| 欧美一区二区高清| 色八戒一区二区三区| 国产剧情在线观看一区二区| 日韩av网站在线观看| 亚洲视频免费在线| 久久九九久精品国产免费直播| 欧美电影在哪看比较好| 色先锋久久av资源部| 国产成人av网站| 久久国产剧场电影| 视频一区中文字幕| 亚洲妇女屁股眼交7| 亚洲图片另类小说| 国产精品夫妻自拍| 国产欧美一区在线| 久久婷婷色综合| 欧美大片日本大片免费观看| 欧美三级视频在线播放| 色综合天天综合在线视频| 国产成人av一区二区三区在线观看| 久久激情综合网| 麻豆精品视频在线观看免费| 五月婷婷欧美视频| 亚洲成人av一区| 亚洲综合丝袜美腿| 亚洲精品国产精华液| 亚洲色图色小说| 最近日韩中文字幕| 亚洲精品高清在线| 一区二区三区成人在线视频| 亚洲欧美日韩中文播放| 一区精品在线播放| 亚洲女爱视频在线| 亚洲最大色网站| 亚洲第一精品在线| 日韩国产欧美在线视频| 美女视频第一区二区三区免费观看网站| 亚洲成人资源在线| 日韩精品五月天| 麻豆高清免费国产一区| 韩国精品免费视频| 国产一区二区免费看| 国产成人免费在线视频| 日韩精品一区二区三区中文精品| 宅男噜噜噜66一区二区66| 欧美亚洲高清一区二区三区不卡| 欧美性三三影院| 欧美一区二区三区免费| 精品美女在线观看| 国产视频视频一区| 自拍av一区二区三区| 洋洋成人永久网站入口| 日韩精品91亚洲二区在线观看| 日韩电影一二三区| 国产麻豆欧美日韩一区| www.日韩精品| 欧美吻胸吃奶大尺度电影 | 欧美高清在线视频| 国产欧美日韩卡一| 亚洲精选免费视频| 日韩国产欧美在线播放| 国产精品一区二区你懂的| 成人蜜臀av电影| 欧美日韩一区精品| 精品精品国产高清一毛片一天堂| 亚洲国产精品精华液2区45| 亚洲免费电影在线| 麻豆一区二区99久久久久| 国产高清在线观看免费不卡| 色综合天天综合网天天狠天天| 欧美日韩国产一级| 国产日韩亚洲欧美综合| 一区二区三区在线播放| 久热成人在线视频| 91亚洲精品久久久蜜桃| 666欧美在线视频| 国产日韩av一区| 天堂精品中文字幕在线| 成人综合婷婷国产精品久久免费| 在线观看视频一区二区欧美日韩| 欧美草草影院在线视频| 国产精品久久久久久久久晋中 | 91精品视频网| 中文字幕一区二区三区不卡在线| 日韩精品一级中文字幕精品视频免费观看 | 欧美一区二区久久久| 中文字幕五月欧美| 精品一区二区三区视频| 91网站最新地址| 久久久久国产精品厨房| 亚洲高清免费在线| 成人激情开心网| 日韩一级黄色片| 亚洲自拍偷拍麻豆| av亚洲精华国产精华精| 精品久久久影院| 亚洲1区2区3区视频| 成人午夜伦理影院| 26uuu色噜噜精品一区| 偷拍与自拍一区| 色综合色综合色综合色综合色综合| 精品对白一区国产伦| 午夜视频一区二区三区| 国产女主播视频一区二区| 午夜欧美视频在线观看 | 国产不卡免费视频| 91精品黄色片免费大全| 一个色在线综合| 99视频有精品| 中文字幕国产精品一区二区| 国内精品在线播放| 日韩亚洲欧美一区| 日韩福利视频网| 欧美日韩高清影院| 亚洲夂夂婷婷色拍ww47 | 欧美性色综合网| 亚洲另类色综合网站| 不卡在线观看av| 国产精品美女久久久久aⅴ | 国产露脸91国语对白| 精品免费一区二区三区| 奇米一区二区三区av| 欧美精选在线播放| 首页国产丝袜综合| 91精品国产免费| 青青草97国产精品免费观看无弹窗版| 欧美丝袜自拍制服另类| 亚洲第一主播视频| 欧美精品aⅴ在线视频| 亚洲第一福利视频在线| 欧美三级一区二区| 日本va欧美va精品| 欧美一个色资源| 精品在线视频一区| 久久久久久久久久久久久女国产乱 | 日韩精品五月天| 日韩写真欧美这视频| 裸体一区二区三区| 精品成人佐山爱一区二区| 精品一区二区久久久| 2024国产精品| 成人美女在线视频| 亚洲欧美乱综合| 欧美性感一区二区三区| 日韩成人一级片| 久久无码av三级| 91色porny| 视频一区在线视频| 久久午夜羞羞影院免费观看| 成人av电影免费在线播放| 亚洲美女区一区| 欧美日韩一卡二卡三卡 | 欧美日韩国产色站一区二区三区| 婷婷开心激情综合| 精品国产区一区| 成人激情综合网站| 亚洲激情图片qvod| 欧美一区二区播放| 国产成人免费av在线| 亚洲综合在线观看视频| 欧美嫩在线观看| 国产精品亚洲第一| 一区二区三区在线观看动漫 | 久久精品亚洲麻豆av一区二区| 国产一区二区三区日韩| 一色屋精品亚洲香蕉网站| 欧美日韩一区二区三区在线| 韩国在线一区二区| 亚洲日本成人在线观看| 欧美一三区三区四区免费在线看| 国产91精品一区二区麻豆网站| 夜夜爽夜夜爽精品视频| 精品国产1区二区| 欧洲生活片亚洲生活在线观看| 久久精品国产在热久久| 国产精品毛片久久久久久久| 欧美人狂配大交3d怪物一区| 国产成人在线视频网站| 亚洲不卡av一区二区三区| 久久久天堂av| 欧美日韩精品高清| 99久久精品费精品国产一区二区| 午夜久久电影网| 国产精品久久久久久一区二区三区 | 肉色丝袜一区二区| 国产精品国产三级国产aⅴ中文 | 亚洲午夜影视影院在线观看| 国产午夜精品久久久久久免费视| 欧美日韩情趣电影| www.久久久久久久久| 精品中文字幕一区二区小辣椒| 亚洲综合一区二区精品导航|