91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 12KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-03
  • 語言: C/C++
  • 標簽: AES??

資源簡介

AES/ECB/PKCS5Padding C++實現

資源截圖

代碼片段和文件信息

//
//??AES_.c
//??Encryption
//
//??Created?by?Jason.xu?on?13-10-22.
//??Copyright?(c)?2013年?zhoumin.?All?rights?reserved.
//

/*
?*??FIPS-197?compliant?AES?implementation
?*
?*??Copyright?(C)?2003-2006??Christophe?Devine
?*
?*??This?library?is?free?software;?you?can?redistribute?it?and/or
?*??modify?it?under?the?terms?of?the?GNU?Lesser?General?Public
?*??License?version?2.1?as?published?by?the?Free?Software?Foundation.
?*
?*??This?library?is?distributed?in?the?hope?that?it?will?be?useful
?*??but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*??MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the?GNU
?*??Lesser?General?Public?License?for?more?details.
?*
?*??You?should?have?received?a?copy?of?the?GNU?Lesser?General?Public
?*??License?along?with?this?library;?if?not?write?to?the?Free?Software
?*??Foundation?Inc.?51?Franklin?Street?Fifth?Floor?Boston
?*??MA??02110-1301??USA
?*/
/*
?*??The?AES?block?cipher?was?designed?by?Vincent?Rijmen?and?Joan?Daemen.
?*
?*??http://csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf
?*??http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
?*/

#ifndef?_CRT_SECURE_NO_DEPRECATE
#define?_CRT_SECURE_NO_DEPRECATE?1
#endif
#include?
#include?
#include?

#include?“AES.h“

#ifndef?uint8
#define?uint8?unsigned?char
#endif

#ifndef?uint32
#define?uint32?unsigned?long
#endif

/*
?*?32-bit?integer?manipulation?macros?(big?endian)
?*/
#ifndef?GET_UINT32_BE
#define?GET_UINT32_BE(nbi)????????????????????????????\
{???????????????????????????????????????????????????????\
(n)?=?(?(uint32)?(b)[(i)????]?<|?(?(uint32)?(b)[(i)?+?1]?<|?(?(uint32)?(b)[(i)?+?2]?<|?(?(uint32)?(b)[(i)?+?3]???????);???????\
}
#endif
#ifndef?PUT_UINT32_BE
#define?PUT_UINT32_BE(nbi)????????????????????????????\
{???????????????????????????????????????????????????????\
(b)[(i)????]?=?(uint8)?(?(n)?>>?24?);???????\
(b)[(i)?+?1]?=?(uint8)?(?(n)?>>?16?);???????\
(b)[(i)?+?2]?=?(uint8)?(?(n)?>>??8?);???????\
(b)[(i)?+?3]?=?(uint8)?(?(n)???????);???????\
}
#endif

/*
?*?Uncomment?the?following?line?to?use?pre-computed?tables
?*?otherwise?the?tables?will?be?generated?at?the?first?run.
?*
?*?#define?FIXED_TABLES
?*/

#if?!defined(FIXED_TABLES)

/*
?*?Forward?S-box?&?tables
?*/
static?uint8?FSb[256];
static?uint32?FT0[256];
static?uint32?FT1[256];
static?uint32?FT2[256];
static?uint32?FT3[256];

/*
?*?Reverse?S-box?&?tables
?*/
static?uint8?RSb[256];
static?uint32?RT0[256];
static?uint32?RT1[256];
static?uint32?RT2[256];
static?uint32?RT3[256];

/*
?*?Round?constants
?*/
static?uint32?RCON[10];

/*
?*?Tables?generation?code
?*/
#define?ROTR8(x)?(?(?(?x?<(?(?x?&?0xFFFFFFFF?)?>>?8?)?)
#define?XTIME(x)?(?(?x?<#define?MUL(xy)?(?(?x?&&?y?)???pow[(log[x]?+?log[y])?%?255]?:?0?)

s

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????38907??2017-08-22?16:35??AES.cpp
?????文件????????3166??2017-08-22?16:35??AES.h

評論

共有 條評論