s/u_int32_t/uint32_t/
kill the rest of u32,u16,u8
This commit is contained in:
parent
b97f63a242
commit
55ef051c47
38
crypto/dist/openssl/fips/aes/fips_aes_core.c
vendored
38
crypto/dist/openssl/fips/aes/fips_aes_core.c
vendored
@ -56,7 +56,7 @@ Td3[x] = Si[x].[09, 0d, 0b, 0e];
|
||||
Td4[x] = Si[x].[01, 01, 01, 01];
|
||||
*/
|
||||
|
||||
static const u_int32_t Te0[256] = {
|
||||
static const uint32_t Te0[256] = {
|
||||
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
|
||||
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
|
||||
0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
|
||||
@ -122,7 +122,7 @@ static const u_int32_t Te0[256] = {
|
||||
0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
|
||||
0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
|
||||
};
|
||||
static const u_int32_t Te1[256] = {
|
||||
static const uint32_t Te1[256] = {
|
||||
0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
|
||||
0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
|
||||
0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
|
||||
@ -188,7 +188,7 @@ static const u_int32_t Te1[256] = {
|
||||
0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
|
||||
0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
|
||||
};
|
||||
static const u_int32_t Te2[256] = {
|
||||
static const uint32_t Te2[256] = {
|
||||
0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
|
||||
0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
|
||||
0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
|
||||
@ -254,7 +254,7 @@ static const u_int32_t Te2[256] = {
|
||||
0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
|
||||
0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
|
||||
};
|
||||
static const u_int32_t Te3[256] = {
|
||||
static const uint32_t Te3[256] = {
|
||||
|
||||
0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
|
||||
0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
|
||||
@ -321,7 +321,7 @@ static const u_int32_t Te3[256] = {
|
||||
0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
|
||||
0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
|
||||
};
|
||||
static const u_int32_t Te4[256] = {
|
||||
static const uint32_t Te4[256] = {
|
||||
0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
|
||||
0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
|
||||
0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
|
||||
@ -387,7 +387,7 @@ static const u_int32_t Te4[256] = {
|
||||
0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
|
||||
0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
|
||||
};
|
||||
static const u_int32_t Td0[256] = {
|
||||
static const uint32_t Td0[256] = {
|
||||
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
|
||||
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
|
||||
0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
|
||||
@ -453,7 +453,7 @@ static const u_int32_t Td0[256] = {
|
||||
0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
|
||||
0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
|
||||
};
|
||||
static const u_int32_t Td1[256] = {
|
||||
static const uint32_t Td1[256] = {
|
||||
0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
|
||||
0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
|
||||
0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
|
||||
@ -519,7 +519,7 @@ static const u_int32_t Td1[256] = {
|
||||
0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
|
||||
0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
|
||||
};
|
||||
static const u_int32_t Td2[256] = {
|
||||
static const uint32_t Td2[256] = {
|
||||
0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
|
||||
0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
|
||||
0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
|
||||
@ -586,7 +586,7 @@ static const u_int32_t Td2[256] = {
|
||||
0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
|
||||
0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
|
||||
};
|
||||
static const u_int32_t Td3[256] = {
|
||||
static const uint32_t Td3[256] = {
|
||||
0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
|
||||
0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
|
||||
0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
|
||||
@ -652,7 +652,7 @@ static const u_int32_t Td3[256] = {
|
||||
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
|
||||
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
|
||||
};
|
||||
static const u_int32_t Td4[256] = {
|
||||
static const uint32_t Td4[256] = {
|
||||
0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
|
||||
0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
|
||||
0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
|
||||
@ -718,7 +718,7 @@ static const u_int32_t Td4[256] = {
|
||||
0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
|
||||
0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
|
||||
};
|
||||
static const u_int32_t rcon[] = {
|
||||
static const uint32_t rcon[] = {
|
||||
0x01000000, 0x02000000, 0x04000000, 0x08000000,
|
||||
0x10000000, 0x20000000, 0x40000000, 0x80000000,
|
||||
0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
|
||||
@ -730,9 +730,9 @@ static const u_int32_t rcon[] = {
|
||||
int AES_set_encrypt_key(const unsigned char *userKey,
|
||||
const FIPS_AES_SIZE_T bits, AES_KEY *key) {
|
||||
|
||||
u_int32_t *rk;
|
||||
uint32_t *rk;
|
||||
int i = 0;
|
||||
u_int32_t temp;
|
||||
uint32_t temp;
|
||||
|
||||
if (!userKey || !key)
|
||||
return -1;
|
||||
@ -833,9 +833,9 @@ int AES_set_encrypt_key(const unsigned char *userKey,
|
||||
int AES_set_decrypt_key(const unsigned char *userKey,
|
||||
const FIPS_AES_SIZE_T bits, AES_KEY *key) {
|
||||
|
||||
u_int32_t *rk;
|
||||
uint32_t *rk;
|
||||
int i, j, status;
|
||||
u_int32_t temp;
|
||||
uint32_t temp;
|
||||
|
||||
/* first, start with an encryption schedule */
|
||||
status = AES_set_encrypt_key(userKey, bits, key);
|
||||
@ -885,8 +885,8 @@ int AES_set_decrypt_key(const unsigned char *userKey,
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key) {
|
||||
|
||||
const u_int32_t *rk;
|
||||
u_int32_t s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
const uint32_t *rk;
|
||||
uint32_t s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
#ifndef FULL_UNROLL
|
||||
int r;
|
||||
#endif /* ?FULL_UNROLL */
|
||||
@ -1076,8 +1076,8 @@ void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key) {
|
||||
|
||||
const u_int32_t *rk;
|
||||
u_int32_t s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
const uint32_t *rk;
|
||||
uint32_t s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
#ifndef FULL_UNROLL
|
||||
int r;
|
||||
#endif /* ?FULL_UNROLL */
|
||||
|
12
crypto/dist/openssl/fips/aes/fips_aes_locl.h
vendored
12
crypto/dist/openssl/fips/aes/fips_aes_locl.h
vendored
@ -64,17 +64,13 @@
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_M_IA64) && !defined(OPENSSL_SYS_WINCE)
|
||||
# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
|
||||
# define GETU32(p) SWAP(*((u32 *)(p)))
|
||||
# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }
|
||||
# define GETU32(p) SWAP(*((uint32_t *)(p)))
|
||||
# define PUTU32(ct, st) { *((uint32_t *)(ct)) = SWAP((st)); }
|
||||
#else
|
||||
# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
|
||||
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
|
||||
# define GETU32(pt) (((uint32_t)(pt)[0] << 24) ^ ((uint32_t)(pt)[1] << 16) ^ ((uint32_t)(pt)[2] << 8) ^ ((uint32_t)(pt)[3]))
|
||||
# define PUTU32(ct, st) { (ct)[0] = (uint8_t)((st) >> 24); (ct)[1] = (uint8_t)((st) >> 16); (ct)[2] = (uint8_t)((st) >> 8); (ct)[3] = (uint8_t)(st); }
|
||||
#endif
|
||||
|
||||
typedef unsigned long u32;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned char u8;
|
||||
|
||||
#define MAXKC (256/32)
|
||||
#define MAXKB (256/8)
|
||||
#define MAXNR 14
|
||||
|
Loading…
Reference in New Issue
Block a user