diff options
| author | Gary Lin <glin@suse.com> | 2017-03-31 16:34:14 +0800 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2017-04-11 10:42:18 -0400 |
| commit | 0f3dfc01e2d5e7df882c963dd8dc4a0dfbfc96ad (patch) | |
| tree | 3e7253b5ca3b922f4007e593e8a30511e1a81eb1 /Cryptlib/OpenSSL/crypto/aes/aes_core.c | |
| parent | 4da6ac819510c7cc4ba21d7a735d69b45daa5873 (diff) | |
| download | efi-boot-shim-0f3dfc01e2d5e7df882c963dd8dc4a0dfbfc96ad.tar.gz efi-boot-shim-0f3dfc01e2d5e7df882c963dd8dc4a0dfbfc96ad.zip | |
Cryptlib/OpenSSL: update to openssl 1.1.0e
- Delete the old openssl files and use the script to copy the new files
- Add "-DNO_SYSLOG" to CFLAGS and add crypto/include to the include path
Signed-off-by: Gary Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/aes/aes_core.c')
| -rw-r--r-- | Cryptlib/OpenSSL/crypto/aes/aes_core.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/Cryptlib/OpenSSL/crypto/aes/aes_core.c b/Cryptlib/OpenSSL/crypto/aes/aes_core.c index 7019b5d7..bd5c7793 100644 --- a/Cryptlib/OpenSSL/crypto/aes/aes_core.c +++ b/Cryptlib/OpenSSL/crypto/aes/aes_core.c @@ -1,4 +1,12 @@ -/* crypto/aes/aes_core.c */ +/* + * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + /** * rijndael-alg-fst.c * @@ -28,14 +36,10 @@ /* Note: rewritten a little bit to provide error control and an OpenSSL- compatible API */ -#ifndef AES_DEBUG -# ifndef NDEBUG -# define NDEBUG -# endif -#endif #include <assert.h> #include <stdlib.h> +#include <openssl/crypto.h> #include <openssl/aes.h> #include "aes_locl.h" @@ -625,8 +629,8 @@ static const u32 rcon[] = { /** * Expand the cipher key into the encryption key schedule. */ -int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key) +int AES_set_encrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key) { u32 *rk; @@ -640,9 +644,9 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, rk = key->rd_key; - if (bits==128) + if (bits == 128) key->rounds = 10; - else if (bits==192) + else if (bits == 192) key->rounds = 12; else key->rounds = 14; @@ -727,8 +731,8 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, /** * Expand the cipher key into the decryption key schedule. */ -int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key) +int AES_set_decrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key) { u32 *rk; @@ -736,7 +740,7 @@ int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, u32 temp; /* first, start with an encryption schedule */ - status = private_AES_set_encrypt_key(userKey, bits, key); + status = AES_set_encrypt_key(userKey, bits, key); if (status < 0) return status; @@ -1204,11 +1208,11 @@ static const u32 rcon[] = { /** * Expand the cipher key into the encryption key schedule. */ -int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key) +int AES_set_encrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key) { u32 *rk; - int i = 0; + int i = 0; u32 temp; if (!userKey || !key) @@ -1218,9 +1222,9 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, rk = key->rd_key; - if (bits==128) + if (bits == 128) key->rounds = 10; - else if (bits==192) + else if (bits == 192) key->rounds = 12; else key->rounds = 14; @@ -1305,8 +1309,8 @@ int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, /** * Expand the cipher key into the decryption key schedule. */ -int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key) +int AES_set_decrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key) { u32 *rk; @@ -1314,7 +1318,7 @@ int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, u32 temp; /* first, start with an encryption schedule */ - status = private_AES_set_encrypt_key(userKey, bits, key); + status = AES_set_encrypt_key(userKey, bits, key); if (status < 0) return status; @@ -1351,7 +1355,7 @@ int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, rk[j] = tpe ^ ROTATE(tpd,16) ^ ROTATE(tp9,24) ^ ROTATE(tpb,8); #else - rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ + rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ (tp9 >> 8) ^ (tp9 << 24) ^ (tpb >> 24) ^ (tpb << 8); #endif |
