• 大小: 48KB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2021-05-17
  • 语言: 其他
  • 标签: 其它源码  

资源简介

aes加密算法源代码.rar aes加密算法源代码.rar aes加密算法源代码.rar

代码片段和文件信息

/*
 -------------------------------------------------------------------------
 Copyright (c) 2001 Dr Brian Gladman <                 > 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. 

 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 fitness for purpose.
 -------------------------------------------------------------------------
 Issue Date: 29/07/2002

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

#include “aesopt.h“

#define unused  77  /* Sunset Strip */

#define si(yxkc) s(yc) = word_in(x + 4 * c) ^ k[c]
#define so(yxc)   word_out(y + 4 * c s(xc))

#if BLOCK_SIZE == 16

#if defined(ARRAYS)
#define locals(yx)     x[4]y[4]
#else
#define locals(yx)     x##0x##1x##2x##3y##0y##1y##2y##3
 /* 
   the following defines prevent the compiler requiring the declaration
   of generated but unused variables in the fwd_var and inv_var macros
 */
#define b04 unused
#define b05 unused
#define b06 unused
#define b07 unused
#define b14 unused
#define b15 unused
#define b16 unused
#define b17 unused
#endif
#define l_copy(y x)    s(y0) = s(x0); s(y1) = s(x1); \
                        s(y2) = s(x2); s(y3) = s(x3);
#define state_in(yxk) si(yxk0); si(yxk1); si(yxk2); si(yxk3)
#define state_out(yx)  so(yx0); so(yx1); so(yx2); so(yx3)
#define round(rmyxk) rm(yxk0); rm(yxk1); rm(yxk2); rm(yxk3)

#elif BLOCK_SIZE == 20

#if defined(ARRAYS)
#define locals(yx)     x[5]y[5]
#else
#define locals(yx)     x##0x##1x##2x##3x##4y##0y##1y##2y##3y##4
#define b05 unused
#define b06 unused
#define b07 unused
#define b15 unused
#define b16 unused
#define b17 unused
#endif
#define l_copy(y x)    s(y0) = s(x0); s(y1) = s(x1); \
                        s(y2) = s(x2); s(y3) = s(x3); s(y4) = s(x4); 
#define state_in(yxk) si(yxk0); si(yxk1); si(yxk2); si(yxk3); si(yxk4)
#define state_out(yx)  so(yx0); so(yx1); so(yx2); so(yx3); so(yx4)
#define round(rmyxk) rm(yxk0); rm(yxk1); rm(yxk2); rm(yxk3

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3482  2004-01-27 17:00  aes加密算法源代码\ewe\aes.h

     文件       3239  2004-01-27 17:00  aes加密算法源代码\ewe\aes.txt

     文件       2094  2002-07-29 16:03  aes加密算法源代码\ewe\aescpp.h

     文件      16293  2004-01-27 17:00  aes加密算法源代码\ewe\aescrypp.c

     文件      10795  2004-01-27 16:58  aes加密算法源代码\ewe\aescrypt.asm

     文件      13972  2004-01-27 17:00  aes加密算法源代码\ewe\aescrypt.c

     文件      11315  2002-09-27 10:19  aes加密算法源代码\ewe\aescrypt.obj

     文件      13836  2004-01-27 17:00  aes加密算法源代码\ewe\aeskey.c

     文件      12873  2004-01-27 17:00  aes加密算法源代码\ewe\aeskeypp.c

     文件      28076  2004-01-27 17:00  aes加密算法源代码\ewe\aesopt.h

     文件      17896  2004-01-27 17:00  aes加密算法源代码\ewe\aestab.c

     文件      15054  2004-01-27 17:00  aes加密算法源代码\ewe\aesxam.c

     文件       3168  2002-01-15 18:52  aes加密算法源代码\ewe\vb.txt

     文件      48640  2002-01-15 18:51  aes加密算法源代码\ewe\vbaxam.doc

     目录          0  2008-12-26 00:45  aes加密算法源代码\ewe

     目录          0  2008-12-26 00:45  aes加密算法源代码

----------- ---------  ---------- -----  ----

               200733                    16


评论

共有 条评论