From 2e97ecfbcd9afac4092fb09836d80d22fd778376 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 14 Feb 2018 12:45:03 -0500 Subject: [PATCH] crypto: move built-in AES implementation into crypto/ To prepare for a generic internal cipher API, move the built-in AES implementation into the crypto/ directory Backports commit 6f2945cde60545aae7f31ab9d5ef29531efbc94f from qemu --- msvc/unicorn/unicorn/unicorn.vcxproj | 4 ++-- msvc/unicorn/unicorn/unicorn.vcxproj.filters | 6 ------ msvc/unicorn/unicorn_static/unicorn_static.vcxproj | 4 ++-- msvc/unicorn/unicorn_static/unicorn_static.vcxproj.filters | 6 ------ qemu/crypto/Makefile.objs | 3 ++- qemu/{util => crypto}/aes.c | 2 +- qemu/include/{qemu => crypto}/aes.h | 0 qemu/target-arm/crypto_helper.c | 2 +- qemu/target-i386/fpu_helper.c | 1 - qemu/target-i386/ops_sse.h | 2 +- qemu/util/Makefile.objs | 1 - 11 files changed, 9 insertions(+), 22 deletions(-) rename qemu/{util => crypto}/aes.c (99%) rename qemu/include/{qemu => crypto}/aes.h (100%) diff --git a/msvc/unicorn/unicorn/unicorn.vcxproj b/msvc/unicorn/unicorn/unicorn.vcxproj index 76338e17..338cc9fa 100644 --- a/msvc/unicorn/unicorn/unicorn.vcxproj +++ b/msvc/unicorn/unicorn/unicorn.vcxproj @@ -195,6 +195,7 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ + @@ -218,7 +219,6 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ - @@ -287,6 +287,7 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ + @@ -327,7 +328,6 @@ copy $(SolutionDir)..\include\unicorn\*.h $(SolutionDir)distro\include\unicorn\ - diff --git a/msvc/unicorn/unicorn/unicorn.vcxproj.filters b/msvc/unicorn/unicorn/unicorn.vcxproj.filters index 149590fc..8fa49664 100644 --- a/msvc/unicorn/unicorn/unicorn.vcxproj.filters +++ b/msvc/unicorn/unicorn/unicorn.vcxproj.filters @@ -23,9 +23,6 @@ qemu - - qemu\util - qemu\util @@ -406,9 +403,6 @@ qemu\include\qapi\qmp - - qemu\include\qemu - qemu\include\qemu diff --git a/msvc/unicorn/unicorn_static/unicorn_static.vcxproj b/msvc/unicorn/unicorn_static/unicorn_static.vcxproj index 6c3aa890..6728bc81 100644 --- a/msvc/unicorn/unicorn_static/unicorn_static.vcxproj +++ b/msvc/unicorn/unicorn_static/unicorn_static.vcxproj @@ -22,6 +22,7 @@ + @@ -45,7 +46,6 @@ - @@ -100,6 +100,7 @@ + @@ -140,7 +141,6 @@ - diff --git a/msvc/unicorn/unicorn_static/unicorn_static.vcxproj.filters b/msvc/unicorn/unicorn_static/unicorn_static.vcxproj.filters index 8dd77e0a..c4c14407 100644 --- a/msvc/unicorn/unicorn_static/unicorn_static.vcxproj.filters +++ b/msvc/unicorn/unicorn_static/unicorn_static.vcxproj.filters @@ -147,9 +147,6 @@ qemu\qom - - qemu\util - qemu\util @@ -396,9 +393,6 @@ qemu\include\qapi\qmp - - qemu\include\qemu - qemu\include\qemu diff --git a/qemu/crypto/Makefile.objs b/qemu/crypto/Makefile.objs index 3ac3dfa2..a9363537 100644 --- a/qemu/crypto/Makefile.objs +++ b/qemu/crypto/Makefile.objs @@ -1,2 +1,3 @@ util-obj-y = init.o -util-obj-y += hash.o \ No newline at end of file +util-obj-y += hash.o +util-obj-y += aes.o \ No newline at end of file diff --git a/qemu/util/aes.c b/qemu/crypto/aes.c similarity index 99% rename from qemu/util/aes.c rename to qemu/crypto/aes.c index 50c69c38..700158c1 100644 --- a/qemu/util/aes.c +++ b/qemu/crypto/aes.c @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "qemu-common.h" -#include "qemu/aes.h" +#include "crypto/aes.h" typedef uint32_t u32; typedef uint8_t u8; diff --git a/qemu/include/qemu/aes.h b/qemu/include/crypto/aes.h similarity index 100% rename from qemu/include/qemu/aes.h rename to qemu/include/crypto/aes.h diff --git a/qemu/target-arm/crypto_helper.c b/qemu/target-arm/crypto_helper.c index 48ade427..3bf3f3e9 100644 --- a/qemu/target-arm/crypto_helper.c +++ b/qemu/target-arm/crypto_helper.c @@ -14,7 +14,7 @@ #include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" -#include "qemu/aes.h" +#include "crypto/aes.h" union CRYPTO_STATE { uint8_t bytes[16]; diff --git a/qemu/target-i386/fpu_helper.c b/qemu/target-i386/fpu_helper.c index 70018740..832f5281 100644 --- a/qemu/target-i386/fpu_helper.c +++ b/qemu/target-i386/fpu_helper.c @@ -20,7 +20,6 @@ #include #include "cpu.h" #include "exec/helper-proto.h" -#include "qemu/aes.h" #include "qemu/host-utils.h" #include "exec/cpu_ldst.h" diff --git a/qemu/target-i386/ops_sse.h b/qemu/target-i386/ops_sse.h index 16225b1f..d4f089ce 100644 --- a/qemu/target-i386/ops_sse.h +++ b/qemu/target-i386/ops_sse.h @@ -18,7 +18,7 @@ * License along with this library; if not, see . */ -#include "qemu/aes.h" +#include "crypto/aes.h" #if SHIFT == 0 #define Reg MMXReg diff --git a/qemu/util/Makefile.objs b/qemu/util/Makefile.objs index 874cee16..9800b748 100644 --- a/qemu/util/Makefile.objs +++ b/qemu/util/Makefile.objs @@ -4,7 +4,6 @@ util-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o util-obj-y += module.o util-obj-y += bitmap.o bitops.o util-obj-y += error.o -util-obj-y += aes.o util-obj-y += crc32c.o util-obj-y += host-utils.o util-obj-y += getauxval.o