diff --git a/.gitignore b/.gitignore index 91108d86e..985d74827 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ /linux/installer/bin/*.bin # files downloaded in preparation phase -Intel redistributable binary.txt +BSD-3-Clause.txt Master_EULA_for_Intel_Sw_Development_Products.pdf external/ippcp_internal/inc/ippcp.h external/ippcp_internal/inc/ippcpdefs.h diff --git a/.gitmodules b/.gitmodules index 9f21e4a0c..d980c15ab 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ [submodule "ipp-crypto"] path = external/ippcp_internal/ipp-crypto url = https://github.com/intel/ipp-crypto.git - branch = ipp-crypto_2021_3 + branch = ipp-crypto_2021_7 [submodule "external/protobuf/protobuf_code"] path = external/protobuf/protobuf_code url = https://github.com/protocolbuffers/protobuf.git @@ -20,3 +20,6 @@ [submodule "external/sgx-emm/emm_src"] path = external/sgx-emm/emm_src url = https://github.com/intel/sgx-emm.git +[submodule "external/mbedtls/mbedtls_code"] + path = external/mbedtls/mbedtls_code + url = https://github.com/Mbed-TLS/mbedtls.git diff --git a/Linux_SGXEclipsePlugin/readme.txt b/Linux_SGXEclipsePlugin/readme.txt index e602a6868..15e77b0b4 100644 --- a/Linux_SGXEclipsePlugin/readme.txt +++ b/Linux_SGXEclipsePlugin/readme.txt @@ -6,7 +6,7 @@ $DELETE_CURRENT_ECLIPSE - Delete current eclipse or not. Generally this variable The following plugins are pre-requisites to be installed in Eclipse before trying to build the plugin. -1. Eclipse IDE for C/C++ Developers 4.7.3.20180308-1800 (tested_version) +1. Eclipse IDE for C/C++ Developers 4.21.0.20210910-1417 (tested_version) 2. Eclipse PDE Plug-in Developer Resources 3.13.3.v20180301-11 (tested_version) run ./build.sh from command line under current directory. diff --git a/README.md b/README.md index b89b31f6c..4a4cde36c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ The [intel-sgx-ssl](https://github.com/intel/intel-sgx-ssl) project provides a f This repository provides a reference implementation of a Launch Enclave for 'Flexible Launch Control' under [psw/ae/ref_le](psw/ae/ref_le). The reference LE implementation can be used as a basis for enforcing different launch control policy by the platform developer or owner. To build and try it by yourself, please refer to the [ref_le.md](psw/ae/ref_le/ref_le.md) for details. +**NOTE**: The reference LE is only workable with [linux-sgx-driver](https://github.com/intel/linux-sgx-driver) and is planned to be deprecated starting from Intel(R) SGX release 2.20. License ------- @@ -73,7 +74,7 @@ Quick Start with Docker and Docker Compose $ cd docker/build && ./build_compose_run.sh ``` -- Use prebuilt PSW and SDK downloaded from 01.org. See this [README](linux/installer/docker/README.md) for details. +- Build and deploy SGX exclave applications using prebuilt PSW and SDK downloaded from 01.org. See this [README](linux/installer/docker/README.md) for details. ``` $ cd linux/installer/docker && ./build_compose_run.sh ``` diff --git a/SampleCode/SampleAEXNotify/App/App.cpp b/SampleCode/SampleAEXNotify/App/App.cpp new file mode 100644 index 000000000..061634cb8 --- /dev/null +++ b/SampleCode/SampleAEXNotify/App/App.cpp @@ -0,0 +1,245 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include +#include +#include + +# include +# include +# define MAX_PATH FILENAME_MAX +#include +#include "powers_of_two.h" +#include "sgx_urts.h" +#include "App.h" +#include "Enclave_u.h" + +/* Global EID shared by multiple threads */ +sgx_enclave_id_t global_eid = 0; + +typedef struct _sgx_errlist_t { + sgx_status_t err; + const char *msg; + const char *sug; /* Suggestion */ +} sgx_errlist_t; + +/* Error code returned by sgx_create_enclave */ +static sgx_errlist_t sgx_errlist[] = { + { + SGX_ERROR_UNEXPECTED, + "Unexpected error occurred.", + NULL + }, + { + SGX_ERROR_INVALID_PARAMETER, + "Invalid parameter.", + NULL + }, + { + SGX_ERROR_OUT_OF_MEMORY, + "Out of memory.", + NULL + }, + { + SGX_ERROR_ENCLAVE_LOST, + "Power transition occurred.", + "Please refer to the sample \"PowerTransition\" for details." + }, + { + SGX_ERROR_INVALID_ENCLAVE, + "Invalid enclave image.", + NULL + }, + { + SGX_ERROR_INVALID_ENCLAVE_ID, + "Invalid enclave identification.", + NULL + }, + { + SGX_ERROR_INVALID_SIGNATURE, + "Invalid enclave signature.", + NULL + }, + { + SGX_ERROR_OUT_OF_EPC, + "Out of EPC memory.", + NULL + }, + { + SGX_ERROR_NO_DEVICE, + "Invalid SGX device.", + "Please make sure SGX module is enabled in the BIOS, and install SGX driver afterwards." + }, + { + SGX_ERROR_MEMORY_MAP_CONFLICT, + "Memory map conflicted.", + NULL + }, + { + SGX_ERROR_INVALID_METADATA, + "Invalid enclave metadata.", + NULL + }, + { + SGX_ERROR_DEVICE_BUSY, + "SGX device was busy.", + NULL + }, + { + SGX_ERROR_INVALID_VERSION, + "Enclave version was invalid.", + NULL + }, + { + SGX_ERROR_INVALID_ATTRIBUTE, + "Enclave was not authorized.", + NULL + }, + { + SGX_ERROR_ENCLAVE_FILE_ACCESS, + "Can't open enclave file.", + NULL + }, +}; + +/* Check error conditions for loading enclave */ +void print_error_message(sgx_status_t ret) +{ + size_t idx = 0; + size_t ttl = sizeof sgx_errlist/sizeof sgx_errlist[0]; + + for (idx = 0; idx < ttl; idx++) { + if(ret == sgx_errlist[idx].err) { + if(NULL != sgx_errlist[idx].sug) + printf("Info: %s\n", sgx_errlist[idx].sug); + printf("Error: %s\n", sgx_errlist[idx].msg); + break; + } + } + + if (idx == ttl) + printf("Error code is 0x%X. Please refer to the \"Intel SGX SDK Developer Reference\" for more details.\n", ret); +} + +/* Initialize the enclave: + * Call sgx_create_enclave to initialize an enclave instance + */ +int initialize_enclave(void) +{ + sgx_status_t ret = SGX_ERROR_UNEXPECTED; + + /* Call sgx_create_enclave to initialize an enclave instance */ + /* Debug Support: set 2nd parameter to 1 */ + ret = sgx_create_enclave(ENCLAVE_FILENAME, SGX_DEBUG_FLAG, NULL, NULL, &global_eid, NULL); + if (ret != SGX_SUCCESS) { + print_error_message(ret); + return -1; + } + + return 0; +} + +/* OCall functions */ +void ocall_print_string(const char *str) +{ + /* Proxy/Bridge will check the length and null-terminate + * the input string to prevent buffer overflow. + */ + printf("%s", str); +} + + +/* Application entry */ +int SGX_CDECL main(int argc, char *argv[]) +{ + (void)(argc); + (void)(argv); + + + /* Initialize the enclave */ + if(initialize_enclave() < 0){ + printf("Enter a character before exit ...\n"); + getchar(); + return -1; + } + + // We want to run a program for a really long time by + // searching for powers of two between 0 and max_value. + // Our initial max_value guess for something that will + // take about 60 seconds is 0xffff. + uint64_t max_value = 0xffff; + time_t t1 = 0, t2 = 0; + uint32_t count = 0; + + // Find out what max value takes more than 60 seconds when running + // outside the enclave. + while ((t2 - t1) < 60) + { + if ((t2 - t1) < 30) + max_value *= 4; + else + max_value *= 2; + + t1 = time(NULL); + count = count_powers_of_two(0, max_value); + t2 = time(NULL); + printf("There are %u powers of two between 0 and %p (calculated outside the enclave)\n", count, (void*)max_value); + printf("\tIt took %u seconds to compute\n", (uint32_t)(t2 - t1)); + fflush(stdout); + } + + // Now we have a good idea of something that should take at least 60 seconds + // Make an ECALL for the same function with AEX Enabled. The function + // will also count the number of times it its AEX handler was called back. + count = 0; + uint64_t aex_count = 0; + t1 = time(NULL); + sgx_status_t status = count_powers_of_two_with_aex(global_eid, 0, max_value, &count, &aex_count); + t2 = time(NULL); + if (status != SGX_SUCCESS) + { + printf("count_powers_of_two_with_aex returned %#x\n", status); + print_error_message(status); + return -1; + } + printf("There are %u powers of two between 0 and %p (calculated inside the enclave)\n", count, (void*)max_value); + printf("\tIt took %u seconds to compute\n", (uint32_t)(t2 - t1)); + printf("\tWe counted %lu async enclave exits during this time period. \n", aex_count); + + /* Destroy the enclave */ + sgx_destroy_enclave(global_eid); + + printf("Info: SampleAEXNotify successfully returned.\n"); + + return 0; +} + diff --git a/SampleCode/SampleAEXNotify/App/App.h b/SampleCode/SampleAEXNotify/App/App.h new file mode 100644 index 000000000..485b47519 --- /dev/null +++ b/SampleCode/SampleAEXNotify/App/App.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#ifndef _APP_H_ +#define _APP_H_ + +#include +#include +#include +#include + +#include "sgx_error.h" /* sgx_status_t */ +#include "sgx_eid.h" /* sgx_enclave_id_t */ + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifndef FALSE +# define FALSE 0 +#endif + +# define TOKEN_FILENAME "enclave.token" +# define ENCLAVE_FILENAME "enclave.signed.so" + +extern sgx_enclave_id_t global_eid; /* global enclave id */ + +#endif /* !_APP_H_ */ diff --git a/SampleCode/SampleAEXNotify/Enclave/Enclave.config.xml b/SampleCode/SampleAEXNotify/Enclave/Enclave.config.xml new file mode 100644 index 000000000..833b1dbbb --- /dev/null +++ b/SampleCode/SampleAEXNotify/Enclave/Enclave.config.xml @@ -0,0 +1,13 @@ + + 0 + 0 + 0x40000 + 0x100000 + 10 + 1 + 1 + + 0 + 0 + 0xFFFFFFFF + diff --git a/SampleCode/SampleAEXNotify/Enclave/Enclave.cpp b/SampleCode/SampleAEXNotify/Enclave/Enclave.cpp new file mode 100644 index 000000000..30ab6f0e3 --- /dev/null +++ b/SampleCode/SampleAEXNotify/Enclave/Enclave.cpp @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "Enclave.h" +#include "Enclave_t.h" /* print_string */ +#include +#include /* vsnprintf */ +#include +#include +#include +#include + +#include "powers_of_two.h" + +void count_powers_of_two(uint64_t low, uint64_t high, uint32_t* count) +{ + if(!count) return; + const uint32_t local_count = count_powers_of_two(low,high); + *count = local_count; +} + +/* + * printf: + * Invokes OCALL to display the enclave buffer to the terminal. + */ +int printf(const char* fmt, ...) +{ + char buf[BUFSIZ] = { '\0' }; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, BUFSIZ, fmt, ap); + va_end(ap); + ocall_print_string(buf); + return (int)strnlen(buf, BUFSIZ - 1) + 1; +} + +uint64_t g_aex_count = 0; + +static void my_aex_notify_handler(const sgx_exception_info_t *info, const void * args) +{ + // This sample will not perform any additional mitigations beyond what the trts + // does. It will do some simple counting. + (void)info; + (void)args; + g_aex_count++; +} + +// Count the number of powers of two between [low, high]. +// Also count the number of times our AEX-Notify handler was called. +// If the function runs long enough, normal OS preemptive multitasking +// should generate an AEX. +// You can use additional threads and thread affinity to change the OS +// behavior and induce more async enclave exits as needed. +void count_powers_of_two_with_aex(uint64_t low, uint64_t high, uint32_t* count, uint64_t* aex_count) +{ + if(!count) return; + if(!aex_count) return; + + g_aex_count = 0; + + const char* args = NULL; + sgx_aex_mitigation_node_t node; + + sgx_register_aex_handler(&node, my_aex_notify_handler, (const void*)args); + sgx_set_ssa_aexnotify(1); + + const uint32_t local_count = count_powers_of_two(low,high); + *count = local_count; + + sgx_set_ssa_aexnotify(0); + sgx_unregister_aex_handler(my_aex_notify_handler); + + *aex_count = g_aex_count; +} + + diff --git a/SampleCode/SampleAEXNotify/Enclave/Enclave.edl b/SampleCode/SampleAEXNotify/Enclave/Enclave.edl new file mode 100644 index 000000000..362481fce --- /dev/null +++ b/SampleCode/SampleAEXNotify/Enclave/Enclave.edl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* Enclave.edl - Top EDL file. */ + +enclave { + + trusted { + /* + * count_powers_of_two_with_aex - Counts the number of powers of two between low and high, and also + * the number of async enclave exits during this process. + */ + public void count_powers_of_two_with_aex(uint64_t low, uint64_t high, [out] uint32_t* count, [out] uint64_t* aex_count); + }; + + + /* + * ocall_print_string - invokes OCALL to display string buffer inside the enclave. + * [in]: copy the string buffer to App outside. + * [string]: specifies 'str' is a NULL terminated buffer. + */ + untrusted { + void ocall_print_string([in, string] const char *str); + }; + +}; diff --git a/SampleCode/SampleAEXNotify/Enclave/Enclave.h b/SampleCode/SampleAEXNotify/Enclave/Enclave.h new file mode 100644 index 000000000..f6bb82b59 --- /dev/null +++ b/SampleCode/SampleAEXNotify/Enclave/Enclave.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _ENCLAVE_H_ +#define _ENCLAVE_H_ + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int printf(const char* fmt, ...); + +#if defined(__cplusplus) +} +#endif + +#endif /* !_ENCLAVE_H_ */ diff --git a/SampleCode/SampleAEXNotify/Enclave/Enclave.lds b/SampleCode/SampleAEXNotify/Enclave/Enclave.lds new file mode 100644 index 000000000..0d5614f55 --- /dev/null +++ b/SampleCode/SampleAEXNotify/Enclave/Enclave.lds @@ -0,0 +1,11 @@ +enclave.so +{ + global: + g_global_data_sim; + g_global_data; + enclave_entry; + g_peak_heap_used; + g_peak_rsrv_mem_committed; + local: + *; +}; diff --git a/SampleCode/SampleAEXNotify/Include/powers_of_two.h b/SampleCode/SampleAEXNotify/Include/powers_of_two.h new file mode 100644 index 000000000..309e5bd2b --- /dev/null +++ b/SampleCode/SampleAEXNotify/Include/powers_of_two.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#pragma once + +#ifndef _POWERS_OF_TWO_H__ +#define _POWERS_OF_TWO_H__ + +#include + +static bool is_power_of_two(uint64_t x) +{ + return ((x != 0) && !(x & (x - 1))); +} + +// The not fastest way to calculate the number of powers of two between [low, high] +static uint32_t count_powers_of_two(uint64_t low, uint64_t high) +{ + + uint32_t num = 0; + for (uint64_t i = low; i <= high; i++) + { + if (is_power_of_two(i)) + num++; + } + return num; +} + +#endif /* !_POWERS_OF_TWO_H__ */ diff --git a/SampleCode/SampleAEXNotify/Makefile b/SampleCode/SampleAEXNotify/Makefile new file mode 100644 index 000000000..289d8ca79 --- /dev/null +++ b/SampleCode/SampleAEXNotify/Makefile @@ -0,0 +1,250 @@ +# +# Copyright (C) 2011-2021 Intel Corporation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# + +######## SGX SDK Settings ######## + +SGX_SDK ?= /opt/intel/sgxsdk +SGX_MODE ?= HW +SGX_ARCH ?= x64 +SGX_DEBUG ?= 1 + +include $(SGX_SDK)/buildenv.mk + +ifeq ($(shell getconf LONG_BIT), 32) + SGX_ARCH := x86 +else ifeq ($(findstring -m32, $(CXXFLAGS)), -m32) + SGX_ARCH := x86 +endif + +ifeq ($(SGX_ARCH), x86) + SGX_COMMON_FLAGS := -m32 + SGX_LIBRARY_PATH := $(SGX_SDK)/lib + SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x86/sgx_sign + SGX_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r +else + SGX_COMMON_FLAGS := -m64 + SGX_LIBRARY_PATH := $(SGX_SDK)/lib64 + SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x64/sgx_sign + SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r +endif + +ifeq ($(SGX_DEBUG), 1) +ifeq ($(SGX_PRERELEASE), 1) +$(error Cannot set SGX_DEBUG and SGX_PRERELEASE at the same time!!) +endif +endif + +ifneq ($(SGX_MODE), HW) +$(error Only support HW mode for AEX Notify!!) +endif + +ifeq ($(SGX_DEBUG), 1) + SGX_COMMON_FLAGS += -O0 -g +else + SGX_COMMON_FLAGS += -O2 +endif + +SGX_COMMON_FLAGS += -Wall -Wextra -Winit-self -Wpointer-arith -Wreturn-type \ + -Waddress -Wsequence-point -Wformat-security \ + -Wmissing-include-dirs -Wfloat-equal -Wundef -Wshadow \ + -Wcast-align -Wcast-qual -Wconversion -Wredundant-decls +SGX_COMMON_CFLAGS := $(SGX_COMMON_FLAGS) -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants +SGX_COMMON_CXXFLAGS := $(SGX_COMMON_FLAGS) -Wnon-virtual-dtor -std=c++11 + +######## App Settings ######## + +Urts_Library_Name := sgx_urts + +App_Cpp_Files := App/App.cpp +App_Include_Paths := -IInclude -IApp -I$(SGX_SDK)/include + +App_C_Flags := -fPIC -Wno-attributes $(App_Include_Paths) + +# Three configuration modes - Debug, prerelease, release +# Debug - Macro DEBUG enabled. +# Prerelease - Macro NDEBUG and EDEBUG enabled. +# Release - Macro NDEBUG enabled. +ifeq ($(SGX_DEBUG), 1) + App_C_Flags += -DDEBUG -UNDEBUG -UEDEBUG +else ifeq ($(SGX_PRERELEASE), 1) + App_C_Flags += -DNDEBUG -DEDEBUG -UDEBUG +else + App_C_Flags += -DNDEBUG -UEDEBUG -UDEBUG +endif + +App_Cpp_Flags := $(App_C_Flags) +App_Link_Flags := -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread + +App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o) + +App_Name := app + +######## Enclave Settings ######## + +Trts_Library_Name := sgx_trts +Service_Library_Name := sgx_tservice + +Crypto_Library_Name := sgx_tcrypto + +Enclave_Cpp_Files := Enclave/Enclave.cpp +Enclave_Include_Paths := -IInclude -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx + +Enclave_C_Flags := $(Enclave_Include_Paths) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections $(MITIGATION_CFLAGS) +CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9") +ifeq ($(CC_BELOW_4_9), 1) + Enclave_C_Flags += -fstack-protector +else + Enclave_C_Flags += -fstack-protector-strong +endif + +Enclave_Cpp_Flags := $(Enclave_C_Flags) -nostdinc++ + +# Enable the security flags +Enclave_Security_Link_Flags := -Wl,-z,relro,-z,now,-z,noexecstack + +# To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries: +# 1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options, +# so that the whole content of trts is included in the enclave. +# 2. For other libraries, you just need to pull the required symbols. +# Use `--start-group' and `--end-group' to link these libraries. +# Do NOT move the libraries linked with `--start-group' and `--end-group' within `--whole-archive' and `--no-whole-archive' options. +# Otherwise, you may get some undesirable errors. +Enclave_Link_Flags := $(MITIGATION_LDFLAGS) $(Enclave_Security_Link_Flags) \ + -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_TRUSTED_LIBRARY_PATH) \ + -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \ + -Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \ + -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \ + -Wl,-pie,-eenclave_entry -Wl,--export-dynamic \ + -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections \ + -Wl,--version-script=Enclave/Enclave.lds + +Enclave_Cpp_Objects := $(sort $(Enclave_Cpp_Files:.cpp=.o)) + +Enclave_Name := enclave.so +Signed_Enclave_Name := enclave.signed.so +Enclave_Config_File := Enclave/Enclave.config.xml +Enclave_Test_Key := Enclave/Enclave_private_test.pem + +ifeq ($(SGX_MODE), HW) +ifeq ($(SGX_DEBUG), 1) + Build_Mode = HW_DEBUG +else ifeq ($(SGX_PRERELEASE), 1) + Build_Mode = HW_PRERELEASE +else + Build_Mode = HW_RELEASE +endif +endif + + +.PHONY: all target run +all: .config_$(Build_Mode)_$(SGX_ARCH) + @$(MAKE) target + +ifeq ($(Build_Mode), HW_RELEASE) +target: $(App_Name) $(Enclave_Name) + @echo "The project has been built in release hardware mode." + @echo "Please sign the $(Enclave_Name) first with your signing key before you run the $(App_Name) to launch and access the enclave." + @echo "To sign the enclave use the command:" + @echo " $(SGX_ENCLAVE_SIGNER) sign -key -enclave $(Enclave_Name) -out <$(Signed_Enclave_Name)> -config $(Enclave_Config_File)" + @echo "You can also sign the enclave using an external signing tool." + +else +target: $(App_Name) $(Signed_Enclave_Name) +ifeq ($(Build_Mode), HW_DEBUG) + @echo "The project has been built in debug hardware mode." +else ifeq ($(Build_Mode), HW_PRERELEASE) + @echo "The project has been built in pre-release hardware mode." +endif +endif + +run: all +ifneq ($(Build_Mode), HW_RELEASE) + @$(CURDIR)/$(App_Name) + @echo "RUN => $(App_Name) [$(SGX_MODE)|$(SGX_ARCH), OK]" +endif + +.config_$(Build_Mode)_$(SGX_ARCH): + @rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.* + @touch .config_$(Build_Mode)_$(SGX_ARCH) + +######## App Objects ######## + +App/Enclave_u.h: $(SGX_EDGER8R) Enclave/Enclave.edl + @cd App && $(SGX_EDGER8R) --untrusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include + @echo "GEN => $@" + +App/Enclave_u.c: App/Enclave_u.h + +App/Enclave_u.o: App/Enclave_u.c + @$(CC) $(SGX_COMMON_CFLAGS) $(App_C_Flags) -c $< -o $@ + @echo "CC <= $<" + +App/%.o: App/%.cpp App/Enclave_u.h + @$(CXX) $(SGX_COMMON_CXXFLAGS) $(App_Cpp_Flags) -c $< -o $@ + @echo "CXX <= $<" + +$(App_Name): App/Enclave_u.o $(App_Cpp_Objects) + @$(CXX) $^ -o $@ $(App_Link_Flags) + @echo "LINK => $@" + +######## Enclave Objects ######## + +Enclave/Enclave_t.h: $(SGX_EDGER8R) Enclave/Enclave.edl + @cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include + @echo "GEN => $@" + +Enclave/Enclave_t.c: Enclave/Enclave_t.h + +Enclave/Enclave_t.o: Enclave/Enclave_t.c + @$(CC) $(SGX_COMMON_CFLAGS) $(Enclave_C_Flags) -c $< -o $@ + @echo "CC <= $<" + +Enclave/%.o: Enclave/%.cpp Enclave/Enclave_t.h + @$(CXX) $(SGX_COMMON_CXXFLAGS) $(Enclave_Cpp_Flags) -c $< -o $@ + @echo "CXX <= $<" + +$(Enclave_Name): Enclave/Enclave_t.o $(Enclave_Cpp_Objects) + @$(CXX) $^ -o $@ $(Enclave_Link_Flags) + @echo "LINK => $@" + +$(Signed_Enclave_Name): $(Enclave_Name) +ifeq ($(wildcard $(Enclave_Test_Key)),) + @echo "There is no enclave test key." + @echo "The project will generate a key for test." + @openssl genrsa -out $(Enclave_Test_Key) -3 3072 +endif + @$(SGX_ENCLAVE_SIGNER) sign -key $(Enclave_Test_Key) -enclave $(Enclave_Name) -out $@ -config $(Enclave_Config_File) + @echo "SIGN => $@" + +.PHONY: clean + +clean: + @rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.* $(Enclave_Test_Key) diff --git a/SampleCode/SampleAEXNotify/README.txt b/SampleCode/SampleAEXNotify/README.txt new file mode 100644 index 000000000..b5751326d --- /dev/null +++ b/SampleCode/SampleAEXNotify/README.txt @@ -0,0 +1,86 @@ +------------------------ +Purpose of SampleAEXNotify +------------------------ +The project demonstrates the AEXNotify mitigation for Intel(R) Software Guard +Extensions (Intel(R) SGX) SDK projects development. + +------------------------------------ +Prerequisite of the Sample Code +------------------------------------ +To enable AEX-Notify feature in an enclave, the hardware must support it +and the in-kernel driver must be v6.2 or later. + +------------------------------------ +How to Build/Execute the Sample Code +------------------------------------ +1. Install Intel(R) SGX SDK for Linux* OS +2. Make sure your environment is set: + $ source ${sgx-sdk-install-path}/environment +3. Build the project with the prepared Makefile: + a. Hardware Mode, Debug build: + 1) Enclave with no mitigation: + $ make + 2) Enclave with mitigations for indirects and returns only: + $ make MITIGATION-CVE-2020-0551=CF + 3) Enclave with full mitigation: + $ make MITIGATION-CVE-2020-0551=LOAD + b. Hardware Mode, Pre-release build: + 1) Enclave with no mitigation: + $ make SGX_PRERELEASE=1 SGX_DEBUG=0 + 2) Enclave with mitigations for indirects and returns only: + $ make SGX_PRERELEASE=1 SGX_DEBUG=0 MITIGATION-CVE-2020-0551=CF + 3) Enclave with full mitigation: + $ make SGX_PRERELEASE=1 SGX_DEBUG=0 MITIGATION-CVE-2020-0551=LOAD + c. Hardware Mode, Release build: + 1) Enclave with no mitigation: + $ make SGX_DEBUG=0 + 2) Enclave with mitigations for indirects and returns only: + $ make SGX_DEBUG=0 MITIGATION-CVE-2020-0551=CF + 3) Enclave with full mitigation: + $ make SGX_DEBUG=0 MITIGATION-CVE-2020-0551=LOAD +4. Execute the binary directly: + $ ./app +5. Remember to "make clean" before switching build mode + +------------------------------------------ +Explanation about Configuration Parameters +------------------------------------------ +EnableAEXNotify + + Enables the AEX-Notify feature in the enclave. + +TCSMaxNum, TCSNum, TCSMinPool + + These three parameters will determine whether a thread will be created + dynamically when there is no available thread to do the work. + + +StackMaxSize, StackMinSize + + For a dynamically created thread, StackMinSize is the amount of stack available + once the thread is created and StackMaxSize is the total amount of stack that + thread can use. The gap between StackMinSize and StackMaxSize is the stack + dynamically expanded as necessary at runtime. + + For a static thread, only StackMaxSize is relevant which specifies the total + amount of stack available to the thread. + + +HeapMaxSize, HeapInitSize, HeapMinSize + + HeapMinSize is the amount of heap available once the enclave is initialized. + + HeapMaxSize is the total amount of heap an enclave can use. The gap between + HeapMinSize and HeapMaxSize is the heap dynamically expanded as necessary + at runtime. + + HeapInitSize is here for compatibility. + + +------------------------------------------------- +Launch token initialization +------------------------------------------------- +If using libsgx-enclave-common or sgxpsw under version 2.4, an initialized variable launch_token needs to be passed as the 3rd parameter of API sgx_create_enclave. For example, + +sgx_launch_token_t launch_token = {0}; +sgx_create_enclave(ENCLAVE_FILENAME, SGX_DEBUG_FLAG, launch_token, NULL, &global_eid, NULL); diff --git a/SampleCode/SampleAttestedTLS/common/utility.cpp b/SampleCode/SampleAttestedTLS/common/utility.cpp index fd144eb96..688160e7e 100644 --- a/SampleCode/SampleAttestedTLS/common/utility.cpp +++ b/SampleCode/SampleAttestedTLS/common/utility.cpp @@ -53,20 +53,20 @@ int get_pkey_by_rsa(EVP_PKEY *pk) e = BN_new(); if (!e) { PRINT("BN_new failed\n"); - return res; + goto done; } res = BN_set_word(e, (BN_ULONG)RSA_F4); if (!res) { PRINT("BN_set_word failed (%d)\n", res); - return res; + goto done; } rsa = RSA_new(); if (!rsa) { PRINT("RSA_new failed\n"); res = -1; - return res; + goto done; } res = RSA_generate_key_ex( @@ -79,12 +79,15 @@ int get_pkey_by_rsa(EVP_PKEY *pk) if (!res) { PRINT("RSA_generate_key failed (%d)\n", res); - return res; + goto done; } // Assign RSA key to EVP_PKEY structure EVP_PKEY_assign_RSA(pk, rsa); +done: + if (e) + BN_clear_free(e); return res; } @@ -100,14 +103,14 @@ int get_pkey_by_ec(EVP_PKEY *pk) if (res <= 0) { PRINT("EC_generate_key failed (%d)\n", res); - return res; + goto done; } res = EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, NID_secp384r1); if (res <= 0) { PRINT("EC_generate_key failed (%d)\n", res); - return res; + goto done; } /* Generate key */ @@ -115,9 +118,13 @@ int get_pkey_by_ec(EVP_PKEY *pk) if (res <= 0) { PRINT("EC_generate_key failed (%d)\n", res); - return res; + goto done; } +done: + if (ctx) + EVP_PKEY_CTX_free(ctx); + return res; } diff --git a/SampleCode/SampleAttestedTLS/server_tdx/Makefile b/SampleCode/SampleAttestedTLS/server_tdx/Makefile index f640f69ca..314ce2310 100644 --- a/SampleCode/SampleAttestedTLS/server_tdx/Makefile +++ b/SampleCode/SampleAttestedTLS/server_tdx/Makefile @@ -35,7 +35,7 @@ all: server server: $(CXX) -c -DTDX_ENV -DCLIENT_USE_QVL $(App_Cpp_Flags) server.cpp openssl_server.cpp ../common/verify_callback.cpp ../common/utility.cpp ../common/openssl_utility.cpp ../common/err_msg.cpp - $(CXX) -o tls_server server.o openssl_server.o verify_callback.o utility.o openssl_utility.o err_msg.o $(App_Link_Flags) -lssl -ltdx_tls -lsgx_dcap_quoteverify -l:libtdx_attest.so.1 + $(CXX) -o tls_server server.o openssl_server.o verify_callback.o utility.o openssl_utility.o err_msg.o $(App_Link_Flags) -lssl -ltdx_tls -lsgx_dcap_quoteverify -ltdx_attest clean: rm -f tls_server *.o diff --git a/SampleCode/SampleDNNL/README.txt b/SampleCode/SampleDNNL/README.txt index 6e1699526..aa149044f 100644 --- a/SampleCode/SampleDNNL/README.txt +++ b/SampleCode/SampleDNNL/README.txt @@ -3,6 +3,8 @@ Purpose of Deep Neural Network Library (DNNL) -------------------------- The project demonstrates Intel(R) Deep Neural Network Library (DNNL) functions inside Intel(R) SGX environment +**NOTE**: The SampleDNNL project is validated under GNU Compiler Collection Version <= 9.4. High GCC versions are incompatible with the current version. + ------------------------------------ How to Build/Execute the Sample Code ------------------------------------ diff --git a/SampleCode/SampleEnclave/Enclave/config.01.xml b/SampleCode/SampleEnclave/Enclave/config.01.xml index ca652963f..e57be8ae8 100644 --- a/SampleCode/SampleEnclave/Enclave/config.01.xml +++ b/SampleCode/SampleEnclave/Enclave/config.01.xml @@ -23,6 +23,6 @@ 0 - 0 - 0xFFFFFFFF + 1 + 0xFFFFFFFE diff --git a/SampleCode/SampleEnclave/Enclave/config.02.xml b/SampleCode/SampleEnclave/Enclave/config.02.xml index 126eac07b..cc980d5d0 100644 --- a/SampleCode/SampleEnclave/Enclave/config.02.xml +++ b/SampleCode/SampleEnclave/Enclave/config.02.xml @@ -20,6 +20,6 @@ 1 0 - 0 - 0xFFFFFFFF + 1 + 0xFFFFFFFE diff --git a/SampleCode/SampleEnclave/Enclave/config.03.xml b/SampleCode/SampleEnclave/Enclave/config.03.xml index ef642799b..09ca6f231 100644 --- a/SampleCode/SampleEnclave/Enclave/config.03.xml +++ b/SampleCode/SampleEnclave/Enclave/config.03.xml @@ -22,6 +22,6 @@ 0 - 0 - 0xFFFFFFFF + 1 + 0xFFFFFFFE diff --git a/SampleCode/SampleEnclave/Enclave/config.04.xml b/SampleCode/SampleEnclave/Enclave/config.04.xml index a72d611b5..cd5b3fe2d 100644 --- a/SampleCode/SampleEnclave/Enclave/config.04.xml +++ b/SampleCode/SampleEnclave/Enclave/config.04.xml @@ -18,6 +18,6 @@ 0 - 0 - 0xFFFFFFFF + 1 + 0xFFFFFFFE diff --git a/SampleCode/SampleEnclave/README.txt b/SampleCode/SampleEnclave/README.txt index c88739180..9e2ba15d7 100644 --- a/SampleCode/SampleEnclave/README.txt +++ b/SampleCode/SampleEnclave/README.txt @@ -81,10 +81,20 @@ HeapMaxSize, HeapInitSize, HeapMinSize ------------------------------------------------- Sample configuration files for the Sample Enclave ------------------------------------------------- -config.01.xml: There is no dynamic thread, no dynamic heap expansion. -config.02.xml: There is no dynamic thread. But dynamic heap expansion can happen. -config.03.xml: There are dynamic threads. For a dynamic thread, there's no stack expansion. -config.04.xml: There are dynamic threads. For a dynamic thread, stack will expanded as necessary. +Below configurations are applicable on EDMM supported platforms with either EDMM supported +kernels or EDMM unsupported kernels. If the signed enclave is launched on an EDMM supported +platform with an EDMM supported kernel, it will be loaded with EDMM enabled. The following +configuration descriptions are only suitable for the case that the signed enclave is +launched on an EDMM supported platform with an EDMM supported kernel: + + config.01.xml: There is no dynamic thread, no dynamic heap expansion. + config.02.xml: There is no dynamic thread. But dynamic heap expansion can happen. + config.03.xml: There are dynamic threads. For a dynamic thread, there's no stack expansion. + config.04.xml: There are dynamic threads. For a dynamic thread, stack will expanded as necessary. + +Below configuration is only workable on EDMM supported platforms with EDMM supported kernels: + + config.05.xml: There is a user region where users could operate on. ------------------------------------------------- Launch token initialization diff --git a/SampleCode/SampleMbedCrypto/App/App.cpp b/SampleCode/SampleMbedCrypto/App/App.cpp new file mode 100644 index 000000000..421587b78 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/App/App.cpp @@ -0,0 +1,232 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include + +# include +# include +# define MAX_PATH FILENAME_MAX + +#define FAIL_SHA 0x1 +#define FAIL_AES 0x2 +#define FAIL_ECDSA 0x4 + +#include "sgx_urts.h" +#include "App.h" +#include "Enclave_u.h" + +/* Global EID shared by multiple threads */ +sgx_enclave_id_t global_eid = 0; + +typedef struct _sgx_errlist_t { + sgx_status_t err; + const char *msg; + const char *sug; /* Suggestion */ +} sgx_errlist_t; + +/* Error code returned by sgx_create_enclave */ +static sgx_errlist_t sgx_errlist[] = { + { + SGX_ERROR_UNEXPECTED, + "Unexpected error occurred.", + NULL + }, + { + SGX_ERROR_INVALID_PARAMETER, + "Invalid parameter.", + NULL + }, + { + SGX_ERROR_OUT_OF_MEMORY, + "Out of memory.", + NULL + }, + { + SGX_ERROR_ENCLAVE_LOST, + "Power transition occurred.", + "Please refer to the sample \"PowerTransition\" for details." + }, + { + SGX_ERROR_INVALID_ENCLAVE, + "Invalid enclave image.", + NULL + }, + { + SGX_ERROR_INVALID_ENCLAVE_ID, + "Invalid enclave identification.", + NULL + }, + { + SGX_ERROR_INVALID_SIGNATURE, + "Invalid enclave signature.", + NULL + }, + { + SGX_ERROR_OUT_OF_EPC, + "Out of EPC memory.", + NULL + }, + { + SGX_ERROR_NO_DEVICE, + "Invalid SGX device.", + "Please make sure SGX module is enabled in the BIOS, and install SGX driver afterwards." + }, + { + SGX_ERROR_MEMORY_MAP_CONFLICT, + "Memory map conflicted.", + NULL + }, + { + SGX_ERROR_INVALID_METADATA, + "Invalid enclave metadata.", + NULL + }, + { + SGX_ERROR_DEVICE_BUSY, + "SGX device was busy.", + NULL + }, + { + SGX_ERROR_INVALID_VERSION, + "Enclave version was invalid.", + NULL + }, + { + SGX_ERROR_INVALID_ATTRIBUTE, + "Enclave was not authorized.", + NULL + }, + { + SGX_ERROR_ENCLAVE_FILE_ACCESS, + "Can't open enclave file.", + NULL + }, + { + SGX_ERROR_NDEBUG_ENCLAVE, + "The enclave is signed as product enclave, and can not be created as debuggable enclave.", + NULL + }, + { + SGX_ERROR_MEMORY_MAP_FAILURE, + "Failed to reserve memory for the enclave.", + NULL + }, +}; + +/* Check error conditions for loading enclave */ +void print_error_message(sgx_status_t ret) +{ + size_t idx = 0; + size_t ttl = sizeof sgx_errlist/sizeof sgx_errlist[0]; + + for (idx = 0; idx < ttl; idx++) { + if(ret == sgx_errlist[idx].err) { + if(NULL != sgx_errlist[idx].sug) + printf("Info: %s\n", sgx_errlist[idx].sug); + printf("Error: %s\n", sgx_errlist[idx].msg); + break; + } + } + + if (idx == ttl) + printf("Error: Unexpected error occurred.\n"); +} + +/* Initialize the enclave: + * Call sgx_create_enclave to initialize an enclave instance + */ +int initialize_enclave(void) +{ + sgx_status_t ret = SGX_ERROR_UNEXPECTED; + + /* Call sgx_create_enclave to initialize an enclave instance */ + /* Debug Support: set 2nd parameter to 1 */ + ret = sgx_create_enclave(ENCLAVE_FILENAME, SGX_DEBUG_FLAG, NULL, NULL, &global_eid, NULL); + if (ret != SGX_SUCCESS) { + print_error_message(ret); + return -1; + } + + return 0; +} + +/* OCall functions */ +void ocall_print_string(const char *str) +{ + /* Proxy/Bridge will check the length and null-terminate + * the input string to prevent buffer overflow. + */ + printf("%s", str); +} + + +/* Application entry */ +int SGX_CDECL main(int argc, char *argv[]) +{ + (void)(argc); + (void)(argv); + int result = 0xff; + + /* Initialize the enclave */ + if(initialize_enclave() < 0){ + printf("Enter a character before exit ...\n"); + getchar(); + return -1; + } + + sgx_status_t status = ecall_mbedtls_crypto(global_eid, &result); + if (status != SGX_SUCCESS) { + printf("ERROR: ECall failed\n"); + print_error_message(status); + printf("Enter a character before exit ...\n"); + getchar(); + return -1; + } + + /* Destroy the enclave */ + sgx_destroy_enclave(global_eid); + + printf("Info: MbedCrypto Sample completed.\n"); + + if ( 0 == result) { + printf("Info: All test passed.\n"); + } else { + if ( result & FAIL_SHA ) printf("ERROR: SHA256 test failed.\n"); + if ( result & FAIL_AES ) printf("ERROR: AES-CTR test failed.\n"); + if ( result & FAIL_ECDSA ) printf("ERROR: ECDSA test failed.\n"); + } + printf("Enter a character before exit ...\n"); + getchar(); + return 0; +} + diff --git a/SampleCode/SampleMbedCrypto/App/App.h b/SampleCode/SampleMbedCrypto/App/App.h new file mode 100644 index 000000000..c9affe8d3 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/App/App.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _APP_H_ +#define _APP_H_ + +#include +#include +#include +#include + +#include "sgx_error.h" /* sgx_status_t */ +#include "sgx_eid.h" /* sgx_enclave_id_t */ + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifndef FALSE +# define FALSE 0 +#endif + +#if defined(__GNUC__) +# define ENCLAVE_FILENAME "enclave.signed.so" +#endif + +extern sgx_enclave_id_t global_eid; /* global enclave id */ + +#endif /* !_APP_H_ */ diff --git a/SampleCode/SampleMbedCrypto/Enclave/Enclave.config.xml b/SampleCode/SampleMbedCrypto/Enclave/Enclave.config.xml new file mode 100644 index 000000000..a94d12f00 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Enclave/Enclave.config.xml @@ -0,0 +1,12 @@ + + + 0 + 0 + 0x40000 + 0x100000 + 10 + 1 + 0 + 0 + 0xFFFFFFFF + diff --git a/SampleCode/SampleMbedCrypto/Enclave/Enclave.cpp b/SampleCode/SampleMbedCrypto/Enclave/Enclave.cpp new file mode 100644 index 000000000..cfa15520d --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Enclave/Enclave.cpp @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +#include /* vsnprintf */ +#include + +#include "Enclave.h" +#include "Enclave_t.h" /* print_string */ +#include "mbedtls/aes.h" +#include "mbedtls/cipher.h" +#include "mbedtls/entropy.h" +#include "mbedtls/ctr_drbg.h" +#include "mbedtls/ecdsa.h" +#include "mbedtls/sha256.h" + +#define FAIL_SHA 0x1 +#define FAIL_AES 0x2 +#define FAIL_ECDSA 0x4 + +#define mbedtls_printf printf + +/* + * printf: + * Invokes OCALL to display the enclave buffer to the terminal. + * 'printf' function is required for sgx protobuf logging module. + */ +int printf(const char *fmt, ...) +{ + char buf[BUFSIZ] = {'\0'}; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, BUFSIZ, fmt, ap); + va_end(ap); + ocall_print_string(buf); + return 0; +} + +static int mbedtls_crypto_sha256() +{ + unsigned char output[65]; + memset(output, 0x00, 65); + if (mbedtls_sha256( (const unsigned char*)"", 0, output, 0 ) != 0 ) + { + mbedtls_printf ("SHA256 failed\n"); + return -1; + } else { + for (int i = 0; i < 32; i++) + mbedtls_printf("%02x", output[i]); + } + mbedtls_printf("\nSHA256 PASSED\n"); + return 0; +} + +static int mbedtls_crypto_aes_ctr_enc_dec_buf() +{ + int ret = -1; + size_t length = 49, outlen, total_len, i, block_size, iv_len; + unsigned char key[64]; + unsigned char iv[16]; + unsigned char ad[13]; + unsigned char tag[16]; + unsigned char inbuf[64]; + unsigned char encbuf[64]; + unsigned char decbuf[64]; + + const mbedtls_cipher_info_t *cipher_info; + mbedtls_cipher_context_t ctx_dec; + mbedtls_cipher_context_t ctx_enc; + + /* + * Prepare contexts + */ + mbedtls_cipher_init( &ctx_dec ); + mbedtls_cipher_init( &ctx_enc ); + + memset( key, 0x2a, sizeof( key ) ); + + /* Check and get info structures */ + cipher_info = mbedtls_cipher_info_from_type(MBEDTLS_CIPHER_AES_128_CTR); + if( NULL == cipher_info ) goto exit; + if( mbedtls_cipher_info_from_string( "AES-128-CTR" ) != cipher_info ) goto exit; + if( strcmp( mbedtls_cipher_info_get_name( cipher_info ), + "AES-128-CTR" ) != 0 ) goto exit; + + /* Initialise enc and dec contexts */ + if( 0 != mbedtls_cipher_setup( &ctx_dec, cipher_info ) ) goto exit; + if( 0 != mbedtls_cipher_setup( &ctx_enc, cipher_info ) ) goto exit; + + if( 0 != mbedtls_cipher_setkey( &ctx_dec, key, 128, MBEDTLS_DECRYPT ) ) goto exit; + if( 0 != mbedtls_cipher_setkey( &ctx_enc, key, 128, MBEDTLS_ENCRYPT ) ) goto exit; + + /* + * Do a few encode/decode cycles + */ + for( i = 0; i < 3; i++ ) + { + memset( iv , 0x00 + (int)i, sizeof( iv ) ); + memset( ad, 0x10 + (int)i, sizeof( ad ) ); + memset( inbuf, 0x20 + (int)i, sizeof( inbuf ) ); + + memset( encbuf, 0, sizeof( encbuf ) ); + memset( decbuf, 0, sizeof( decbuf ) ); + memset( tag, 0, sizeof( tag ) ); + + iv_len = sizeof(iv); + + if( 0 != mbedtls_cipher_set_iv( &ctx_dec, iv, iv_len ) ) goto exit; + if( 0 != mbedtls_cipher_set_iv( &ctx_enc, iv, iv_len ) ) goto exit; + + if( 0 != mbedtls_cipher_reset( &ctx_dec ) ) goto exit; + if( 0 != mbedtls_cipher_reset( &ctx_enc ) ) goto exit; + + block_size = mbedtls_cipher_get_block_size( &ctx_enc ); + if( 0 == block_size ) goto exit; + + /* encode length number of bytes from inbuf */ + if( 0 != mbedtls_cipher_update( &ctx_enc, inbuf, length, encbuf, &outlen ) ) goto exit; + total_len = outlen; + + if( total_len != length || + ( total_len % block_size == 0 && + total_len < length && + total_len + block_size > length ) ) goto exit; + + if( 0 != mbedtls_cipher_finish( &ctx_enc, encbuf + outlen, &outlen ) ) goto exit; + total_len += outlen; + + if( total_len != length || + ( total_len % block_size == 0 && + total_len > length && + total_len <= length + block_size ) ) goto exit; + + /* decode the previously encoded string */ + if( 0 != mbedtls_cipher_update( &ctx_dec, encbuf, total_len, decbuf, &outlen ) ) goto exit; + total_len = outlen; + + if( total_len != length || + ( total_len % block_size == 0 && + total_len < length && + total_len + block_size >= length ) ) goto exit; + + if( 0 != mbedtls_cipher_finish( &ctx_dec, decbuf + outlen, &outlen ) ) goto exit; + total_len += outlen; + + /* check result */ + if( total_len != length ) goto exit; + if( 0 != memcmp(inbuf, decbuf, length) ) goto exit; + } + mbedtls_printf("AES-CTR PASSED\n"); + ret = 0; +exit: + mbedtls_cipher_free( &ctx_dec ); + mbedtls_cipher_free( &ctx_enc ); + return ret; +} + +#define ECPARAMS MBEDTLS_ECP_DP_SECP192R1 + +static int mbedtls_crypto_ecdsa() +{ + int ret = 1; + mbedtls_ecdsa_context ctx_sign, ctx_verify; + mbedtls_entropy_context entropy; + mbedtls_ctr_drbg_context ctr_drbg; + unsigned char message[100]; + unsigned char hash[32]; + unsigned char sig[MBEDTLS_ECDSA_MAX_LEN]; + size_t sig_len; + const char *pers = "ecdsa"; + + mbedtls_ecdsa_init( &ctx_sign ); + mbedtls_ecdsa_init( &ctx_verify ); + mbedtls_ctr_drbg_init( &ctr_drbg ); + + memset( sig, 0, sizeof( sig ) ); + memset( message, 0x25, sizeof( message ) ); + + /* + * Generate a key pair for signing + */ + mbedtls_printf( " . Seeding the random number generator..." ); + + mbedtls_entropy_init( &entropy ); + if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy, + (const unsigned char *) pers, + strlen( pers ) ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret ); + goto exit; + } + + mbedtls_printf( " ok\n . Generating key pair..." ); + + if( ( ret = mbedtls_ecdsa_genkey( &ctx_sign, ECPARAMS, + mbedtls_ctr_drbg_random, &ctr_drbg ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_ecdsa_genkey returned %d\n", ret ); + goto exit; + } + + mbedtls_printf( " ok (key size: %d bits)\n", (int) ctx_sign.MBEDTLS_PRIVATE(grp).pbits ); + + /* + * Compute message hash + */ + mbedtls_printf( " . Computing message hash..." ); + + if( ( ret = mbedtls_sha256( message, sizeof( message ), hash, 0 ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_sha256 returned %d\n", ret ); + goto exit; + } + + mbedtls_printf( " ok\n" ); + + /* + * Sign message hash + */ + mbedtls_printf( " . Signing message hash..." ); + + if( ( ret = mbedtls_ecdsa_write_signature( &ctx_sign, MBEDTLS_MD_SHA256, + hash, sizeof( hash ), + sig, sizeof( sig ), &sig_len, + mbedtls_ctr_drbg_random, &ctr_drbg ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_ecdsa_write_signature returned %d\n", ret ); + goto exit; + } + mbedtls_printf( " ok (signature length = %u)\n", (unsigned int) sig_len ); + + /* + * Transfer public information to verifying context + * + * We could use the same context for verification and signatures, but we + * chose to use a new one in order to make it clear that the verifying + * context only needs the public key (Q), and not the private key (d). + */ + mbedtls_printf( " . Preparing verification context..." ); + + if( ( ret = mbedtls_ecp_group_copy( &ctx_verify.MBEDTLS_PRIVATE(grp), &ctx_sign.MBEDTLS_PRIVATE(grp) ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_ecp_group_copy returned %d\n", ret ); + goto exit; + } + + if( ( ret = mbedtls_ecp_copy( &ctx_verify.MBEDTLS_PRIVATE(Q), &ctx_sign.MBEDTLS_PRIVATE(Q) ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_ecp_copy returned %d\n", ret ); + goto exit; + } + + /* + * Verify signature + */ + mbedtls_printf( " ok\n . Verifying signature..." ); + + if( ( ret = mbedtls_ecdsa_read_signature( &ctx_verify, + hash, sizeof( hash ), + sig, sig_len ) ) != 0 ) + { + mbedtls_printf( " failed\n ! mbedtls_ecdsa_read_signature returned %d\n", ret ); + goto exit; + } + + mbedtls_printf( " ok\nECDSA PASSED\n" ); + +exit: + + mbedtls_ecdsa_free( &ctx_verify ); + mbedtls_ecdsa_free( &ctx_sign ); + mbedtls_ctr_drbg_free( &ctr_drbg ); + mbedtls_entropy_free( &entropy ); + return ret; +} + +int ecall_mbedtls_crypto() +{ + int ret = 0; + if ( 0 != mbedtls_crypto_sha256()) ret |= FAIL_SHA; + if ( 0 != mbedtls_crypto_aes_ctr_enc_dec_buf()) ret |= FAIL_AES; + if ( 0 != mbedtls_crypto_ecdsa()) ret |= FAIL_ECDSA; + return ret; + +} diff --git a/SampleCode/SampleMbedCrypto/Enclave/Enclave.edl b/SampleCode/SampleMbedCrypto/Enclave/Enclave.edl new file mode 100644 index 000000000..97e974eb6 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Enclave/Enclave.edl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* Enclave.edl - Top EDL file. */ + +enclave { + + + /* Import ECALL/OCALL from sub-directory EDLs. + * [from]: specifies the location of EDL file. + * [import]: specifies the functions to import, + * [*]: implies to import all functions. + */ + + from "sgx_tstdc.edl" import *; + trusted { + public int ecall_mbedtls_crypto(); + }; + + /* + * ocall_print_string - invokes OCALL to display string buffer inside the enclave. + * [in]: copy the string buffer to App outside. + * [string]: specifies 'str' is a NULL terminated buffer. + */ + untrusted { + void ocall_print_string([in, string] const char *str); + }; + +}; diff --git a/SampleCode/SampleMbedCrypto/Enclave/Enclave.h b/SampleCode/SampleMbedCrypto/Enclave/Enclave.h new file mode 100644 index 000000000..ea8be2c71 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Enclave/Enclave.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _ENCLAVE_H_ +#define _ENCLAVE_H_ + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +int printf(const char *fmt, ...); + +#if defined(__cplusplus) +} +#endif + +#endif /* !_ENCLAVE_H_ */ diff --git a/SampleCode/SampleMbedCrypto/Enclave/Enclave.lds b/SampleCode/SampleMbedCrypto/Enclave/Enclave.lds new file mode 100644 index 000000000..e3d9d0ee0 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Enclave/Enclave.lds @@ -0,0 +1,9 @@ +enclave.so +{ + global: + g_global_data_sim; + g_global_data; + enclave_entry; + local: + *; +}; diff --git a/SampleCode/SampleMbedCrypto/Enclave/Enclave_debug.lds b/SampleCode/SampleMbedCrypto/Enclave/Enclave_debug.lds new file mode 100644 index 000000000..0d5614f55 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Enclave/Enclave_debug.lds @@ -0,0 +1,11 @@ +enclave.so +{ + global: + g_global_data_sim; + g_global_data; + enclave_entry; + g_peak_heap_used; + g_peak_rsrv_mem_committed; + local: + *; +}; diff --git a/SampleCode/SampleMbedCrypto/Makefile b/SampleCode/SampleMbedCrypto/Makefile new file mode 100644 index 000000000..13a30ce36 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/Makefile @@ -0,0 +1,275 @@ +# +# Copyright (C) 2011-2021 Intel Corporation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# + +######## SGX SDK Settings ######## + +SGX_SDK ?= /opt/intel/sgxsdk +SGX_MODE ?= HW +SGX_ARCH ?= x64 +SGX_DEBUG ?= 1 + +ifeq ($(shell getconf LONG_BIT), 32) + SGX_ARCH := x86 +else ifeq ($(findstring -m32, $(CXXFLAGS)), -m32) + SGX_ARCH := x86 +endif + +ifeq ($(SGX_ARCH), x86) + SGX_COMMON_FLAGS := -m32 + SGX_LIBRARY_PATH := $(SGX_SDK)/lib + SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x86/sgx_sign + SGX_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r +else + SGX_COMMON_FLAGS := -m64 + SGX_LIBRARY_PATH := $(SGX_SDK)/lib64 + SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x64/sgx_sign + SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r +endif + +ifeq ($(SGX_DEBUG), 1) +ifeq ($(SGX_PRERELEASE), 1) +$(error Cannot set SGX_DEBUG and SGX_PRERELEASE at the same time!!) +endif +endif + +ifeq ($(SGX_DEBUG), 1) + SGX_COMMON_FLAGS += -O0 -g +else + SGX_COMMON_FLAGS += -O2 +endif + +SGX_COMMON_FLAGS += -Wall -Wextra -Winit-self -Wpointer-arith -Wreturn-type \ + -Waddress -Wsequence-point -Wformat-security \ + -Wmissing-include-dirs -Wfloat-equal -Wundef -Wshadow \ + -Wcast-align -Wcast-qual -Wconversion -Wredundant-decls +SGX_COMMON_CFLAGS := $(SGX_COMMON_FLAGS) -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants +SGX_COMMON_CXXFLAGS := $(SGX_COMMON_FLAGS) -Wnon-virtual-dtor -std=c++11 + +######## App Settings ######## + +ifneq ($(SGX_MODE), HW) + Urts_Library_Name := sgx_urts_sim +else + Urts_Library_Name := sgx_urts +endif + +App_Cpp_Files := App/App.cpp +App_Include_Paths := -IApp -I$(SGX_SDK)/include + +App_C_Flags := -fPIC -Wno-attributes $(App_Include_Paths) + +# Three configuration modes - Debug, prerelease, release +# Debug - Macro DEBUG enabled. +# Prerelease - Macro NDEBUG and EDEBUG enabled. +# Release - Macro NDEBUG enabled. +ifeq ($(SGX_DEBUG), 1) + App_C_Flags += -DDEBUG -UNDEBUG -UEDEBUG +else ifeq ($(SGX_PRERELEASE), 1) + App_C_Flags += -DNDEBUG -DEDEBUG -UDEBUG +else + App_C_Flags += -DNDEBUG -UEDEBUG -UDEBUG +endif + +App_Cpp_Flags := $(App_C_Flags) +App_Link_Flags := -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread + +App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o) + +App_Name := app + +######## Enclave Settings ######## + +Enclave_Version_Script := Enclave/Enclave_debug.lds +ifeq ($(SGX_MODE), HW) +ifneq ($(SGX_DEBUG), 1) +ifneq ($(SGX_PRERELEASE), 1) + # Choose to use 'Enclave.lds' for HW release mode + Enclave_Version_Script = Enclave/Enclave.lds +endif +endif +endif + +ifneq ($(SGX_MODE), HW) + Trts_Library_Name := sgx_trts_sim + Service_Library_Name := sgx_tservice_sim +else + Trts_Library_Name := sgx_trts + Service_Library_Name := sgx_tservice +endif +Crypto_Library_Name := sgx_tcrypto + +Enclave_Cpp_Files := Enclave/Enclave.cpp +Enclave_Include_Paths := -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/libcxx -I$(SGX_SDK)/include/tlibc + +Enclave_C_Flags := -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths) -DPB_ENABLE_SGX +Enclave_Cpp_Flags := $(Enclave_C_Flags) -nostdinc++ + +# Enable the security flags +Enclave_Security_Link_Flags := -Wl,-z,relro,-z,now,-z,noexecstack + +# To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries: +# 1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options, +# so that the whole content of trts is included in the enclave. +# 2. For other libraries, you just need to pull the required symbols. +# Use `--start-group' and `--end-group' to link these libraries. +# Do NOT move the libraries linked with `--start-group' and `--end-group' within `--whole-archive' and `--no-whole-archive' options. +# Otherwise, you may get some undesirable errors. +Enclave_Link_Flags := $(Enclave_Security_Link_Flags) \ + -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \ + -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \ + -Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_mbedcrypto -lsgx_pthread -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \ + -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \ + -Wl,-pie,-eenclave_entry -Wl,--export-dynamic \ + -Wl,--defsym,__ImageBase=0 \ + -Wl,--version-script=$(Enclave_Version_Script) + +Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o) + +Enclave_Name := enclave.so +Signed_Enclave_Name := enclave.signed.so +Enclave_Config_File := Enclave/Enclave.config.xml +Enclave_Test_Key := Enclave/Enclave_private_test.pem + +ifeq ($(SGX_MODE), HW) +ifeq ($(SGX_DEBUG), 1) + Build_Mode = HW_DEBUG +else ifeq ($(SGX_PRERELEASE), 1) + Build_Mode = HW_PRERELEASE +else + Build_Mode = HW_RELEASE +endif +else +ifeq ($(SGX_DEBUG), 1) + Build_Mode = SIM_DEBUG +else ifeq ($(SGX_PRERELEASE), 1) + Build_Mode = SIM_PRERELEASE +else + Build_Mode = SIM_RELEASE +endif +endif + + +.PHONY: all run target +all: .config_$(Build_Mode)_$(SGX_ARCH) + @$(MAKE) target + +ifeq ($(Build_Mode), HW_RELEASE) +target: $(App_Name) $(Enclave_Name) + @echo "The project has been built in release hardware mode." + @echo "Please sign the $(Enclave_Name) first with your signing key before you run the $(App_Name) to launch and access the enclave." + @echo "To sign the enclave use the command:" + @echo " $(SGX_ENCLAVE_SIGNER) sign -key -enclave $(Enclave_Name) -out <$(Signed_Enclave_Name)> -config $(Enclave_Config_File)" + @echo "You can also sign the enclave using an external signing tool." + @echo "To build the project in simulation mode set SGX_MODE=SIM. To build the project in prerelease mode set SGX_PRERELEASE=1 and SGX_MODE=HW." +else +target: $(App_Name) $(Signed_Enclave_Name) +ifeq ($(Build_Mode), HW_DEBUG) + @echo "The project has been built in debug hardware mode." +else ifeq ($(Build_Mode), SIM_DEBUG) + @echo "The project has been built in debug simulation mode." +else ifeq ($(Build_Mode), HW_PRERELEASE) + @echo "The project has been built in pre-release hardware mode." +else ifeq ($(Build_Mode), SIM_PRERELEASE) + @echo "The project has been built in pre-release simulation mode." +else + @echo "The project has been built in release simulation mode." +endif +endif + +run: all +ifneq ($(Build_Mode), HW_RELEASE) + @$(CURDIR)/$(App_Name) + @echo "RUN => $(App_Name) [$(SGX_MODE)|$(SGX_ARCH), OK]" +endif + +.config_$(Build_Mode)_$(SGX_ARCH): + @rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.* + @touch .config_$(Build_Mode)_$(SGX_ARCH) + +######## App Objects ######## + +App/Enclave_u.h: $(SGX_EDGER8R) Enclave/Enclave.edl + @cd App && $(SGX_EDGER8R) --untrusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include + @echo "GEN => $@" + +App/Enclave_u.c: App/Enclave_u.h + +App/Enclave_u.o: App/Enclave_u.c + @$(CC) $(SGX_COMMON_CFLAGS) $(App_C_Flags) -c $< -o $@ + @echo "CC <= $<" + +App/%.o: App/%.cpp App/Enclave_u.h + @$(CXX) $(SGX_COMMON_CXXFLAGS) $(App_Cpp_Flags) -c $< -o $@ + @echo "CXX <= $<" + +$(App_Name): App/Enclave_u.o $(App_Cpp_Objects) + @$(CXX) $^ -o $@ $(App_Link_Flags) + @echo "LINK => $@" + +######## Enclave Objects ######## + +Enclave/Enclave_t.h: $(SGX_EDGER8R) Enclave/Enclave.edl + @cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include + @echo "GEN => $@" + +Enclave/Enclave_t.c: Enclave/Enclave_t.h + +Enclave/Enclave_t.o: Enclave/Enclave_t.c + @$(CC) $(SGX_COMMON_CFLAGS) $(Enclave_C_Flags) -c $< -o $@ + @echo "CC <= $<" + +Enclave/%.o: Enclave/%.cpp + @$(CXX) $(SGX_COMMON_CXXFLAGS) $(Enclave_Cpp_Flags) -c $< -o $@ + @echo "CXX <= $<" + +Enclave/%.o: Enclave/%.cc + @$(CXX) $(SGX_COMMON_CXXFLAGS) $(Enclave_Cpp_Flags) -c $< -o $@ + @echo "CXX <= $<" + +$(Enclave_Cpp_Objects): Enclave/Enclave_t.h + +$(Enclave_Name): Enclave/Enclave_t.o $(Enclave_Cpp_Objects) + @$(CXX) $^ -o $@ $(Enclave_Link_Flags) + @echo "LINK => $@" + +$(Signed_Enclave_Name): $(Enclave_Name) +ifeq ($(wildcard $(Enclave_Test_Key)),) + @echo "There is no enclave test key." + @echo "The project will generate a key for test." + @openssl genrsa -out $(Enclave_Test_Key) -3 3072 +endif + @$(SGX_ENCLAVE_SIGNER) sign -key $(Enclave_Test_Key) -enclave $(Enclave_Name) -out $@ -config $(Enclave_Config_File) + @echo "SIGN => $@" + +.PHONY: clean + +clean: + @rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.* $(Enclave_Test_Key) diff --git a/SampleCode/SampleMbedCrypto/README.txt b/SampleCode/SampleMbedCrypto/README.txt new file mode 100644 index 000000000..6970e6429 --- /dev/null +++ b/SampleCode/SampleMbedCrypto/README.txt @@ -0,0 +1,30 @@ +--------------------------- +Purpose of SampleMbedCrypto +--------------------------- +The project demonstrates how to use Mbedtls cryptographic APIs inside SGX Enclaves. + +------------------------------------ +How to Build/Execute the Sample Code +------------------------------------ +1. Install Intel(R) SGX SDK for Linux* OS +2. Enclave test key(two options): + a. Install openssl first, then the project will generate a test key automatically when you build the project. + b. Rename your test key(3072-bit RSA private key) to and put it under the folder. +3. Make sure your environment is set: + $ source ${sgx-sdk-install-path}/environment +4. Build the project with the prepared Makefile: + a. Hardware Mode, Debug build: + $ make SGX_MODE=HW SGX_DEBUG=1 + b. Hardware Mode, Pre-release build: + $ make SGX_MODE=HW SGX_PRERELEASE=1 + c. Hardware Mode, Release build: + $ make SGX_MODE=HW + d. Simulation Mode, Debug build: + $ make SGX_MODE=SIM + e. Simulation Mode, Pre-release build: + $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0 + f. Simulation Mode, Release build: + $ make SGX_MODE=SIM SGX_DEBUG=0 +5. Execute the binary directly: + $ ./app +6. Remember to "make clean" before switching build mode diff --git a/common/inc/internal/arch.h b/common/inc/internal/arch.h index 8cfa683e6..ba8206212 100644 --- a/common/inc/internal/arch.h +++ b/common/inc/internal/arch.h @@ -92,7 +92,7 @@ flags definitions typedef struct _tcs_t { uint64_t reserved0; /* (0) */ - uint64_t flags; /* (8)bit 0: DBGOPTION */ + uint64_t flags; /* (8)bit 0: DBGOPTION, bit 1: AEXNOTIFY */ uint64_t ossa; /* (16)State Save Area */ uint32_t cssa; /* (24)Current SSA slot */ uint32_t nssa; /* (28)Number of SSA slots */ @@ -130,6 +130,8 @@ typedef struct _exit_info_t #define SE_VECTOR_AC 17 #define SE_VECTOR_XM 19 +#define SSA_AEXNOTIFY_MASK 0x1U /* Only set the first bit */ + typedef struct _ssa_gpr_t { REGISTER( ax); /* (0) */ @@ -153,7 +155,8 @@ typedef struct _ssa_gpr_t REGISTER( sp_u); /* (144) untrusted stack pointer. saved by EENTER */ REGISTER( bp_u); /* (152) untrusted frame pointer. saved by EENTER */ exit_info_t exit_info; /* (160) contain information for exits */ - uint32_t reserved; /* (164) padding to multiple of 8 bytes */ + uint8_t reserved[3]; /* (164) padding */ + uint8_t aex_notify; /* (167) AEX Notify */ uint64_t fs; /* (168) FS register */ uint64_t gs; /* (176) GS register */ } ssa_gpr_t; diff --git a/common/inc/internal/global_data.h b/common/inc/internal/global_data.h index 21fc56e1f..d3ae5e867 100644 --- a/common/inc/internal/global_data.h +++ b/common/inc/internal/global_data.h @@ -65,6 +65,7 @@ typedef struct _global_data_t uint64_t enclave_image_address; /* the base address of the enclave image */ uint64_t elrange_start_address; /* the base address provided in the enclave's SECS (SECS.BASEADDR) */ uint64_t elrange_size; /* the size of the enclave address range provided in the enclave's SECS (SECS.SIZE) */ + sys_word_t edmm_bk_overhead; /* memory overhead used by edmm bookkeeping */ } global_data_t; #define ENCLAVE_INIT_NOT_STARTED 0 diff --git a/common/inc/internal/inst.h b/common/inc/internal/inst.h index 84b7b2261..87ddd9ff8 100644 --- a/common/inc/internal/inst.h +++ b/common/inc/internal/inst.h @@ -49,7 +49,8 @@ typedef enum { SE_EMODPE, SE_EACCEPTCOPY, SE_EVERIFYREPORT2 = 0x8, - SE_LAST_RING3, + SE_EDECCSSA = 0x9, + SE_LAST_RING3, SE_ECREATE = 0x0, SE_EADD, diff --git a/common/inc/internal/linux/linux-regs.h b/common/inc/internal/linux/linux-regs.h index 8741edc2e..02c578879 100644 --- a/common/inc/internal/linux/linux-regs.h +++ b/common/inc/internal/linux/linux-regs.h @@ -90,6 +90,7 @@ #define SE_EMODPE 6 #define SE_EACCEPTCOPY 7 #define SE_EVERIFYREPORT2 8 +#define SE_EDECCSSA 9 #define SE_ECREATE 0 diff --git a/common/inc/internal/rts.h b/common/inc/internal/rts.h index 612cd8454..6c7bd45f2 100644 --- a/common/inc/internal/rts.h +++ b/common/inc/internal/rts.h @@ -90,6 +90,14 @@ typedef struct _system_features #define SYS_FEATURE_MSb 63 #define SYS_FEATURE_EXTEND 62 +// feature bit in system_feature_set: +// bit0 - EDMM +// bit1 - AEXNOTIFY +#define EDMM_BIT 0 +#define AEXNOTIFY_BIT 1 +#define EDMM_ENABLE_BIT 0x1ULL + + #define OCALL_FLAG 0x4F434944 #define BUILTIN_OCALL_1 -2 diff --git a/common/inc/internal/se_version.h b/common/inc/internal/se_version.h index c44d03d52..3fa066f33 100644 --- a/common/inc/internal/se_version.h +++ b/common/inc/internal/se_version.h @@ -31,21 +31,21 @@ #ifndef _SE_VERSION_H_ #define _SE_VERSION_H_ -#define STRFILEVER "2.19.100.3" +#define STRFILEVER "2.20.100.4" #define SGX_MAJOR_VERSION 2 -#define SGX_MINOR_VERSION 19 +#define SGX_MINOR_VERSION 20 #define SGX_REVISION_VERSION 100 #define MAKE_VERSION_UINT(major,minor,rev) (((uint64_t)major)<<32 | ((uint64_t)minor) << 16 | rev) #define VERSION_UINT MAKE_VERSION_UINT(SGX_MAJOR_VERSION, SGX_MINOR_VERSION, SGX_REVISION_VERSION) #define COPYRIGHT "Copyright (C) 2023 Intel Corporation" -#define UAE_SERVICE_VERSION "2.3.218.3" -#define URTS_VERSION "2.0.102.3" -#define ENCLAVE_COMMON_VERSION "1.2.102.3" -#define LAUNCH_VERSION "1.0.120.3" -#define EPID_VERSION "1.0.120.3" -#define QUOTE_EX_VERSION "1.1.120.3" +#define UAE_SERVICE_VERSION "2.3.219.4" +#define URTS_VERSION "2.0.103.4" +#define ENCLAVE_COMMON_VERSION "1.2.103.4" +#define LAUNCH_VERSION "1.0.121.4" +#define EPID_VERSION "1.0.121.4" +#define QUOTE_EX_VERSION "1.1.121.4" #define PCE_VERSION "1.19.100.1" #define LE_VERSION "1.19.100.1" diff --git a/common/inc/internal/thread_data.h b/common/inc/internal/thread_data.h index e0a5cf5aa..27d4b0e65 100644 --- a/common/inc/internal/thread_data.h +++ b/common/inc/internal/thread_data.h @@ -85,6 +85,9 @@ typedef size_t sys_word_t; */ #define SGX_UTILITY_THREAD 0x1 +#define TCS_FLAG_DBGOPTIN 0x1 +#define TCS_FLAG_AEXNOTIFY 0x2 + typedef struct _thread_data_t { sys_word_t self_addr; @@ -94,10 +97,14 @@ typedef struct _thread_data_t sys_word_t first_ssa_gpr; /* set by urts, relative to TCS */ sys_word_t stack_guard; /* GCC expects start_guard at 0x14 on x86 and 0x28 on x64 */ - sys_word_t flags; + sys_word_t flags; /* indicate whether it is for utility thread or not.*/ sys_word_t xsave_size; /* in bytes (se_ptrace.c needs to know its offset).*/ sys_word_t last_error; /* init to be 0. Used by trts. */ + sys_word_t aex_mitigation_list; /* AEX Notify mitigation handler list */ + sys_word_t aex_notify_flag; /* Used to record the aexnotify status last time */ + sys_word_t first_ssa_xsave; /* set by urts, relative to TCS */ + #ifdef TD_SUPPORT_MULTI_PLATFORM sys_word_t m_next; /* next TD used by trusted thread library (of type "struct _thread_data *") */ #else @@ -112,6 +119,9 @@ typedef struct _thread_data_t #endif sys_word_t cxx_thread_info[6]; sys_word_t stack_commit_addr; + + uint32_t aex_notify_entropy_cache; + int32_t aex_notify_entropy_remaining; } thread_data_t; #ifdef __cplusplus diff --git a/common/inc/sgx_attributes.h b/common/inc/sgx_attributes.h index 523d22ebb..5de45376f 100644 --- a/common/inc/sgx_attributes.h +++ b/common/inc/sgx_attributes.h @@ -40,7 +40,9 @@ #define SGX_FLAGS_MODE64BIT 0x0000000000000004ULL /* If set, then the enclave is 64 bit */ #define SGX_FLAGS_PROVISION_KEY 0x0000000000000010ULL /* If set, then the enclave has access to provision key */ #define SGX_FLAGS_EINITTOKEN_KEY 0x0000000000000020ULL /* If set, then the enclave has access to EINITTOKEN key */ -#define SGX_FLAGS_KSS 0x0000000000000080ULL /* If set enclave uses KSS */ +#define SGX_FLAGS_KSS 0x0000000000000080ULL /* If set, then the enclave uses KSS */ +#define SGX_FLAGS_AEX_NOTIFY 0x0000000000000400ULL /* If set, then the enclave enables AEX Notify */ + #define SGX_FLAGS_NON_CHECK_BITS 0x00FF000000000000ULL /* BIT[55-48] will not be checked */ @@ -60,7 +62,9 @@ typedef struct _attributes_t uint64_t xfrm; } sgx_attributes_t; -/* define MISCSELECT - all bits are currently reserved */ +/* Define MISCSELECT + * bit 0: EXINFO + * bit 31-1: reserved(0) */ typedef uint32_t sgx_misc_select_t; typedef struct _sgx_misc_attribute_t { diff --git a/common/inc/sgx_trts_aex.h b/common/inc/sgx_trts_aex.h new file mode 100644 index 000000000..ea28ffc0a --- /dev/null +++ b/common/inc/sgx_trts_aex.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + + +/** + * File: sgx_trts_aex.h + * Description: + * Header file for aex notify handling APIs. + */ + +#ifndef _SGX_TRTS_AEX_H_ +#define _SGX_TRTS_AEX_H_ + +#include +#include +#include "sgx_defs.h" +#include "sgx_trts_exception.h" +#include "sgx_error.h" + +typedef void (*sgx_aex_mitigation_fn_t)(const sgx_exception_info_t *info, const void * args); + +typedef struct _aex_mitigation_node_t +{ + sgx_aex_mitigation_fn_t handler; + const void *args; + struct _aex_mitigation_node_t * next; +} sgx_aex_mitigation_node_t; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* sgx_set_ssa_aexnotify() + * Parameters: + * flag - 0 to disable AEX-Notify + * non-zero to enable AEX-Notify + * Return Value: + * SGX_SUCCESS - success + * SGX_ERROR_UNEXPECTED - unexpected error + */ +sgx_status_t SGXAPI sgx_set_ssa_aexnotify(int flag); + + +/* sgx_register_aex_handler() + * Parameters: + * aex_node - A pointer to an AEX mitigation node. The mitigation node must exist and be valid until it is unregistered. + * handler - A function handler to call after being notified of an AEX + * args - Arguments to pass to the handler + * Return Value: + * SGX_SUCCESS - success + * SGX_ERROR_INVALID_PARAMETER - aex_node or handler are NULL + */ +sgx_status_t SGXAPI sgx_register_aex_handler(sgx_aex_mitigation_node_t *aex_node, sgx_aex_mitigation_fn_t handler, const void *args); + +/* sgx_unregister_aex_handler() + * Parameters: + * handler - A function handler that was previously registered + * Return Value: + * SGX_SUCCESS - success + * SGX_ERROR_INVALID_PARAMETER - handler was NULL or has not been previously registered + * SGX_ERROR_UNEXPECTED - There currently are no registered handlers + */ +sgx_status_t SGXAPI sgx_unregister_aex_handler(sgx_aex_mitigation_fn_t handler); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/common/inc/sgx_trts_exception.h b/common/inc/sgx_trts_exception.h index bd66e5e4b..da8146cf5 100644 --- a/common/inc/sgx_trts_exception.h +++ b/common/inc/sgx_trts_exception.h @@ -112,12 +112,22 @@ typedef struct _exinfo_t uint32_t reserved; }sgx_misc_exinfo_t; + __attribute__((aligned(64))) typedef struct _exception_info_t { sgx_cpu_context_t cpu_context; sgx_exception_vector_t exception_vector; sgx_exception_type_t exception_type; sgx_misc_exinfo_t exinfo; + uint32_t exception_valid; + uint32_t do_aex_mitigation; + uint64_t xsave_size; +#if defined (_M_X64) || defined (__x86_64__) + uint64_t reserved[1]; +#else + uint64_t reserved[6]; +#endif + uint8_t xsave_area[0]; // 64-byte aligned } sgx_exception_info_t; typedef int (*sgx_exception_handler_t)(sgx_exception_info_t *info); diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index 92f842cea..6bc4630d8 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -46,9 +46,10 @@ RUN apt-get update && apt-get install -y \ ocaml \ ocamlbuild \ protobuf-compiler \ - python \ + python3 \ reprepro \ wget +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 # We assume this docker file is invoked with root at the top of linux-sgx repo, see shell scripts for example. WORKDIR /linux-sgx @@ -63,7 +64,8 @@ ENV SGX_SDK=/opt/intel/sgxsdk WORKDIR /linux-sgx RUN make psw_install_pkg -RUN make deb_local_repo +ENV BUILD_PLATFORM="docker" +RUN make deb_local_repo FROM ubuntu:18.04 as aesm RUN apt-get update && apt-get install -y \ diff --git a/docker/build/tdx-qgs.dockerfile b/docker/build/tdx-qgs.dockerfile index 35a57be2b..461f132e9 100644 --- a/docker/build/tdx-qgs.dockerfile +++ b/docker/build/tdx-qgs.dockerfile @@ -31,7 +31,7 @@ FROM quay.io/centos/centos:stream8 as qgs-builder RUN dnf -y groupinstall 'Development Tools' -RUN dnf -y install --enablerepo=powertools ocaml ocaml-ocamlbuild wget python2 \ +RUN dnf -y install --enablerepo=powertools ocaml ocaml-ocamlbuild wget python3 \ openssl-devel libcurl-devel protobuf-devel cmake createrepo yum-utils \ dos2unix pkgconf boost-devel protobuf-c-compiler protobuf-c-devel \ protobuf-lite-devel @@ -39,13 +39,14 @@ RUN dnf -y install --enablerepo=powertools ocaml ocaml-ocamlbuild wget python2 \ # We assume this docker file is invoked with root at the top of linux-sgx repo, see shell scripts for example. WORKDIR /linux-sgx COPY . . -RUN alternatives --set python /usr/bin/python2 +RUN alternatives --set python /usr/bin/python3 RUN make sdk_install_pkg_no_mitigation WORKDIR /opt/intel RUN sh -c 'echo yes | /linux-sgx/linux/installer/bin/sgx_linux_x64_sdk_*.bin' WORKDIR /linux-sgx +ENV BUILD_PLATFORM="docker" RUN make rpm_local_repo @@ -54,6 +55,7 @@ FROM quay.io/centos/centos:stream8 as qgs WORKDIR /installer COPY --from=qgs-builder /linux-sgx/linux/installer/rpm/sgx_rpm_local_repo/ . +RUN dnf install -y dnf-plugins-core RUN dnf config-manager --add-repo file:///installer RUN dnf -y install --setopt=install_weak_deps=False --nogpgcheck tdx-qgs \ libsgx-dcap-default-qpl diff --git a/download_prebuilt.sh b/download_prebuilt.sh index 76e528685..2f019a0b7 100755 --- a/download_prebuilt.sh +++ b/download_prebuilt.sh @@ -33,11 +33,11 @@ top_dir=`dirname $0` out_dir=$top_dir -optlib_name=optimized_libs_2.19.tar.gz -ae_file_name=prebuilt_ae_2.19.tar.gz +optlib_name=optimized_libs_2.20.tar.gz +ae_file_name=prebuilt_ae_2.20.tar.gz binutils_file_name=as.ld.objdump.r4.tar.gz -checksum_file=SHA256SUM_prebuilt_2.19.cfg -server_url_path=https://download.01.org/intel-sgx/sgx-linux/2.19 +checksum_file=SHA256SUM_prebuilt_2.20.cfg +server_url_path=https://download.01.org/intel-sgx/sgx-linux/2.20 server_optlib_url=$server_url_path/$optlib_name server_ae_url=$server_url_path/$ae_file_name server_binutils_url=$server_url_path/$binutils_file_name diff --git a/external/dcap_source b/external/dcap_source index 71557c7d1..0443ae263 160000 --- a/external/dcap_source +++ b/external/dcap_source @@ -1 +1 @@ -Subproject commit 71557c7d1d869b6bd6f95566c051cbd098549509 +Subproject commit 0443ae263818a78afeeaf50ca29fc2cff02cb829 diff --git a/external/dnnl/README b/external/dnnl/README index de60e10c3..c891dd6d1 100644 --- a/external/dnnl/README +++ b/external/dnnl/README @@ -1,5 +1,7 @@ The Intel(R) Software Guard Extensions (Intel(R) SGX) Deep Neural Network Library (DNNL) is based on Intel(R) DNNL v1.1.1 (https://github.com/intel/mkl-dnn/tree/v1.1.1). +**NOTE**: The SGX DNNL library is validated under GNU Compiler Collection Version <= 9.4. High GCC versions are incompatible with the current version. + Build Intel(R) SGX DNNL 1.Enter: linux-trunk/external/dnnl 2.Execute: make diff --git a/external/ippcp_internal/Makefile b/external/ippcp_internal/Makefile index faea09734..1b6831d5c 100644 --- a/external/ippcp_internal/Makefile +++ b/external/ippcp_internal/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2011-2020 Intel Corporation. All rights reserved. +# Copyright (C) 2011-2023 Intel Corporation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -75,7 +75,7 @@ all: build_ipp $(MKDIR) $(OUT_DIR) $(CP) ipp-crypto/build/.build/RELEASE/lib/libippcp.a $(OUT_DIR) $(CP) ipp-crypto/include/* ./inc/ - patch ipp-crypto/include/ippcp.h -i ./inc/ippcp21u3.patch -o ./inc/ippcp.h + patch ipp-crypto/include/ippcp.h -i ./inc/ippcp21u7.patch -o ./inc/ippcp.h $(MKDIR) license $(CP) ipp-crypto/LICENSE ./license/ @@ -87,7 +87,7 @@ ifeq ($(shell git rev-parse --is-inside-work-tree), true) git submodule update -f --init --recursive --remote -- $(IPP_SOURCE) else $(RM) -rf $(IPP_SOURCE) - git clone -b ippcp_2021.3 https://github.com/intel/ipp-crypto.git --depth 1 $(IPP_SOURCE) + git clone -b ippcp_2021.7 https://github.com/intel/ipp-crypto.git --depth 1 $(IPP_SOURCE) endif cd $(IPP_SOURCE) && git apply ../0001-IPP-crypto-for-SGX.patch mkdir -p $(IPP_SOURCE)/build diff --git a/external/ippcp_internal/Makefile.psw_dcap b/external/ippcp_internal/Makefile.psw_dcap index 3f526996c..2bb2e4c60 100644 --- a/external/ippcp_internal/Makefile.psw_dcap +++ b/external/ippcp_internal/Makefile.psw_dcap @@ -1,5 +1,5 @@ # -# Copyright (C) 2011-2020 Intel Corporation. All rights reserved. +# Copyright (C) 2011-2023 Intel Corporation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ all: build_ipp $(MKDIR) $(OUT_DIR) $(CP) ipp-crypto/build/.build/RELEASE/lib/libippcp.a $(OUT_DIR) $(CP) ipp-crypto/include/* ./inc/ - patch ipp-crypto/include/ippcp.h -i ./inc/ippcp21u3.patch -o ./inc/ippcp.h + patch ipp-crypto/include/ippcp.h -i ./inc/ippcp21u7.patch -o ./inc/ippcp.h $(MKDIR) license $(CP) ipp-crypto/LICENSE ./license/ diff --git a/external/ippcp_internal/README.md b/external/ippcp_internal/README.md index da775fc58..7ec65d8c9 100644 --- a/external/ippcp_internal/README.md +++ b/external/ippcp_internal/README.md @@ -1,19 +1,30 @@ -The ippcp library is built based on the Open Source project ipp-crypto: +The ippcp library is built based on the IPP Cryptography open source project: * https://github.com/intel/ipp-crypto/ - * tag: [ippcp_2021.3](https://github.com/intel/ipp-crypto/tree/ippcp_2021.3) + * tag: [ippcp_2021.7](https://github.com/intel/ipp-crypto/tree/ippcp_2021.7) In order to build your own IPP crypto, please follow below steps: 1. Download the prebuilt mitigation tools package `as.ld.objdump.{ver}.tar.gz` from [01.org](https://download.01.org/intel-sgx/latest/linux-latest/), extract the package and copy the tools to `/usr/local/bin`. 2. Read the ipp-crypto README to prepare your build environment. -3. Make sure ipp-crypto source code are prepared. +3. Make sure ipp-crypto source code is prepared. 4. Build the target ippcp library with the prepared Makefile: - a. Build the target ippcp library with All-Loads-Mitigation: - $ make MITIGATION-CVE-2020-0551=LOAD - b. Build the target ippcp library with Branch-Mitigation: - $ make MITIGATION-CVE-2020-0551=CF - c. Build the target ippcp library with No-Mitigation: - $ make -The built-out static library `libippcp.a` and header files will be copied into the right place. + 1. Build the target ippcp library with All-Loads-Mitigation: + $ make MITIGATION-CVE-2020-0551=LOAD + 2. Build the target ippcp library with Branch-Mitigation: + $ make MITIGATION-CVE-2020-0551=CF + 3. Build the target ippcp library with No-Mitigation: + $ make +The built static library `libippcp.a` and header files will be copied into the right place. Remember to "make clean" before switching the build. -For IPP crypto reproducible build, please follow the instructions in [reproducibility README.md](../../linux/reproducibility/README.md) to reproduce the prebuilt IPP crypto. +For the IPP crypto reproducible build, please follow the instructions in [reproducibility README.md](../../linux/reproducibility/README.md) to reproduce the prebuilt IPP crypto. + +These are the steps to build the IPP Crypto-based dispatcher code after you built the library: +1. `cd ./ipp-crypto/tools/ipp_custom_library_tool_python` +2. `awk -F\, '/IPPAPI\(/ {print $2}' ../../../inc/ippcp.h | awk '{print $1}' >functions.txt` +3. `python3 main.py -c -g -p ./ -ff functions.txt -arch intel64 -d sse42 avx2 avx512ifma -root ../../build/.build/RELEASE/ --prefix sgx_disp_` +`Intel(R) Custom Library Tool console version is on...` +`Current package: Intel(R) Integrated Performance Primitives Cryptography Version 2021.7.0 (11.5 )` +`Generation completed!` +4. `./build_custom_library_intel64.sh` +`Build completed!` +5. `cp custom_dispatcher/intel64/* ../../../../../sdk/tlibcrypto/ipp/ipp_disp/intel64/` diff --git a/external/ippcp_internal/inc/ippcp21u3.patch b/external/ippcp_internal/inc/ippcp21u7.patch similarity index 100% rename from external/ippcp_internal/inc/ippcp21u3.patch rename to external/ippcp_internal/inc/ippcp21u7.patch diff --git a/external/ippcp_internal/inc/sgx_ippcp.h b/external/ippcp_internal/inc/sgx_ippcp.h index 18d452794..db4b7bca9 100644 --- a/external/ippcp_internal/inc/sgx_ippcp.h +++ b/external/ippcp_internal/inc/sgx_ippcp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * Copyright (C) 2011-2023 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -84,6 +84,9 @@ extern "C" { #define ippsAESDecryptCTR sgx_disp_ippsAESDecryptCTR #define ippsAESEncryptXTS_Direct sgx_disp_ippsAESEncryptXTS_Direct #define ippsAESDecryptXTS_Direct sgx_disp_ippsAESDecryptXTS_Direct + #define ippsAESSetupNoise sgx_disp_ippsAESSetupNoise + #define ippsAES_GCMSetupNoise sgx_disp_ippsAES_GCMSetupNoise + #define ippsAES_CMACSetupNoise sgx_disp_ippsAES_CMACSetupNoise #define ippsAES_EncryptCFB16_MB sgx_disp_ippsAES_EncryptCFB16_MB #define ippsSMS4GetSize sgx_disp_ippsSMS4GetSize #define ippsSMS4Init sgx_disp_ippsSMS4Init @@ -239,19 +242,30 @@ extern "C" { #define ippsHashMethodGetSize sgx_disp_ippsHashMethodGetSize #define ippsHashMethodSet_MD5 sgx_disp_ippsHashMethodSet_MD5 #define ippsHashMethodSet_SM3 sgx_disp_ippsHashMethodSet_SM3 + #define ippsHashStateMethodSet_SM3 sgx_disp_ippsHashStateMethodSet_SM3 #define ippsHashMethodSet_SHA1 sgx_disp_ippsHashMethodSet_SHA1 #define ippsHashMethodSet_SHA1_NI sgx_disp_ippsHashMethodSet_SHA1_NI #define ippsHashMethodSet_SHA1_TT sgx_disp_ippsHashMethodSet_SHA1_TT #define ippsHashMethodSet_SHA256 sgx_disp_ippsHashMethodSet_SHA256 #define ippsHashMethodSet_SHA256_NI sgx_disp_ippsHashMethodSet_SHA256_NI #define ippsHashMethodSet_SHA256_TT sgx_disp_ippsHashMethodSet_SHA256_TT + #define ippsHashStateMethodSet_SHA256 sgx_disp_ippsHashStateMethodSet_SHA256 + #define ippsHashStateMethodSet_SHA256_NI sgx_disp_ippsHashStateMethodSet_SHA256_NI + #define ippsHashStateMethodSet_SHA256_TT sgx_disp_ippsHashStateMethodSet_SHA256_TT #define ippsHashMethodSet_SHA224 sgx_disp_ippsHashMethodSet_SHA224 #define ippsHashMethodSet_SHA224_NI sgx_disp_ippsHashMethodSet_SHA224_NI #define ippsHashMethodSet_SHA224_TT sgx_disp_ippsHashMethodSet_SHA224_TT + #define ippsHashStateMethodSet_SHA224 sgx_disp_ippsHashStateMethodSet_SHA224 + #define ippsHashStateMethodSet_SHA224_NI sgx_disp_ippsHashStateMethodSet_SHA224_NI + #define ippsHashStateMethodSet_SHA224_TT sgx_disp_ippsHashStateMethodSet_SHA224_TT #define ippsHashMethodSet_SHA512 sgx_disp_ippsHashMethodSet_SHA512 #define ippsHashMethodSet_SHA384 sgx_disp_ippsHashMethodSet_SHA384 #define ippsHashMethodSet_SHA512_256 sgx_disp_ippsHashMethodSet_SHA512_256 #define ippsHashMethodSet_SHA512_224 sgx_disp_ippsHashMethodSet_SHA512_224 + #define ippsHashStateMethodSet_SHA512 sgx_disp_ippsHashStateMethodSet_SHA512 + #define ippsHashStateMethodSet_SHA384 sgx_disp_ippsHashStateMethodSet_SHA384 + #define ippsHashStateMethodSet_SHA512_256 sgx_disp_ippsHashStateMethodSet_SHA512_256 + #define ippsHashStateMethodSet_SHA512_224 sgx_disp_ippsHashStateMethodSet_SHA512_224 #define ippsHashGetSize_rmf sgx_disp_ippsHashGetSize_rmf #define ippsHashInit_rmf sgx_disp_ippsHashInit_rmf #define ippsHashPack_rmf sgx_disp_ippsHashPack_rmf @@ -546,12 +560,19 @@ extern "C" { #define ippsGFpECTstKeyPair sgx_disp_ippsGFpECTstKeyPair #define ippsGFpECSharedSecretDH sgx_disp_ippsGFpECSharedSecretDH #define ippsGFpECSharedSecretDHC sgx_disp_ippsGFpECSharedSecretDHC + #define ippsGFpECMessageRepresentationSM2 sgx_disp_ippsGFpECMessageRepresentationSM2 #define ippsGFpECSignDSA sgx_disp_ippsGFpECSignDSA #define ippsGFpECVerifyDSA sgx_disp_ippsGFpECVerifyDSA #define ippsGFpECSignNR sgx_disp_ippsGFpECSignNR #define ippsGFpECVerifyNR sgx_disp_ippsGFpECVerifyNR #define ippsGFpECSignSM2 sgx_disp_ippsGFpECSignSM2 #define ippsGFpECVerifySM2 sgx_disp_ippsGFpECVerifySM2 + #define ippsGFpECUserIDHashSM2 sgx_disp_ippsGFpECUserIDHashSM2 + #define ippsGFpECKeyExchangeSM2_GetSize sgx_disp_ippsGFpECKeyExchangeSM2_GetSize + #define ippsGFpECKeyExchangeSM2_Init sgx_disp_ippsGFpECKeyExchangeSM2_Init + #define ippsGFpECKeyExchangeSM2_Setup sgx_disp_ippsGFpECKeyExchangeSM2_Setup + #define ippsGFpECKeyExchangeSM2_SharedKey sgx_disp_ippsGFpECKeyExchangeSM2_SharedKey + #define ippsGFpECKeyExchangeSM2_Confirm sgx_disp_ippsGFpECKeyExchangeSM2_Confirm #define ippsGFpECGetInfo_GF sgx_disp_ippsGFpECGetInfo_GF #define ippsGFpECESGetSize_SM2 sgx_disp_ippsGFpECESGetSize_SM2 #define ippsGFpECESInit_SM2 sgx_disp_ippsGFpECESInit_SM2 @@ -561,6 +582,10 @@ extern "C" { #define ippsGFpECESDecrypt_SM2 sgx_disp_ippsGFpECESDecrypt_SM2 #define ippsGFpECESFinal_SM2 sgx_disp_ippsGFpECESFinal_SM2 #define ippsGFpECESGetBuffersSize_SM2 sgx_disp_ippsGFpECESGetBuffersSize_SM2 + #define ippsGFpECEncryptSM2_Ext_EncMsgSize sgx_disp_ippsGFpECEncryptSM2_Ext_EncMsgSize + #define ippsGFpECEncryptSM2_Ext sgx_disp_ippsGFpECEncryptSM2_Ext + #define ippsGFpECDecryptSM2_Ext_DecMsgSize sgx_disp_ippsGFpECDecryptSM2_Ext_DecMsgSize + #define ippsGFpECDecryptSM2_Ext sgx_disp_ippsGFpECDecryptSM2_Ext #ifdef __cplusplus diff --git a/external/ippcp_internal/ipp-crypto b/external/ippcp_internal/ipp-crypto index d9d13aaaf..48d0e528c 160000 --- a/external/ippcp_internal/ipp-crypto +++ b/external/ippcp_internal/ipp-crypto @@ -1 +1 @@ -Subproject commit d9d13aaaf8889753fb58a13c2652c39b67c2076b +Subproject commit 48d0e528cf948f32a0ed6e734e6e211470e5971a diff --git a/external/mbedtls/Makefile b/external/mbedtls/Makefile new file mode 100644 index 000000000..bda8918df --- /dev/null +++ b/external/mbedtls/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2011-2019 Intel Corporation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +current_dir := $(patsubst %/,%,$(dir $(mkfile_path))) + +include ../../buildenv.mk + +LIB_NAME= libsgx_mbedcrypto.a +SRC_DIR = mbedtls_code + +CFLAGS := -I$(COMMON_DIR)/inc/internal \ + -I$(COMMON_DIR)/inc \ + -I$(COMMON_DIR)/inc/tlibc + +CFLAGS += $(ENCLAVE_CFLAGS) $(SGX_COMMON_CFLAGS) -Werror -fno-exceptions -fPIC + +.PHONY: all clean library/libmbedcrypto.a +all: library/libmbedcrypto.a sgx_mbedtls_utils.o | $(BUILD_DIR) + @$(RM) -rf .libs && mkdir .libs + @cd .libs && $(AR) x ../$(SRC_DIR)/build/library/libmbedcrypto.a + @$(AR) rsD $(LIB_NAME) .libs/*.o sgx_mbedtls_utils.o + @$(CP) $(LIB_NAME) $(BUILD_DIR)/ + +$(BUILD_DIR): + @$(MKDIR) $@ + +library/libmbedcrypto.a: +ifeq ($(shell grep -c sgx mbedtls_code/library/rsa.c), 0) + @echo "Apply patch for SGX..." + @cd $(SRC_DIR) && git apply ../sgx_mbedtls.patch + @echo "Done." +endif + @rm -rf $(SRC_DIR)/build && mkdir $(SRC_DIR)/build + @cd $(SRC_DIR)/build && cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} $(CFLAGS) -include$(current_dir)/bypass_to_sgxmbed.h " -DGEN_FILES=OFF -DCMAKE_C_COMPILER_WORKS=TRUE .. && make mbedcrypto + +sgx_mbedtls_utils.o: sgx_mbedtls_utils.c + @$(CC) $(CFLAGS) -c $< -o $@ + @echo "CC <= $<" + +clean: + @$(RM) -rf *.a *.o .libs $(BUILD_DIR)/$(LIB_NAME) $(SRC_DIR)/build diff --git a/external/mbedtls/bypass_to_sgxmbed.h b/external/mbedtls/bypass_to_sgxmbed.h new file mode 100644 index 000000000..a9a326de5 --- /dev/null +++ b/external/mbedtls/bypass_to_sgxmbed.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +#include +#include + +#ifndef _BYPASS_TO_SGXMBED_ +#define _BYPASS_TO_SGXMBED_ + +int sgxmbed_printf(const char* fmt, ...); + +#define printf sgxmbed_printf + +#endif // _BYPASS_TO_SGXMBED_ + diff --git a/external/mbedtls/mbedtls_code b/external/mbedtls/mbedtls_code new file mode 160000 index 000000000..1873d3bfc --- /dev/null +++ b/external/mbedtls/mbedtls_code @@ -0,0 +1 @@ +Subproject commit 1873d3bfc2da771672bd8e7e8f41f57e0af77f33 diff --git a/external/mbedtls/sgx_mbedtls.patch b/external/mbedtls/sgx_mbedtls.patch new file mode 100644 index 000000000..d62c36f3c --- /dev/null +++ b/external/mbedtls/sgx_mbedtls.patch @@ -0,0 +1,230 @@ +diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h +index 4292b493b..a0fd173f4 100644 +--- a/include/mbedtls/mbedtls_config.h ++++ b/include/mbedtls/mbedtls_config.h +@@ -89,7 +89,7 @@ + * example, if double-width division is implemented in software, disabling + * it can reduce code size in some embedded targets. + */ +-//#define MBEDTLS_NO_UDBL_DIVISION ++#define MBEDTLS_NO_UDBL_DIVISION + + /** + * \def MBEDTLS_NO_64BIT_MULTIPLICATION +@@ -120,7 +120,7 @@ + * + * Uncomment if the CPU supports SSE2 (IA-32 specific). + */ +-//#define MBEDTLS_HAVE_SSE2 ++#define MBEDTLS_HAVE_SSE2 + + /** + * \def MBEDTLS_HAVE_TIME +@@ -140,7 +140,7 @@ + * regardless of the setting of MBEDTLS_HAVE_TIME, unless + * MBEDTLS_TIMING_ALT is used. See timing.c for more information. + */ +-#define MBEDTLS_HAVE_TIME ++//#define MBEDTLS_HAVE_TIME + + /** + * \def MBEDTLS_HAVE_TIME_DATE +@@ -161,7 +161,7 @@ + * mbedtls_platform_gmtime_r() at compile-time by using the macro + * MBEDTLS_PLATFORM_GMTIME_R_ALT. + */ +-#define MBEDTLS_HAVE_TIME_DATE ++//#define MBEDTLS_HAVE_TIME_DATE + + /** + * \def MBEDTLS_PLATFORM_MEMORY +@@ -264,7 +264,7 @@ + * + * Uncomment to get errors on using deprecated functions and features. + */ +-//#define MBEDTLS_DEPRECATED_REMOVED ++#define MBEDTLS_DEPRECATED_REMOVED + + /** \} name SECTION: System support */ + +@@ -477,7 +477,7 @@ + * + * Uncomment to use your own hardware entropy collector. + */ +-//#define MBEDTLS_ENTROPY_HARDWARE_ALT ++#define MBEDTLS_ENTROPY_HARDWARE_ALT + + /** + * \def MBEDTLS_AES_ROM_TABLES +@@ -1045,7 +1045,7 @@ + * + * Enable functions that use the filesystem. + */ +-#define MBEDTLS_FS_IO ++//#define MBEDTLS_FS_IO + + /** + * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES +@@ -1068,7 +1068,7 @@ + * + * Uncomment this macro to disable the built-in platform entropy functions. + */ +-//#define MBEDTLS_NO_PLATFORM_ENTROPY ++#define MBEDTLS_NO_PLATFORM_ENTROPY + + /** + * \def MBEDTLS_ENTROPY_FORCE_SHA256 +@@ -1917,7 +1917,7 @@ + * + * Uncomment this to enable pthread mutexes. + */ +-//#define MBEDTLS_THREADING_PTHREAD ++#define MBEDTLS_THREADING_PTHREAD + + /** + * \def MBEDTLS_USE_PSA_CRYPTO +@@ -2778,7 +2778,7 @@ + * + * This modules adds support for the VIA PadLock on x86. + */ +-#define MBEDTLS_PADLOCK_C ++//#define MBEDTLS_PADLOCK_C + + /** + * \def MBEDTLS_PEM_PARSE_C +@@ -2994,7 +2994,7 @@ + * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of + * the PSA ITS interface + */ +-#define MBEDTLS_PSA_CRYPTO_STORAGE_C ++//#define MBEDTLS_PSA_CRYPTO_STORAGE_C + + /** + * \def MBEDTLS_PSA_ITS_FILE_C +@@ -3006,7 +3006,7 @@ + * + * Requires: MBEDTLS_FS_IO + */ +-#define MBEDTLS_PSA_ITS_FILE_C ++//#define MBEDTLS_PSA_ITS_FILE_C + + /** + * \def MBEDTLS_RIPEMD160_C +@@ -3312,7 +3312,7 @@ + * + * Enable this layer to allow use of mutexes within mbed TLS + */ +-//#define MBEDTLS_THREADING_C ++#define MBEDTLS_THREADING_C + + /** + * \def MBEDTLS_TIMING_C +@@ -3336,7 +3336,7 @@ + * + * Module: library/timing.c + */ +-#define MBEDTLS_TIMING_C ++//#define MBEDTLS_TIMING_C + + /** + * \def MBEDTLS_VERSION_C +diff --git a/library/aesni.c b/library/aesni.c +index a23c5b595..db1cf1ccd 100644 +--- a/library/aesni.c ++++ b/library/aesni.c +@@ -23,6 +23,7 @@ + */ + + #include "common.h" ++#include "sgx_cpuid.h" + + #if defined(MBEDTLS_AESNI_C) + +@@ -48,21 +49,11 @@ int mbedtls_aesni_has_support(unsigned int what) + static unsigned int c = 0; + + if (!done) { +-#if MBEDTLS_AESNI_HAVE_CODE == 2 +- static unsigned info[4] = { 0, 0, 0, 0 }; +-#if defined(_MSC_VER) +- __cpuid(info, 1); +-#else +- __cpuid(1, info[0], info[1], info[2], info[3]); +-#endif +- c = info[2]; +-#else /* AESNI using asm */ +- asm ("movl $1, %%eax \n\t" +- "cpuid \n\t" +- : "=c" (c) +- : +- : "eax", "ebx", "edx"); +-#endif /* MBEDTLS_AESNI_HAVE_CODE */ ++ int cpuinfo[4] = { -1 }; ++ int status = sgx_cpuid(cpuinfo, 1); ++ if ( 0 != status ) { ++ c = cpuinfo[2]; ++ } + done = 1; + } + +diff --git a/library/entropy.c b/library/entropy.c +index e55410c76..0853577ae 100644 +--- a/library/entropy.c ++++ b/library/entropy.c +@@ -16,6 +16,7 @@ + * See the License for the specific language governing permissions and + * limitations under the License. + */ ++#include "sgx_trts.h" + + #include "common.h" + +@@ -548,6 +549,19 @@ static int entropy_dummy_source(void *data, unsigned char *output, + + #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) + ++int mbedtls_hardware_poll( void *Data, unsigned char *Output, size_t Len, size_t *oLen ) ++{ ++ int ret = 0; ++ (void)Data; ++ ++ if (sgx_read_rand(Output, Len) != SGX_SUCCESS) { ++ ret = 1; ++ } ++ *oLen = Len; ++ ++ return ret; ++} ++ + static int mbedtls_entropy_source_self_test_gather(unsigned char *buf, size_t buf_len) + { + int ret = 0; +diff --git a/library/rsa.c b/library/rsa.c +index 01159dfa2..a1978d106 100644 +--- a/library/rsa.c ++++ b/library/rsa.c +@@ -34,6 +34,7 @@ + * https://arxiv.org/abs/1702.08719v2 + * + */ ++#include "sgx_trts.h" + + #include "common.h" + +@@ -2404,15 +2405,12 @@ void mbedtls_rsa_free(mbedtls_rsa_context *ctx) + static int myrand(void *rng_state, unsigned char *output, size_t len) + { + #if !defined(__OpenBSD__) && !defined(__NetBSD__) +- size_t i; + + if (rng_state != NULL) { + rng_state = NULL; + } + +- for (i = 0; i < len; ++i) { +- output[i] = rand(); +- } ++ if (sgx_read_rand(output, len) != SGX_SUCCESS) return 1; + #else + if (rng_state != NULL) { + rng_state = NULL; diff --git a/external/mbedtls/sgx_mbedtls_utils.c b/external/mbedtls/sgx_mbedtls_utils.c new file mode 100644 index 000000000..4743fba85 --- /dev/null +++ b/external/mbedtls/sgx_mbedtls_utils.c @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include + +int sgxmbed_printf(const char* fmt, ...) +{ + return 0; +} diff --git a/external/sgx-emm/Makefile b/external/sgx-emm/Makefile index ab644aa92..e04122240 100644 --- a/external/sgx-emm/Makefile +++ b/external/sgx-emm/Makefile @@ -35,8 +35,6 @@ CPPFLAGS += -I$(EMM_DIR)/include \ -Wno-missing-braces \ -Wno-unused-parameter -EMMFLAGS := -mno-sse - C_Files := $(EMM_DIR)/bit_array.c \ $(EMM_DIR)/ema.c \ $(EMM_DIR)/emalloc.c \ @@ -62,7 +60,7 @@ $(LIB_NAME): $(CHECK_SOURCE) $(OBJS) $(AR) rcs $@ $(OBJS) $(OBJS): %.o: %.c - $(CC) -c $(COMMON_FLAGS) $(ENCLAVE_CFLAGS) $(CPPFLAGS) $(EMMFLAGS) $< -o $@ + $(CC) -c $(COMMON_FLAGS) $(ENCLAVE_CFLAGS) $(CPPFLAGS) $< -o $@ $(BUILD_DIR): @$(MKDIR) $@ @@ -72,7 +70,7 @@ ifeq ($(shell git rev-parse --is-inside-work-tree 2> /dev/null), true) git submodule update -f --init --recursive -- $(EMM_DIR) else $(RM) -rf $(EMM_DIR) - git clone -b sgx-emm-1.0.1 https://github.com/intel/sgx-emm.git --depth 1 $(EMM_DIR) + git clone -b sgx-emm-1.0.2 https://github.com/intel/sgx-emm.git --depth 1 $(EMM_DIR) endif clean: diff --git a/external/sgx-emm/emm_src b/external/sgx-emm/emm_src index 222b9d8cd..eb4d16c45 160000 --- a/external/sgx-emm/emm_src +++ b/external/sgx-emm/emm_src @@ -1 +1 @@ -Subproject commit 222b9d8cd246809cc8da041241824b0d0469000f +Subproject commit eb4d16c459a27b1aa4e77fa4b2104dc537e2d001 diff --git a/external/sgxssl/prepare_sgxssl.sh b/external/sgxssl/prepare_sgxssl.sh index 4e2d9c919..39a443290 100755 --- a/external/sgxssl/prepare_sgxssl.sh +++ b/external/sgxssl/prepare_sgxssl.sh @@ -70,6 +70,11 @@ if [ ! -f $openssl_out_dir/$openssl_ver_name.tar.gz ]; then fi pushd $top_dir/Linux/ +patched=$(grep -c x509 build_openssl.sh) +if [ '0' -eq $patched ]; then + sed -i '140a cp ../../../dcap_source/prebuilt/openssl/OpenSSL_1.1.1u_files/pcy_*.* crypto/x509v3/.' build_openssl.sh + sed -i '140a cp ../../../dcap_source/prebuilt/openssl/OpenSSL_1.1.1u_files/x509_vfy.c crypto/x509/.' build_openssl.sh +fi if [ "$MITIGATION" != "" ]; then make clean all LINUX_SGX_BUILD=1 DEBUG=$DEBUG else diff --git a/external/vtune/linux/include/jitprofiling.h b/external/vtune/linux/include/jitprofiling.h deleted file mode 100644 index 6c656cc5e..000000000 --- a/external/vtune/linux/include/jitprofiling.h +++ /dev/null @@ -1,694 +0,0 @@ -/* - This file is provided under a dual BSD/GPLv2 license. When using or - redistributing this file, you may do so under either license. - - GPL LICENSE SUMMARY - - Copyright (c) 2005-2014 Intel Corporation. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public License as - published by the Free Software Foundation. - - This program 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - The full GNU General Public License is included in this distribution - in the file called LICENSE.GPL. - - Contact Information: - http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ - - BSD LICENSE - - Copyright (c) 2005-2014 Intel Corporation. All rights reserved. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __JITPROFILING_H__ -#define __JITPROFILING_H__ - -/** - * @brief JIT Profiling APIs - * - * The JIT Profiling API is used to report information about just-in-time - * generated code that can be used by performance tools. The user inserts - * calls in the code generator to report information before JIT-compiled - * code goes to execution. This information is collected at runtime and used - * by tools like Intel(R) VTune(TM) Amplifier to display performance metrics - * associated with JIT-compiled code. - * - * These APIs can be used to\n - * - **Profile trace-based and method-based JIT-compiled - * code**. Some examples of environments that you can profile with these APIs: - * dynamic JIT compilation of JavaScript code traces, JIT execution in OpenCL(TM) - * software technology, Java/.NET managed execution environments, and custom - * ISV JIT engines. - * @code - * #include - * - * if (iJIT_IsProfilingActive != iJIT_SAMPLING_ON) { - * return; - * } - * - * iJIT_Method_Load jmethod = {0}; - * jmethod.method_id = iJIT_GetNewMethodID(); - * jmethod.method_name = "method_name"; - * jmethod.class_file_name = "class_name"; - * jmethod.source_file_name = "source_file_name"; - * jmethod.method_load_address = code_addr; - * jmethod.method_size = code_size; - * - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod); - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, NULL); - * @endcode - * - * * Expected behavior: - * * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an - * already reported method, then such a method becomes invalid and its - * memory region is treated as unloaded. VTune Amplifier displays the metrics - * collected by the method until it is overwritten. - * * If supplied line number information contains multiple source lines for - * the same assembly instruction (code location), then VTune Amplifier picks up - * the first line number. - * * Dynamically generated code can be associated with a module name. - * Use the iJIT_Method_Load_V2 structure.\n - * Clarification of some cases: - * * If you register a function with the same method ID multiple times, - * specifying different module names, then the VTune Amplifier picks up - * the module name registered first. If you want to distinguish the same - * function between different JIT engines, supply different method IDs for - * each function. Other symbolic information (for example, source file) - * can be identical. - * - * - **Analyze split functions** (multiple joint or disjoint code regions - * belonging to the same function) **including re-JIT** - * with potential overlapping of code regions in time, which is common in - * resource-limited environments. - * @code - * #include - * - * unsigned int method_id = iJIT_GetNewMethodID(); - * - * iJIT_Method_Load a = {0}; - * a.method_id = method_id; - * a.method_load_address = 0x100; - * a.method_size = 0x20; - * - * iJIT_Method_Load b = {0}; - * b.method_id = method_id; - * b.method_load_address = 0x200; - * b.method_size = 0x30; - * - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a); - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&b); - * @endcode - * - * * Expected behaviour: - * * If a iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an - * already reported method, then such a method becomes invalid and - * its memory region is treated as unloaded. - * * All code regions reported with the same method ID are considered as - * belonging to the same method. Symbolic information (method name, - * source file name) will be taken from the first notification, and all - * subsequent notifications with the same method ID will be processed - * only for line number table information. So, the VTune Amplifier will map - * samples to a source line using the line number table from the current - * notification while taking the source file name from the very first one.\n - * Clarification of some cases:\n - * * If you register a second code region with a different source file - * name and the same method ID, then this information will be saved and - * will not be considered as an extension of the first code region, but - * VTune Amplifier will use the source file of the first code region and map - * performance metrics incorrectly. - * * If you register a second code region with the same source file as - * for the first region and the same method ID, then the source file will be - * discarded but VTune Amplifier will map metrics to the source file correctly. - * * If you register a second code region with a null source file and - * the same method ID, then provided line number info will be associated - * with the source file of the first code region. - * - * - **Explore inline functions** including multi-level hierarchy of - * nested inline methods which shows how performance metrics are distributed through them. - * @code - * #include - * - * // method_id parent_id - * // [-- c --] 3000 2000 - * // [---- d -----] 2001 1000 - * // [---- b ----] 2000 1000 - * // [------------ a ----------------] 1000 n/a - * - * iJIT_Method_Load a = {0}; - * a.method_id = 1000; - * - * iJIT_Method_Inline_Load b = {0}; - * b.method_id = 2000; - * b.parent_method_id = 1000; - * - * iJIT_Method_Inline_Load c = {0}; - * c.method_id = 3000; - * c.parent_method_id = 2000; - * - * iJIT_Method_Inline_Load d = {0}; - * d.method_id = 2001; - * d.parent_method_id = 1000; - * - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&a); - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&b); - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&c); - * iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, (void*)&d); - * @endcode - * - * * Requirements: - * * Each inline (iJIT_Method_Inline_Load) method should be associated - * with two method IDs: one for itself; one for its immediate parent. - * * Address regions of inline methods of the same parent method cannot - * overlap each other. - * * Execution of the parent method must not be started until it and all - * its inline methods are reported. - * * Expected behaviour: - * * In case of nested inline methods an order of - * iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED events is not important. - * * If any event overwrites either inline method or top parent method, - * then the parent, including inline methods, becomes invalid and its memory - * region is treated as unloaded. - * - * **Life time of allocated data**\n - * The client sends an event notification to the agent with event-specific - * data, which is a structure. The pointers in the structure refer to memory - * allocated by the client, which responsible for releasing it. The pointers are - * used by the iJIT_NotifyEvent method to copy client's data in a trace file, - * and they are not used after the iJIT_NotifyEvent method returns. - */ - -/** - * @defgroup jitapi JIT Profiling - * @ingroup internal - * @{ - */ - -/** - * @brief Enumerator for the types of notifications - */ -typedef enum iJIT_jvm_event -{ - iJVM_EVENT_TYPE_SHUTDOWN = 2, /**<\brief Send this to shutdown the agent. - * Use NULL for event data. */ - - iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED = 13, /**<\brief Send when dynamic code is - * JIT compiled and loaded into - * memory by the JIT engine, but - * before the code is executed. - * Use iJIT_Method_Load as event - * data. */ -/** @cond exclude_from_documentation */ - iJVM_EVENT_TYPE_METHOD_UNLOAD_START, /**<\brief Send when compiled dynamic - * code is being unloaded from memory. - * Use iJIT_Method_Load as event data.*/ -/** @endcond */ - - iJVM_EVENT_TYPE_METHOD_UPDATE, /**<\brief Send to provide new content for - * a previously reported dynamic code. - * The previous content will be invalidated - * starting from the time of the notification. - * Use iJIT_Method_Load as event data but - * required fields are following: - * - method_id identify the code to update. - * - method_load_address specify start address - * within identified code range - * where update should be started. - * - method_size specify length of updated code - * range. */ - - - iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED, /**<\brief Send when an inline dynamic - * code is JIT compiled and loaded - * into memory by the JIT engine, - * but before the parent code region - * starts executing. - * Use iJIT_Method_Inline_Load as event data.*/ - -/** @cond exclude_from_documentation */ - iJVM_EVENT_TYPE_METHOD_UPDATE_V2, -/** @endcond */ - - iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 = 21, /**<\brief Send when a dynamic code is - * JIT compiled and loaded into - * memory by the JIT engine, but - * before the code is executed. - * Use iJIT_Method_Load_V2 as event data. */ - - iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3 /**<\brief Send when a dynamic code is - * JIT compiled and loaded into - * memory by the JIT engine, but - * before the code is executed. - * Use iJIT_Method_Load_V3 as event data. */ -} iJIT_JVM_EVENT; - -/** - * @brief Enumerator for the agent's mode - */ -typedef enum _iJIT_IsProfilingActiveFlags -{ - iJIT_NOTHING_RUNNING = 0x0000, /**<\brief The agent is not running; - * iJIT_NotifyEvent calls will - * not be processed. */ - iJIT_SAMPLING_ON = 0x0001, /**<\brief The agent is running and - * ready to process notifications. */ -} iJIT_IsProfilingActiveFlags; - -/** - * @brief Description of a single entry in the line number information of a code region. - * @details A table of line number entries gives information about how the reported code region - * is mapped to source file. - * Intel(R) VTune(TM) Amplifier uses line number information to attribute - * the samples (virtual address) to a line number. \n - * It is acceptable to report different code addresses for the same source line: - * @code - * Offset LineNumber - * 1 2 - * 12 4 - * 15 2 - * 18 1 - * 21 30 - * - * VTune Amplifier constructs the following table using the client data - * - * Code subrange Line number - * 0-1 2 - * 1-12 4 - * 12-15 2 - * 15-18 1 - * 18-21 30 - * @endcode - */ -typedef struct _LineNumberInfo -{ - unsigned int Offset; /**<\brief Offset from the begining of the code region. */ - unsigned int LineNumber; /**<\brief Matching source line number offset (from beginning of source file). */ - -} *pLineNumberInfo, LineNumberInfo; - -/** - * @brief Enumerator for the code architecture. - */ -typedef enum _iJIT_CodeArchitecture -{ - iJIT_CA_NATIVE = 0, /**<\brief Native to the process architecture that is calling it. */ - - iJIT_CA_32, /**<\brief 32-bit machine code. */ - - iJIT_CA_64 /**<\brief 64-bit machine code. */ - -} iJIT_CodeArchitecture; - -#pragma pack(push, 8) - -/** - * @brief Description of a JIT-compiled method - * @details When you use the iJIT_Method_Load structure to describe - * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED - * as an event type to report it. - */ -typedef struct _iJIT_Method_Load -{ - unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. - * You must either use the API function - * iJIT_GetNewMethodID to get a valid and unique - * method ID, or else manage ID uniqueness - * and correct range by yourself.\n - * You must use the same method ID for all code - * regions of the same method, otherwise different - * method IDs specify different methods. */ - - char* method_name; /**<\brief The name of the method. It can be optionally - * prefixed with its class name and appended with - * its complete signature. Can't be NULL. */ - - void* method_load_address; /**<\brief The start virtual address of the method code - * region. If NULL, data provided with - * event are not accepted. */ - - unsigned int method_size; /**<\brief The code size of the method in memory. - * If 0, then data provided with the event are not - * accepted. */ - - unsigned int line_number_size; /**<\brief The number of entries in the line number - * table.0 if none. */ - - pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info - * array. Can be NULL if - * line_number_size is 0. See - * LineNumberInfo Structure for a - * description of a single entry in - * the line number info array */ - - unsigned int class_id; /**<\brief This field is obsolete. */ - - char* class_file_name; /**<\brief Class name. Can be NULL.*/ - - char* source_file_name; /**<\brief Source file name. Can be NULL.*/ - -} *piJIT_Method_Load, iJIT_Method_Load; - -/** - * @brief Description of a JIT-compiled method - * @details When you use the iJIT_Method_Load_V2 structure to describe - * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2 - * as an event type to report it. - */ -typedef struct _iJIT_Method_Load_V2 -{ - unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. - * You must either use the API function - * iJIT_GetNewMethodID to get a valid and unique - * method ID, or else manage ID uniqueness - * and correct range by yourself.\n - * You must use the same method ID for all code - * regions of the same method, otherwise different - * method IDs specify different methods. */ - - char* method_name; /**<\brief The name of the method. It can be optionally - * prefixed with its class name and appended with - * its complete signature. Can't be NULL. */ - - void* method_load_address; /**<\brief The start virtual address of the method code - * region. If NULL, then data provided with the - * event are not accepted. */ - - unsigned int method_size; /**<\brief The code size of the method in memory. - * If 0, then data provided with the event are not - * accepted. */ - - unsigned int line_number_size; /**<\brief The number of entries in the line number - * table. 0 if none. */ - - pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info - * array. Can be NULL if - * line_number_size is 0. See - * LineNumberInfo Structure for a - * description of a single entry in - * the line number info array. */ - - char* class_file_name; /**<\brief Class name. Can be NULL. */ - - char* source_file_name; /**<\brief Source file name. Can be NULL. */ - - char* module_name; /**<\brief Module name. Can be NULL. - The module name can be useful for distinguishing among - different JIT engines. VTune Amplifier will display - reported methods grouped by specific module. */ - -} *piJIT_Method_Load_V2, iJIT_Method_Load_V2; - -/** - * @brief Description of a JIT-compiled method - * @details The iJIT_Method_Load_V3 structure is the same as iJIT_Method_Load_V2 - * with a newly introduced 'arch' field that specifies architecture of the code region. - * When you use the iJIT_Method_Load_V3 structure to describe - * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3 - * as an event type to report it. - */ -typedef struct _iJIT_Method_Load_V3 -{ - unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. - * You must either use the API function - * iJIT_GetNewMethodID to get a valid and unique - * method ID, or manage ID uniqueness - * and correct range by yourself.\n - * You must use the same method ID for all code - * regions of the same method, otherwise they are - * treated as regions of different methods. */ - - char* method_name; /**<\brief The name of the method. It can be optionally - * prefixed with its class name and appended with - * its complete signature. Cannot be NULL. */ - - void* method_load_address; /**<\brief The start virtual address of the method code - * region. If NULL, then data provided with the - * event are not accepted. */ - - unsigned int method_size; /**<\brief The code size of the method in memory. - * If 0, then data provided with the event are not - * accepted. */ - - unsigned int line_number_size; /**<\brief The number of entries in the line number - * table. 0 if none. */ - - pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info - * array. Can be NULL if - * line_number_size is 0. See - * LineNumberInfo Structure for a - * description of a single entry in - * the line number info array. */ - - char* class_file_name; /**<\brief Class name. Can be NULL. */ - - char* source_file_name; /**<\brief Source file name. Can be NULL. */ - - char* module_name; /**<\brief Module name. Can be NULL. - * The module name can be useful for distinguishing among - * different JIT engines. VTune Amplifier will display - * reported methods grouped by specific module. */ - - iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region. - * By default, it is the same as the process - * architecture that is calling it. - * For example, you can use it if your 32-bit JIT - * engine generates 64-bit code. - * - * If JIT engine reports both 32-bit and 64-bit types - * of methods then VTune Amplifier splits the methods - * with the same module name but with different - * architectures in two different modules. VTune Amplifier - * modifies the original name provided with a 64-bit method - * version by ending it with '(64)' */ - -} *piJIT_Method_Load_V3, iJIT_Method_Load_V3; - -/** - * @brief Description of an inline JIT-compiled method - * @details When you use the_iJIT_Method_Inline_Load structure to describe - * the JIT compiled method, use iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED - * as an event type to report it. - */ -typedef struct _iJIT_Method_Inline_Load -{ - unsigned int method_id; /**<\brief Unique method ID. Cannot be 0. - * You must either use the API function - * iJIT_GetNewMethodID to get a valid and unique - * method ID, or else manage ID uniqueness - * and correct range by yourself. */ - - unsigned int parent_method_id; /**<\brief Unique immediate parent's method ID. - * Cannot be 0. - * You must either use the API function - * iJIT_GetNewMethodID to get a valid and unique - * method ID, or else manage ID uniqueness - * and correct range by yourself. */ - - char* method_name; /**<\brief The name of the method. It can be optionally - * prefixed with its class name and appended with - * its complete signature. Can't be NULL. */ - - void* method_load_address; /** <\brief The virtual address on which the method - * is inlined. If NULL, then data provided with - * the event are not accepted. */ - - unsigned int method_size; /**<\brief The code size of the method in memory. - * If 0, then data provided with the event are not - * accepted. */ - - unsigned int line_number_size; /**<\brief The number of entries in the line number - * table. 0 if none. */ - - pLineNumberInfo line_number_table; /**<\brief Pointer to the line numbers info - * array. Can be NULL if - * line_number_size is 0. See - * LineNumberInfo Structure for a - * description of a single entry in - * the line number info array */ - - char* class_file_name; /**<\brief Class name. Can be NULL.*/ - - char* source_file_name; /**<\brief Source file name. Can be NULL.*/ - -} *piJIT_Method_Inline_Load, iJIT_Method_Inline_Load; - -/** @cond exclude_from_documentation */ -/** - * @brief Description of a segment type - * @details Use the segment type to specify a type of data supplied - * with the iJVM_EVENT_TYPE_METHOD_UPDATE_V2 event to be applied to - * a certain code trace. - */ -typedef enum _iJIT_SegmentType -{ - iJIT_CT_UNKNOWN = 0, - - iJIT_CT_CODE, /**<\brief Executable code. */ - - iJIT_CT_DATA, /**<\brief Data (not executable code). - * VTune Amplifier uses the format string - * (see iJIT_Method_Update) to represent - * this data in the VTune Amplifier GUI */ - - iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace. - * Can be used for the following - * iJVM_EVENT_TYPE_METHOD_UPDATE_V2 events, - * if the type of the previously reported segment - * type is the same. */ - iJIT_CT_EOF -} iJIT_SegmentType; - -/** - * @brief Description of a dynamic update of the content within JIT-compiled method - * @details The JIT engine may generate the methods that are updated at runtime - * partially by mixed (data + executable code) content. When you use the iJIT_Method_Update - * structure to describe the update of the content within a JIT-compiled method, - * use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it. - * - * On the first Update event, VTune Amplifier copies the original code range reported by - * the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and - * adds the modified range to the original method. For next update events, VTune Amplifier - * does the same but it uses the latest modified version of a code region for update. - * Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by - * the iJVM_EVENT_TYPE_METHOD_LOAD event. - * Notes: - * - Multiple update events with different types for the same trace are allowed - * but they must be reported for the same code ranges. - * Example, - * @code - * [-- data---] Allowed - * [-- code --] Allowed - * [code] Ignored - * [-- data---] Allowed - * [-- code --] Allowed - * [------------ trace ---------] - * @endcode - * - The types of previously reported events can be changed but they must be reported - * for the same code ranges. - * Example, - * @code - * [-- data---] Allowed - * [-- code --] Allowed - * [-- data---] Allowed - * [-- code --] Allowed - * [------------ trace ---------] - * @endcode - */ - -typedef struct _iJIT_Method_Update -{ - void* load_address; /**<\brief Start address of the update within a method */ - - unsigned int size; /**<\brief The update size */ - - iJIT_SegmentType type; /**<\brief Type of the update */ - - const char* data_format; /**<\brief C string that contains a format string - * that follows the same specifications as format in printf. - * The format string is used for iJIT_CT_CODE only - * and cannot be NULL. - * Format can be changed on the fly. */ -} *piJIT_Method_Update, iJIT_Method_Update; - -/** @endcond */ - -#pragma pack(pop) - -/** @cond exclude_from_documentation */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef CDECL -# if defined WIN32 || defined _WIN32 -# define CDECL __cdecl -# else /* defined WIN32 || defined _WIN32 */ -# if defined _M_IX86 || defined __i386__ -# define CDECL __attribute__ ((cdecl)) -# else /* _M_IX86 || __i386__ */ -# define CDECL /* actual only on x86_64 platform */ -# endif /* _M_IX86 || __i386__ */ -# endif /* defined WIN32 || defined _WIN32 */ -#endif /* CDECL */ - -#define JITAPI CDECL -/** @endcond */ - -/** - * @brief Generates a new unique method ID. - * - * You must use this API to obtain unique and valid method IDs for methods or - * traces reported to the agent if you don't have your own mechanism to generate - * unique method IDs. - * - * @return a new unique method ID. When out of unique method IDs, this API - * returns 0, which is not an accepted value. - */ -unsigned int JITAPI iJIT_GetNewMethodID(void); - -/** - * @brief Returns the current mode of the agent. - * - * @return iJIT_SAMPLING_ON, indicating that agent is running, or - * iJIT_NOTHING_RUNNING if no agent is running. - */ -iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void); - -/** - * @brief Reports infomation about JIT-compiled code to the agent. - * - * The reported information is used to attribute samples obtained from any - * Intel(R) VTune(TM) Amplifier collector. This API needs to be called - * after JIT compilation and before the first entry into the JIT-compiled - * code. - * - * @param[in] event_type - type of the data sent to the agent - * @param[in] EventSpecificData - pointer to event-specific data - * - * @returns 1 on success, otherwise 0. - */ -int JITAPI iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -/** @endcond */ - -/** @} jitapi group */ - -#endif /* __JITPROFILING_H__ */ diff --git a/external/vtune/linux/sdk/src/ittnotify/Makefile b/external/vtune/linux/sdk/src/ittnotify/Makefile index ce1432d0a..bc30cf44c 100644 --- a/external/vtune/linux/sdk/src/ittnotify/Makefile +++ b/external/vtune/linux/sdk/src/ittnotify/Makefile @@ -1,4 +1,4 @@ -OBJ := ittnotify_static.o jitprofiling.o +OBJ := ittnotify_static.o LIBNAME := libittnotify.a diff --git a/external/vtune/linux/sdk/src/ittnotify/jitprofiling.c b/external/vtune/linux/sdk/src/ittnotify/jitprofiling.c deleted file mode 100644 index 7993af39f..000000000 --- a/external/vtune/linux/sdk/src/ittnotify/jitprofiling.c +++ /dev/null @@ -1,315 +0,0 @@ -/* - This file is provided under a dual BSD/GPLv2 license. When using or - redistributing this file, you may do so under either license. - - GPL LICENSE SUMMARY - - Copyright (c) 2005-2014 Intel Corporation. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public License as - published by the Free Software Foundation. - - This program 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - The full GNU General Public License is included in this distribution - in the file called LICENSE.GPL. - - Contact Information: - http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ - - BSD LICENSE - - Copyright (c) 2005-2014 Intel Corporation. All rights reserved. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "ittnotify_config.h" - -#if ITT_PLATFORM==ITT_PLATFORM_WIN -#include -#pragma optimize("", off) -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ -#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD -#include -#endif -#include - -#include "jitprofiling.h" - -static const char rcsid[] = "\n@(#) $Revision: 398909 $\n"; - -#define DLL_ENVIRONMENT_VAR "VS_PROFILER" - -#ifndef NEW_DLL_ENVIRONMENT_VAR -#if ITT_ARCH==ITT_ARCH_IA32 -#define NEW_DLL_ENVIRONMENT_VAR "INTEL_JIT_PROFILER32" -#else -#define NEW_DLL_ENVIRONMENT_VAR "INTEL_JIT_PROFILER64" -#endif -#endif /* NEW_DLL_ENVIRONMENT_VAR */ - -#if ITT_PLATFORM==ITT_PLATFORM_WIN -#define DEFAULT_DLLNAME "JitPI.dll" -HINSTANCE m_libHandle = NULL; -#elif ITT_PLATFORM==ITT_PLATFORM_MAC -#define DEFAULT_DLLNAME "libJitPI.dylib" -void* m_libHandle = NULL; -#else -#define DEFAULT_DLLNAME "libJitPI.so" -void* m_libHandle = NULL; -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - -/* default location of JIT profiling agent on Android */ -#define ANDROID_JIT_AGENT_PATH "/data/intel/libittnotify.so" - -/* the function pointers */ -typedef unsigned int(*TPInitialize)(void); -static TPInitialize FUNC_Initialize=NULL; - -typedef unsigned int(*TPNotify)(unsigned int, void*); -static TPNotify FUNC_NotifyEvent=NULL; - -static iJIT_IsProfilingActiveFlags executionMode = iJIT_NOTHING_RUNNING; - -/* end collector dll part. */ - -/* loadiJIT_Funcs() : this function is called just in the beginning - * and is responsible to load the functions from BistroJavaCollector.dll - * result: - * on success: the functions loads, iJIT_DLL_is_missing=0, return value = 1 - * on failure: the functions are NULL, iJIT_DLL_is_missing=1, return value = 0 - */ -static int loadiJIT_Funcs(void); - -/* global representing whether the collector can't be loaded */ -static int iJIT_DLL_is_missing = 0; - -ITT_EXTERN_C int JITAPI -iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void *EventSpecificData) -{ - int ReturnValue; - - /* initialization part - the collector has not been loaded yet. */ - if (!FUNC_NotifyEvent) - { - if (iJIT_DLL_is_missing) - return 0; - - if (!loadiJIT_Funcs()) - return 0; - } - - if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED || - event_type == iJVM_EVENT_TYPE_METHOD_UPDATE) - { - if (((piJIT_Method_Load)EventSpecificData)->method_id == 0) - return 0; - } - else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2) - { - if (((piJIT_Method_Load_V2)EventSpecificData)->method_id == 0) - return 0; - } - else if (event_type == iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V3) - { - if (((piJIT_Method_Load_V3)EventSpecificData)->method_id == 0) - return 0; - } - else if (event_type == iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED) - { - if (((piJIT_Method_Inline_Load)EventSpecificData)->method_id == 0 || - ((piJIT_Method_Inline_Load)EventSpecificData)->parent_method_id == 0) - return 0; - } - - ReturnValue = (int)FUNC_NotifyEvent(event_type, EventSpecificData); - - return ReturnValue; -} - -ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive() -{ - if (!iJIT_DLL_is_missing) - { - loadiJIT_Funcs(); - } - - return executionMode; -} - -/* This function loads the collector dll and the relevant functions. - * on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1 - * on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0 - */ -static int loadiJIT_Funcs() -{ - static int bDllWasLoaded = 0; - char *dllName = (char*)rcsid; /* !! Just to avoid unused code elimination */ -#if ITT_PLATFORM==ITT_PLATFORM_WIN - DWORD dNameLength = 0; -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - - if(bDllWasLoaded) - { - /* dll was already loaded, no need to do it for the second time */ - return 1; - } - - /* Assumes that the DLL will not be found */ - iJIT_DLL_is_missing = 1; - FUNC_NotifyEvent = NULL; - - if (m_libHandle) - { -#if ITT_PLATFORM==ITT_PLATFORM_WIN - FreeLibrary(m_libHandle); -#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - dlclose(m_libHandle); -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - m_libHandle = NULL; - } - - /* Try to get the dll name from the environment */ -#if ITT_PLATFORM==ITT_PLATFORM_WIN - dNameLength = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR, NULL, 0); - if (dNameLength) - { - DWORD envret = 0; - dllName = (char*)malloc(sizeof(char) * (dNameLength + 1)); - if(dllName != NULL) - { - envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR, - dllName, dNameLength); - if (envret) - { - /* Try to load the dll from the PATH... */ - m_libHandle = LoadLibraryExA(dllName, - NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - } - free(dllName); - } - } else { - /* Try to use old VS_PROFILER variable */ - dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0); - if (dNameLength) - { - DWORD envret = 0; - dllName = (char*)malloc(sizeof(char) * (dNameLength + 1)); - if(dllName != NULL) - { - envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, - dllName, dNameLength); - if (envret) - { - /* Try to load the dll from the PATH... */ - m_libHandle = LoadLibraryA(dllName); - } - free(dllName); - } - } - } -#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - dllName = getenv(NEW_DLL_ENVIRONMENT_VAR); - if (!dllName) - dllName = getenv(DLL_ENVIRONMENT_VAR); -#if defined(__ANDROID__) || defined(ANDROID) - if (!dllName) - dllName = ANDROID_JIT_AGENT_PATH; -#endif - if (dllName) - { - /* Try to load the dll from the PATH... */ - m_libHandle = dlopen(dllName, RTLD_LAZY); - } -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - - if (!m_libHandle) - { -#if ITT_PLATFORM==ITT_PLATFORM_WIN - m_libHandle = LoadLibraryA(DEFAULT_DLLNAME); -#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY); -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - } - - /* if the dll wasn't loaded - exit. */ - if (!m_libHandle) - { - iJIT_DLL_is_missing = 1; /* don't try to initialize - * JIT agent the second time - */ - return 0; - } - -#if ITT_PLATFORM==ITT_PLATFORM_WIN - FUNC_NotifyEvent = (TPNotify)GetProcAddress(m_libHandle, "NotifyEvent"); -#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - FUNC_NotifyEvent = (TPNotify)dlsym(m_libHandle, "NotifyEvent"); -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - if (!FUNC_NotifyEvent) - { - FUNC_Initialize = NULL; - return 0; - } - -#if ITT_PLATFORM==ITT_PLATFORM_WIN - FUNC_Initialize = (TPInitialize)GetProcAddress(m_libHandle, "Initialize"); -#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - FUNC_Initialize = (TPInitialize)dlsym(m_libHandle, "Initialize"); -#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ - if (!FUNC_Initialize) - { - FUNC_NotifyEvent = NULL; - return 0; - } - - executionMode = (iJIT_IsProfilingActiveFlags)FUNC_Initialize(); - - bDllWasLoaded = 1; - iJIT_DLL_is_missing = 0; /* DLL is ok. */ - - return 1; -} - -ITT_EXTERN_C unsigned int JITAPI iJIT_GetNewMethodID() -{ - static unsigned int methodID = 1; - - if (methodID == 0) - return 0; /* ERROR : this is not a valid value */ - - return methodID++; -} diff --git a/linux/installer/common/sdk/BOMs/sdk_base.txt b/linux/installer/common/sdk/BOMs/sdk_base.txt index 068339596..3c178f318 100644 --- a/linux/installer/common/sdk/BOMs/sdk_base.txt +++ b/linux/installer/common/sdk/BOMs/sdk_base.txt @@ -41,6 +41,7 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /common/inc/sgx_secure_align.h /package/include/./sgx_secure_align.h 0 main STP /common/inc/sgx_secure_align_api.h /package/include/./sgx_secure_align_api.h 0 main STP /common/inc/sgx_rsrv_mem_mngr.h /package/include/sgx_rsrv_mem_mngr.h 0 main STP +/common/inc/sgx_trts_aex.h /package/include/sgx_trts_aex.h 0 main STP /common/inc/stdc++/exception /package/include/stdc++/exception 0 main STP /common/inc/stdc++/linux/exception /package/include/stdc++/linux/exception 0 main STP /common/inc/stdc++/linux/typeinfo /package/include/stdc++/linux/typeinfo 0 main STP @@ -396,6 +397,26 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /SampleCode/ProtobufSGXDemo/Enclave/Enclave.lds /package/SampleCode/ProtobufSGXDemo/Enclave/Enclave.lds 0 N/A N/A /SampleCode/ProtobufSGXDemo/Enclave/person.proto /package/SampleCode/ProtobufSGXDemo/Enclave/person.proto 0 N/A N/A /SampleCode/ProtobufSGXDemo/Makefile /package/SampleCode/ProtobufSGXDemo/Makefile 0 N/A N/A +/SampleCode/SampleMbedCrypto/App/App.cpp /package/SampleCode/SampleMbedCrypto/App/App.cpp 0 N/A N/A +/SampleCode/SampleMbedCrypto/App/App.h /package/SampleCode/SampleMbedCrypto/App/App.h 0 N/A N/A +/SampleCode/SampleMbedCrypto/Makefile /package/SampleCode/SampleMbedCrypto/Makefile 0 N/A N/A +/SampleCode/SampleMbedCrypto/Enclave/Enclave.cpp /package/SampleCode/SampleMbedCrypto/Enclave/Enclave.cpp 0 N/A N/A +/SampleCode/SampleMbedCrypto/Enclave/Enclave.lds /package/SampleCode/SampleMbedCrypto/Enclave/Enclave.lds 0 N/A N/A +/SampleCode/SampleMbedCrypto/Enclave/Enclave_debug.lds /package/SampleCode/SampleMbedCrypto/Enclave/Enclave_debug.lds 0 N/A N/A +/SampleCode/SampleMbedCrypto/Enclave/Enclave.h /package/SampleCode/SampleMbedCrypto/Enclave/Enclave.h 0 N/A N/A +/SampleCode/SampleMbedCrypto/Enclave/Enclave.edl /package/SampleCode/SampleMbedCrypto/Enclave/Enclave.edl 0 N/A N/A +/SampleCode/SampleMbedCrypto/Enclave/Enclave.config.xml /package/SampleCode/SampleMbedCrypto/Enclave/Enclave.config.xml 0 N/A N/A +/SampleCode/SampleMbedCrypto/README.txt /package/SampleCode/SampleMbedCrypto/README.txt 0 N/A N/A +/SampleCode/SampleAEXNotify/Enclave/Enclave.config.xml /package/SampleCode/SampleAEXNotify/Enclave/Enclave.config.xml 0 N/A N/A +/SampleCode/SampleAEXNotify/Enclave/Enclave.cpp /package/SampleCode/SampleAEXNotify/Enclave/Enclave.cpp 0 N/A N/A +/SampleCode/SampleAEXNotify/Enclave/Enclave.edl /package/SampleCode/SampleAEXNotify/Enclave/Enclave.edl 0 N/A N/A +/SampleCode/SampleAEXNotify/Enclave/Enclave.h /package/SampleCode/SampleAEXNotify/Enclave/Enclave.h 0 N/A N/A +/SampleCode/SampleAEXNotify/Enclave/Enclave.lds /package/SampleCode/SampleAEXNotify/Enclave/Enclave.lds 0 N/A N/A +/SampleCode/SampleAEXNotify/Include/powers_of_two.h /package/SampleCode/SampleAEXNotify/Include/powers_of_two.h 0 N/A N/A +/SampleCode/SampleAEXNotify/App/App.h /package/SampleCode/SampleAEXNotify/App/App.h 0 N/A N/A +/SampleCode/SampleAEXNotify/App/App.cpp /package/SampleCode/SampleAEXNotify/App/App.cpp 0 N/A N/A +/SampleCode/SampleAEXNotify/Makefile /package/SampleCode/SampleAEXNotify/Makefile 0 N/A N/A +/SampleCode/SampleAEXNotify/README.txt /package/SampleCode/SampleAEXNotify/README.txt 0 N/A N/A /build/linux/gdb-sgx-plugin/sgx-gdb /package/bin/sgx-gdb 0 main STP /sdk/sample_libcrypto/sample_libcrypto.h /package/SampleCode/RemoteAttestation/sample_libcrypto/sample_libcrypto.h 0 main STP /sdk/tlibcxx/include/CMakeLists.txt /package/include/libcxx/CMakeLists.txt 0 main STP @@ -666,4 +687,28 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /external/protobuf/protobuf_code/src/google/protobuf/struct.proto /package/include/tprotobuf/google/protobuf/struct.proto 0 main STP /external/protobuf/protobuf_code/src/google/protobuf/type.proto /package/include/tprotobuf/google/protobuf/type.proto 0 main STP /external/protobuf/protobuf_code/src/google/protobuf/wrappers.proto /package/include/tprotobuf/google/protobuf/wrappers.proto 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/aes.h /package/include/mbedtls/aes.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/bignum.h /package/include/mbedtls/bignum.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/build_info.h /package/include/mbedtls/build_info.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/check_config.h /package/include/mbedtls/check_config.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/cipher.h /package/include/mbedtls/cipher.h 0 main STP + +/external/mbedtls/mbedtls_code/include/mbedtls/config_psa.h /package/include/mbedtls/config_psa.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/ctr_drbg.h /package/include/mbedtls/ctr_drbg.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/ecdsa.h /package/include/mbedtls/ecdsa.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/ecp.h /package/include/mbedtls/ecp.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/entropy.h /package/include/mbedtls/entropy.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/mbedtls_config.h /package/include/mbedtls/mbedtls_config.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/md.h /package/include/mbedtls/md.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/platform_util.h /package/include/mbedtls/platform_util.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/private_access.h /package/include/mbedtls/private_access.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/sha1.h /package/include/mbedtls/sha1.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/sha256.h /package/include/mbedtls/sha256.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/sha512.h /package/include/mbedtls/sha512.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/threading.h /package/include/mbedtls/threading.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/platform.h /package/include/mbedtls/platform.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/ecdh.h /package/include/mbedtls/ecdh.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/cmac.h /package/include/mbedtls/cmac.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/rsa.h /package/include/mbedtls/rsa.h 0 main STP +/external/mbedtls/mbedtls_code/include/mbedtls/gcm.h /package/include/mbedtls/gcm.h 0 main STP /common/buildenv.mk /package/buildenv.mk 0 main STP diff --git a/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_cf.txt b/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_cf.txt index 79f772b50..d494deba9 100644 --- a/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_cf.txt +++ b/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_cf.txt @@ -15,4 +15,5 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /build/linuxCF/libsgx_ttls.a /package/lib64/cve_2020_0551_cf/libsgx_ttls.a 0 main STP /build/linuxCF/libtdx_tls.a /package/lib64/cve_2020_0551_cf/libtdx_tls.a 0 main STP /build/linuxCF/libsgx_utls.a /package/lib64/cve_2020_0551_cf/libsgx_utls.a 0 main STP +/build/linuxCF/libsgx_mbedcrypto.a /package/lib64/cve_2020_0551_cf/libsgx_mbedcrypto.a 0 main STP /external/dcap_source/QuoteGeneration/build/linuxCF/libsgx_dcap_tvl.a /package/lib64/cve_2020_0551_cf/libsgx_dcap_tvl.a 0 main STP diff --git a/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_load.txt b/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_load.txt index 978202bf4..53c9cfc61 100644 --- a/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_load.txt +++ b/linux/installer/common/sdk/BOMs/sdk_cve_2020_0551_load.txt @@ -15,4 +15,5 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /build/linuxLOAD/libsgx_ttls.a /package/lib64/cve_2020_0551_load/libsgx_ttls.a 0 main STP /build/linuxLOAD/libtdx_tls.a /package/lib64/cve_2020_0551_load/libtdx_tls.a 0 main STP /build/linuxLOAD/libsgx_utls.a /package/lib64/cve_2020_0551_load/libsgx_utls.a 0 main STP +/build/linuxLOAD/libsgx_mbedcrypto.a /package/lib64/cve_2020_0551_load/libsgx_mbedcrypto.a 0 main STP /external/dcap_source/QuoteGeneration/build/linuxLOAD/libsgx_dcap_tvl.a /package/lib64/cve_2020_0551_load/libsgx_dcap_tvl.a 0 main STP diff --git a/linux/installer/common/sdk/BOMs/sdk_x64.txt b/linux/installer/common/sdk/BOMs/sdk_x64.txt index a59ae24b8..629492c18 100644 --- a/linux/installer/common/sdk/BOMs/sdk_x64.txt +++ b/linux/installer/common/sdk/BOMs/sdk_x64.txt @@ -46,6 +46,7 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /build/linux/libsgx_ttls.a /package/lib64/libsgx_ttls.a 0 main STP /build/linux/libtdx_tls.a /package/lib64/libtdx_tls.a 0 main STP /build/linux/libsgx_utls.a /package/lib64/libsgx_utls.a 0 main STP +/build/linux/libsgx_mbedcrypto.a /package/lib64/libsgx_mbedcrypto.a 0 main STP /external/dcap_source/QuoteGeneration/build/linux/libsgx_dcap_tvl.a /package/lib64/libsgx_dcap_tvl.a 0 main STP /linux/installer/common/sdk/installConfig.x64 /scripts/installConfig 0 main STP /linux/installer/common/sdk/pkgconfig/x64/libsgx_uae_service_sim.pc /package/pkgconfig/libsgx_uae_service_sim.pc 0 main STP diff --git a/linux/installer/common/sgx-aesm-service/Makefile b/linux/installer/common/sgx-aesm-service/Makefile index 384ec9f55..6edfb31c4 100644 --- a/linux/installer/common/sgx-aesm-service/Makefile +++ b/linux/installer/common/sgx-aesm-service/Makefile @@ -42,7 +42,7 @@ AESMD_CONF_DEL=$(if $(wildcard /run/systemd/system/.*),aesmd.conf,$(if $(wildcar AESMD_CONF_PATH=$(if $(wildcard /run/systemd/system/.*),$(if $(wildcard /lib/systemd/system/.*),/lib/systemd/system,/usr/lib/systemd/system),$(if $(wildcard /etc/init/.*),/etc/init/)) ifeq ($(AESMD_CONF_NAME),) -ifneq ($(shell awk -F/ '$$2 == "docker"' /proc/self/cgroup),) +ifeq ($(BUILD_PLATFORM),docker) AESMD_CONF_NAME=aesmd.service AESMD_CONF_DEL=aesmd.conf AESMD_CONF_PATH=/lib/systemd/system diff --git a/linux/installer/deb/local_repo_tool/conf/distributions b/linux/installer/deb/local_repo_tool/conf/distributions index ace56a940..df10f428a 100644 --- a/linux/installer/deb/local_repo_tool/conf/distributions +++ b/linux/installer/deb/local_repo_tool/conf/distributions @@ -38,6 +38,14 @@ Components: main Description: ubuntu/jammy repository for SGX PSW DebIndices: Packages . +Origin: Intel Corporation +Label: Intel Corporation +Codename: lunar +Architectures: amd64 +Components: main +Description: ubuntu/lunar repository for SGX PSW +DebIndices: Packages . + Origin: Intel Corporation Label: Intel Corporation Codename: buster @@ -45,3 +53,11 @@ Architectures: amd64 Components: main Description: debian/buster repository for SGX PSW DebIndices: Packages . + +Origin: Intel Corporation +Label: Intel Corporation +Codename: bullseye +Architectures: amd64 +Components: main +Description: debian/bullseye repository for SGX PSW +DebIndices: Packages . diff --git a/linux/installer/deb/sgx-aesm-service/sgx-aesm-service-1.0/debian/control b/linux/installer/deb/sgx-aesm-service/sgx-aesm-service-1.0/debian/control index 3d4d83136..b50c23347 100644 --- a/linux/installer/deb/sgx-aesm-service/sgx-aesm-service-1.0/debian/control +++ b/linux/installer/deb/sgx-aesm-service/sgx-aesm-service-1.0/debian/control @@ -37,12 +37,12 @@ Description: Unified Quote Plugin for Intel(R) Software Guard Extensions AESM Se Package: libsgx-aesm-ecdsa-plugin Architecture: amd64 -Depends: ${shlibs:Depends}, ${misc:Depends}, sgx-aesm-service(>= @dep_version@), libsgx-qe3-logic(>= 1.16), libsgx-aesm-pce-plugin(>= @dep_version@) +Depends: ${shlibs:Depends}, ${misc:Depends}, sgx-aesm-service(>= @dep_version@), libsgx-qe3-logic(>= 1.17), libsgx-aesm-pce-plugin(>= @dep_version@) Description: ECDSA Quote Plugin for Intel(R) Software Guard Extensions AESM Service Package: libsgx-aesm-pce-plugin Architecture: amd64 -Depends: ${shlibs:Depends}, ${misc:Depends}, sgx-aesm-service(>= @dep_version@), libsgx-pce-logic(>= 1.16), libsgx-ae-pce(>= @dep_version@) +Depends: ${shlibs:Depends}, ${misc:Depends}, sgx-aesm-service(>= @dep_version@), libsgx-pce-logic(>= 1.17), libsgx-ae-pce(>= @dep_version@) Description: PCE Plugin for Intel(R) Software Guard Extensions AESM Service Package: libsgx-ae-pce diff --git a/linux/installer/rpm/psw-dcap/sanitize.sh b/linux/installer/rpm/psw-dcap/sanitize.sh index 7ab53df3f..5c4b9d5ad 100755 --- a/linux/installer/rpm/psw-dcap/sanitize.sh +++ b/linux/installer/rpm/psw-dcap/sanitize.sh @@ -47,7 +47,11 @@ make -C ${root_dir} preparation # Prepare ipp-crypto source pushd ${root_dir}/external/ippcp_internal/ -cd ipp-crypto && git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch >/dev/null 2>&1 || git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch --check -R +# cd ipp-crypto && git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch >/dev/null 2>&1 || git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch --check -R +# TODO - Need to remove below lines and enable the above content when opensource +rm -rf ipp-crypto +git clone -b ippcp_2021.7 https://github.com/intel/ipp-crypto.git --depth 1 ipp-crypto +cd ipp-crypto && git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch popd diff --git a/linux/installer/rpm/psw-tdx/sanitize.sh b/linux/installer/rpm/psw-tdx/sanitize.sh index 83aeec190..ae47225f6 100755 --- a/linux/installer/rpm/psw-tdx/sanitize.sh +++ b/linux/installer/rpm/psw-tdx/sanitize.sh @@ -47,7 +47,11 @@ make -C ${root_dir} preparation # Prepare ipp-crypto source pushd ${root_dir}/external/ippcp_internal/ -cd ipp-crypto && git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch >/dev/null 2>&1 || git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch --check -R +# cd ipp-crypto && git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch >/dev/null 2>&1 || git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch --check -R +# TODO - Need to remove below lines and enable the above content when opensource +rm -rf ipp-crypto +git clone -b ippcp_2021.7 https://github.com/intel/ipp-crypto.git --depth 1 ipp-crypto +cd ipp-crypto && git apply ../0001-IPP-crypto-for-SGX_psw_dcap.patch popd diff --git a/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-ecdsa-plugin.spec b/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-ecdsa-plugin.spec index 202f73e8d..76919833b 100644 --- a/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-ecdsa-plugin.spec +++ b/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-ecdsa-plugin.spec @@ -38,7 +38,7 @@ Version: @version@ Release: 1%{?dist} Summary: ECDSA Quote Plugin for Intel(R) Software Guard Extensions AESM Service Group: Development/System -Requires: sgx-aesm-service >= %{version}-%{release} libsgx-qe3-logic >= 1.16 libsgx-aesm-pce-plugin >= %{version}-%{release} +Requires: sgx-aesm-service >= %{version}-%{release} libsgx-qe3-logic >= 1.17 libsgx-aesm-pce-plugin >= %{version}-%{release} License: BSD License URL: https://github.com/intel/linux-sgx diff --git a/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-pce-plugin.spec b/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-pce-plugin.spec index 22490064a..87e832fa1 100644 --- a/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-pce-plugin.spec +++ b/linux/installer/rpm/sgx-aesm-service/libsgx-aesm-pce-plugin.spec @@ -38,7 +38,7 @@ Version: @version@ Release: 1%{?dist} Summary: PCE Plugin for Intel(R) Software Guard Extensions AESM Service Group: Development/System -Requires: sgx-aesm-service >= %{version}-%{release} libsgx-pce-logic >= 1.16 +Requires: sgx-aesm-service >= %{version}-%{release} libsgx-pce-logic >= 1.17 License: BSD License URL: https://github.com/intel/linux-sgx diff --git a/linux/reproducibility/Dockerfile b/linux/reproducibility/Dockerfile index 99c554dfa..c7ae0f6d9 100644 --- a/linux/reproducibility/Dockerfile +++ b/linux/reproducibility/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:20.04 RUN apt-get update \ - && apt-get install -y curl python perl git \ + && apt-get install -y curl python-is-python3 perl git \ && mkdir -p /nix /etc/nix \ && chmod a+rwx /nix \ && echo 'sandbox = false' > /etc/nix/nix.conf \ diff --git a/linux/reproducibility/build_and_launch_docker.sh b/linux/reproducibility/build_and_launch_docker.sh old mode 100755 new mode 100644 index 816ab0fef..b3986e028 --- a/linux/reproducibility/build_and_launch_docker.sh +++ b/linux/reproducibility/build_and_launch_docker.sh @@ -75,8 +75,8 @@ mount_dir="/linux-sgx" sdk_installer="" sgx_src="" -default_sdk_installer=sgx_linux_x64_sdk_reproducible_2.19.100.1.bin -default_sdk_installer_url=https://download.01.org/intel-sgx/sgx-linux/2.19/distro/nix_reproducibility/$default_sdk_installer +default_sdk_installer=sgx_linux_x64_sdk_reproducible_2.20.100.1.bin +default_sdk_installer_url=https://download.01.org/intel-sgx/sgx-linux/2.20/distro/nix_reproducibility/$default_sdk_installer usage() @@ -177,7 +177,7 @@ prepare_sgx_src() if [ "$sgx_src" != "" ]; then mkdir -p "$sgx_repo" && cp -a "$sgx_src/." "$sgx_repo" else - git clone -b sgx_2.19_reproducible https://github.com/intel/linux-sgx.git $sgx_repo + git clone -b sgx_2.20_reproducible https://github.com/intel/linux-sgx.git $sgx_repo fi cd "$sgx_repo" && make preparation diff --git a/psw/ae/Makefile b/psw/ae/Makefile index bf1bffffb..a810d6b92 100644 --- a/psw/ae/Makefile +++ b/psw/ae/Makefile @@ -87,10 +87,10 @@ cmake_check_fail: @echo or @echo yum install cmake @echo with root account - @exit 2 + @exit 3 .PHONY: prebuilt_check_fail prebuilt_check_fail: @echo "ERROR: Please run 'download_prebuilt.sh' to download the prebuilt AEs before compiling." @echo "Exiting......" - @exit -2 + @exit 3 diff --git a/psw/ae/aesm_service/source/qcnl/CMakeLists.txt b/psw/ae/aesm_service/source/qcnl/CMakeLists.txt index f4c59a2af..c8e9509f8 100644 --- a/psw/ae/aesm_service/source/qcnl/CMakeLists.txt +++ b/psw/ae/aesm_service/source/qcnl/CMakeLists.txt @@ -41,6 +41,7 @@ add_library(sgx_default_qcnl_wrapper SHARED ${_srcs}) link_directories( ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/prebuilt/openssl/lib/linux64 + ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/tools/PCKCertSelection/static_out ) target_include_directories(sgx_default_qcnl_wrapper PRIVATE @@ -51,14 +52,24 @@ target_include_directories(sgx_default_qcnl_wrapper PRIVATE ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/QuoteGeneration/common/inc/internal ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/QuoteVerification/QVL/Src/ThirdParty/rapidjson/include/rapidjson ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/prebuilt/openssl/inc + ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/tools/PCKCertSelection/include ) +add_custom_target(PCKCertSelectionLib + COMMAND make -f ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/tools/PCKCertSelection/PCKCertSelectionLib/Makefile.static_lib + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/tools/PCKCertSelection/PCKCertSelectionLib +) + +add_library(PCKCertSelectionStaticLib STATIC IMPORTED ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/tools/PCKCertSelection/static_out/libPCKCertSelection.a) +set_target_properties(PCKCertSelectionStaticLib PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/tools/PCKCertSelection/static_out/libPCKCertSelection.a) +add_dependencies(PCKCertSelectionStaticLib PCKCertSelectionLib) + set_property(TARGET sgx_default_qcnl_wrapper APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-z,defs") set_property(TARGET sgx_default_qcnl_wrapper APPEND_STRING PROPERTY LINK_DEPENDS ${PROJECT_SOURCE_DIR}/../../../../external/dcap_source/QuoteGeneration/qcnl/linux/sgx_default_qcnl.lds ) target_link_libraries(sgx_default_qcnl_wrapper - ${CURL_LIBRARIES} crypto + ${CURL_LIBRARIES} crypto PCKCertSelectionStaticLib ) diff --git a/psw/ae/ref_le/ref_le.md b/psw/ae/ref_le/ref_le.md index 73e317cf6..125444f6d 100644 --- a/psw/ae/ref_le/ref_le.md +++ b/psw/ae/ref_le/ref_le.md @@ -1,5 +1,7 @@ # Intel(R) SGX Reference Launch Enclave +**NOTE**: The reference LE is only workable with [linux-sgx-driver](https://github.com/intel/linux-sgx-driver) and is planned to be deprecated starting from Intel(R) SGX release 2.20. + ## Introduction A Launch Enclave (LE) is a special type of enclave, generates a Launch Token for other enclave to be initialized. The generated Launch Token is used by the Platform Software as part of the data passed to the driver on EINIT flow. The Launch Enclave role is divided to two parts: diff --git a/psw/ae/ref_le/ref_wl_gen/ref_wl.cpp b/psw/ae/ref_le/ref_wl_gen/ref_wl.cpp index bd08e848f..26896e4d5 100644 --- a/psw/ae/ref_le/ref_wl_gen/ref_wl.cpp +++ b/psw/ae/ref_le/ref_wl_gen/ref_wl.cpp @@ -29,10 +29,19 @@ * */ +#pragma weak ippcpInit #include "ref_wl_gen.h" +#include "ippcp.h" + + int main(int argc, char* argv[]) { + if (ippcpInit != NULL) + { + ippcpInit(); + } + CRefWLGen ref_le_gen; if (ref_le_gen.run(argc, argv) == false) return -1; diff --git a/psw/enclave_common/sgx_enclave_common.cpp b/psw/enclave_common/sgx_enclave_common.cpp index 9662a2779..fa351dd5b 100644 --- a/psw/enclave_common/sgx_enclave_common.cpp +++ b/psw/enclave_common/sgx_enclave_common.cpp @@ -77,6 +77,7 @@ static int s_driver_type = SGX_DRIVER_UNKNOWN; //driver which is opened static se_file_handle_t s_hdevice = -1; //used for driver_type of SGX_DRIVER_OUT_OF_TREE or SGX_DRIVER_DCAP static std::map s_hfile; //enclave file handles for driver_type of SGX_DRIVER_IN_KERNEL +static std::vector s_enclave_base_address; static std::map s_enclave_size; static std::map s_enclave_init; static std::map s_secs_attr; @@ -137,24 +138,17 @@ static void close_device(void) s_driver_type = SGX_DRIVER_UNKNOWN; //this may not be needed - can it change on the platform? } -static int get_file_handle_from_address(void* target_address) +static int get_file_handle_from_base_address(void* base_address) { int hfile = -1; //find the enclave file handle from the target address LockGuard lock(&s_enclave_mutex); - for (auto rec : s_enclave_size) { - if ((uint64_t)target_address >= (uint64_t)rec.first && (uint64_t)target_address < (uint64_t)rec.first + (uint64_t)rec.second) - { - if (s_hfile.count(rec.first) == 1) - { - hfile = s_hfile[rec.first]; - } - break; - } + if(s_hfile.count(base_address) != 0) + { + hfile = s_hfile[base_address]; } - - return hfile; + return hfile; } static void* get_enclave_base_address_from_address(void* target_address) @@ -163,15 +157,35 @@ static void* get_enclave_base_address_from_address(void* target_address) //find the enclave file handle from the target address LockGuard lock(&s_enclave_mutex); - for (auto rec : s_enclave_size) { - if ((uint64_t)target_address >= (uint64_t)rec.first && (uint64_t)target_address < (uint64_t)rec.first + (uint64_t)rec.second) - { - base_addr = rec.first; - break; - } + if(s_enclave_base_address.empty()) + { + return base_addr; } - - return base_addr; + auto upper = std::upper_bound(s_enclave_base_address.begin(), s_enclave_base_address.end(), (uint64_t)target_address); + if(upper == s_enclave_base_address.begin()) + { + return base_addr; + } + else if (upper == s_enclave_base_address.end()) + { + base_addr = (void*)s_enclave_base_address.back(); + } + else + { + auto index = upper - s_enclave_base_address.begin(); + base_addr = (void*)s_enclave_base_address[index - 1]; + } + if(s_enclave_size.count(base_addr) == 0) + { + return NULL; + } + //validate the target_address is within the enclave range + if((uint64_t)target_address < (uint64_t)base_addr || + ((uint64_t)target_address >= ((uint64_t)base_addr + s_enclave_size[base_addr]))) + { + return NULL; + } + return base_addr; } @@ -772,6 +786,8 @@ extern "C" void* COMM_API enclave_create_ex( s_hfile[enclave_base] = hdevice_temp; } s_enclave_size[enclave_base] = virtual_size; + s_enclave_base_address.push_back((uint64_t)enclave_base); + std::sort(s_enclave_base_address.begin(), s_enclave_base_address.end()); sgx_attributes_t secs_attr; memset(&secs_attr, 0, sizeof(sgx_attributes_t)); @@ -817,9 +833,8 @@ extern "C" void* COMM_API enclave_create( return enclave_create_ex(base_address, virtual_size, initial_commit, type, info, info_size, 0 , NULL, enclave_error); } -static bool enclave_do_mprotect_region(void* target_address, size_t target_size, int prot, uint32_t* enclave_error) +static bool enclave_do_mprotect_region(int hfile, void* target_address, size_t target_size, int prot, uint32_t* enclave_error) { - int hfile = -1; // find the enclave base void* enclave_base = get_enclave_base_address_from_address(target_address); if (enclave_base == NULL) { @@ -828,11 +843,6 @@ static bool enclave_do_mprotect_region(void* target_address, size_t target_size, return false; } - if (s_driver_type == SGX_DRIVER_IN_KERNEL) - { - hfile = get_file_handle_from_address(target_address); - } - auto enclave_mem_region = &s_enclave_mem_region[enclave_base]; //if target_size =0, means mprotect the last region if(target_size != 0) @@ -936,12 +946,8 @@ extern "C" size_t COMM_API enclave_load_data( size_t pages = target_size / SE_PAGE_SIZE; if (s_driver_type == SGX_DRIVER_IN_KERNEL) { - hfile = get_file_handle_from_address(target_address); - - //todo - may need to check EADD parameters for better error reporting since the driver - // may not do this (the driver will just take a fault on EADD) - - if (hfile == -1) + void* enclave_base_addr = get_enclave_base_address_from_address(target_address); + if (enclave_base_addr == NULL) { SE_TRACE(SE_TRACE_WARNING, "\nAdd Page FAILED - %p is not in a valid enclave \n", target_address); if (enclave_error != NULL) @@ -949,8 +955,11 @@ extern "C" size_t COMM_API enclave_load_data( return 0; } - void* enclave_base_addr = get_enclave_base_address_from_address(target_address); - if (enclave_base_addr == NULL) + hfile = get_file_handle_from_base_address(enclave_base_addr); + + //todo - may need to check EADD parameters for better error reporting since the driver + // may not do this (the driver will just take a fault on EADD) + if (hfile == -1) { SE_TRACE(SE_TRACE_WARNING, "\nAdd Page FAILED - %p is not in a valid enclave \n", target_address); if (enclave_error != NULL) @@ -1060,7 +1069,7 @@ extern "C" size_t COMM_API enclave_load_data( prot = (int)(SI_FLAGS_RW & SI_MASK_MEM_ATTRIBUTE); } - if(enclave_do_mprotect_region(target_address, target_size, prot, enclave_error) == false) + if(enclave_do_mprotect_region(hfile, target_address, target_size, prot, enclave_error) == false) { return 0; } @@ -1097,7 +1106,7 @@ extern "C" bool COMM_API enclave_initialize( int hfile = -1; if (s_driver_type == SGX_DRIVER_IN_KERNEL) { - hfile = get_file_handle_from_address(base_address); + hfile = get_file_handle_from_base_address(base_address); if (hfile == -1) { SE_TRACE(SE_TRACE_WARNING, "\nSGX_IOC_ENCLAVE_INIT failed - %p is not a valid enclave \n", base_address); @@ -1115,7 +1124,7 @@ extern "C" bool COMM_API enclave_initialize( } //mprotect the last region - if(enclave_do_mprotect_region(base_address, 0, 0, enclave_error) == false) + if(enclave_do_mprotect_region(hfile, base_address, 0, 0, enclave_error) == false) { return false; } @@ -1237,6 +1246,9 @@ extern "C" bool COMM_API enclave_delete( } enclave_size = it->second; + s_enclave_base_address.erase(std::remove(s_enclave_base_address.begin(), s_enclave_base_address.end(), (uint64_t)base_address), + s_enclave_base_address.end()); + s_enclave_size.erase(base_address); s_enclave_init.erase(base_address); s_enclave_mem_region.erase(base_address); @@ -1388,7 +1400,15 @@ uint32_t COMM_API enclave_alloc( } return ENCLAVE_ERROR_SUCCESS; } - int enclave_fd = get_file_handle_from_address(target_addr); + + void* enclave_base = get_enclave_base_address_from_address(target_addr); + if (enclave_base == NULL) + { + if (enclave_error != NULL) + *enclave_error = ENCLAVE_INVALID_ADDRESS; + return ENCLAVE_INVALID_ADDRESS; + } + int enclave_fd = get_file_handle_from_base_address(enclave_base); if (enclave_fd == -1) { if (enclave_error != NULL) @@ -1458,11 +1478,11 @@ static int emodt(int fd, void *addr, size_t length, uint64_t type) return err; } //for recoverable partial errors - length -= ioc.count; + ioc.length -= ioc.count; ioc.offset += ioc.count; ioc.result = 0; ioc.count = 0; - } while (length != 0); + } while (ioc.length != 0); return 0; } @@ -1641,8 +1661,8 @@ uint32_t COMM_API enclave_modify( function _trim = trim; function _trim_accept = trim_accept; function _mktcs = mktcs; - function _emodpr = emodpr; - int fd = get_file_handle_from_address(target_addr); + function _emodpr = emodpr; + int fd = get_file_handle_from_base_address((void*)enclave_base); if (s_driver_type == SGX_DRIVER_OUT_OF_TREE) { _trim = trim_legacy; diff --git a/psw/urts/create_param.h b/psw/urts/create_param.h index 235427e66..5e20b5db7 100644 --- a/psw/urts/create_param.h +++ b/psw/urts/create_param.h @@ -51,7 +51,7 @@ typedef struct _create_param_t uint64_t rsrv_init_size; uint64_t rsrv_offset; uint64_t rsrv_executable; - uint64_t user_region_offset; + uint64_t edmm_bk_overhead; uint64_t user_region_size; uint64_t first_ssa_gpr; uint64_t td_addr; diff --git a/psw/urts/enclave.cpp b/psw/urts/enclave.cpp index d753b03ab..820e5ffc8 100644 --- a/psw/urts/enclave.cpp +++ b/psw/urts/enclave.cpp @@ -66,6 +66,7 @@ CEnclave::CEnclave() , m_sealed_key(NULL) , m_switchless(NULL) , m_first_ecall(true) + , m_aex_notify(false) , m_dynamic_tcs_list_size(0) { memset(&m_enclave_info, 0, sizeof(debug_enclave_info_t)); @@ -273,6 +274,18 @@ void CEnclave::set_sealed_key(uint8_t *sealed_key) m_sealed_key = sealed_key; } +bool CEnclave::set_aex_notify(bool flag) +{ + m_aex_notify = flag; + return true; +} + +bool CEnclave::get_aex_notify() +{ + return m_aex_notify; +} + + sgx_status_t CEnclave::error_trts2urts(unsigned int trts_error) { if(trts_error == (unsigned int)SE_ERROR_READ_LOCK_FAIL) diff --git a/psw/urts/enclave.h b/psw/urts/enclave.h index 51578e04e..312886615 100644 --- a/psw/urts/enclave.h +++ b/psw/urts/enclave.h @@ -88,6 +88,9 @@ class CEnclave: private Uncopyable void *get_global_data_sim_ptr(); #endif CTrustThread * get_free_tcs(); + bool set_aex_notify(bool flag); + bool get_aex_notify(); + private: CTrustThread * get_tcs(int ecall_cmd); @@ -117,6 +120,7 @@ class CEnclave: private Uncopyable uint8_t *m_sealed_key; void* m_switchless; bool m_first_ecall; + bool m_aex_notify; sgx_target_info_t m_target_info; size_t m_dynamic_tcs_list_size; #ifdef SE_SIM diff --git a/psw/urts/enclave_creator_hw_com.cpp b/psw/urts/enclave_creator_hw_com.cpp index d5c9353f1..d556b0eb6 100644 --- a/psw/urts/enclave_creator_hw_com.cpp +++ b/psw/urts/enclave_creator_hw_com.cpp @@ -41,6 +41,7 @@ #include "se_memcpy.h" #include "se_detect.h" #include +#include "se_detect.h" #define EDMM_ENABLE_BIT 0x1ULL #define ARCH_REQ_XCOMP_PERM 0x1023 @@ -72,8 +73,9 @@ int EnclaveCreatorHW::initialize(sgx_enclave_id_t enclave_id) info.sealed_key = enclave->get_sealed_key(); info.cpu_core_num = (uint32_t)sysconf(_SC_NPROCESSORS_ONLN); if (is_EDMM_supported(enclave_id)) - info.system_feature_set[0] |= EDMM_ENABLE_BIT; - + info.system_feature_set[0] |= EDMM_ENABLE_BIT; + if (enclave->get_aex_notify() == true) + info.system_feature_set[0] |= (1ULL << AEXNOTIFY_BIT); int status = enclave->ecall(ECMD_INIT_ENCLAVE, NULL, reinterpret_cast(&info)); //free the tcs used by initialization; @@ -163,6 +165,13 @@ int EnclaveCreatorHW::get_misc_attr(sgx_misc_attribute_t *sgx_misc_attr, metadat return SGX_ERROR_UNEXPECTED; } } + //if the enclave requires aex notify support, need to check the platform supports edeccssa or not + if(((secs_attr->flags & SGX_FLAGS_AEX_NOTIFY) != false) && (is_edeccssa_supported() == false)) + { + SE_TRACE(SE_TRACE_WARNING, "the enclave requires AEX Notify support, but the platform doesn't support EDECCSSA.\n"); + return SGX_ERROR_UNEXPECTED; + } + // try to use maximum ablity of cpu sgx_misc_attr->misc_select = se_cap.misc_select & enclave_css->body.misc_select; diff --git a/psw/urts/linux/enter_enclave.S b/psw/urts/linux/enter_enclave.S index fc3828e11..4f09e2da2 100644 --- a/psw/urts/linux/enter_enclave.S +++ b/psw/urts/linux/enter_enclave.S @@ -160,6 +160,7 @@ EENTER_PROLOG .Lasync_exit_pointer: ENCLU + ud2 _CET_ENDBR .size __morestack, .-__morestack diff --git a/psw/urts/linux/sig_handler.cpp b/psw/urts/linux/sig_handler.cpp index 00cfd6016..509802d5d 100644 --- a/psw/urts/linux/sig_handler.cpp +++ b/psw/urts/linux/sig_handler.cpp @@ -61,6 +61,7 @@ typedef struct _ecall_param_t #define REG_XAX REG_RAX #define REG_XBX REG_RBX #define REG_XSI REG_RSI +#define REG_XDI REG_RDI #define REG_XBP REG_RBP /* * refer to enter_enclave.h @@ -75,6 +76,7 @@ typedef struct _ecall_param_t #define REG_XAX REG_EAX #define REG_XBX REG_EBX #define REG_XSI REG_ESI +#define REG_XDI REG_EDI #define REG_XBP REG_EBP /* * refer to enter_enclave.h @@ -129,25 +131,37 @@ void sig_handler(int signum, siginfo_t* siginfo, void *priv) //If exception is raised in trts again and again, the SSA will overflow, and finally it is EENTER exception. assert(reinterpret_cast(xbx) == param->tcs); CEnclave *enclave = param->trust_thread->get_enclave(); - unsigned int ret = enclave->ecall(ECMD_EXCEPT, param->ocall_table, NULL); - if(SGX_SUCCESS == ret) + if(enclave->get_aex_notify() != true) { - //ERESUME execute - return; + unsigned int ret = enclave->ecall(ECMD_EXCEPT, param->ocall_table, NULL); + if(SGX_SUCCESS == ret) + { + //ERESUME execute + return; + } + //If the exception is caused by enclave lost or internal stack overrun, then return the error code to ecall caller elegantly. + else if(SGX_ERROR_ENCLAVE_LOST == ret || SGX_ERROR_STACK_OVERRUN == ret) + { + //enter_enlcave function will return with ret which is from tRTS; + context->uc_mcontext.gregs[REG_XIP] = reinterpret_cast(get_eretp()); + context->uc_mcontext.gregs[REG_XSI] = ret; + return; + } + //If we can't fix the exception within enclave, then give the handle to other signal hanlder. + //Call the previous signal handler. The default signal handler should terminate the application. + + enclave->rdunlock(); + CEnclavePool::instance()->unref_enclave(enclave); } - //If the exception is caused by enclave lost or internal stack overrun, then return the error code to ecall caller elegantly. - else if(SGX_ERROR_ENCLAVE_LOST == ret || SGX_ERROR_STACK_OVERRUN == ret) + else { - //enter_enlcave function will return with ret which is from tRTS; - context->uc_mcontext.gregs[REG_XIP] = reinterpret_cast(get_eretp()); - context->uc_mcontext.gregs[REG_XSI] = ret; + context->uc_mcontext.gregs[REG_XAX] = SE_EENTER; + context->uc_mcontext.gregs[REG_XDI] = ECMD_EXCEPT; + // This XSI parameter is not actually used by the exception handler in trts. + //But it is just left here for completeness. + context->uc_mcontext.gregs[REG_XSI] = (size_t)(param->ocall_table); return; } - //If we can't fix the exception within enclave, then give the handle to other signal hanlder. - //Call the previous signal handler. The default signal handler should terminate the application. - - enclave->rdunlock(); - CEnclavePool::instance()->unref_enclave(enclave); } //the case of exception on EENTER instruction. else if(xip == get_eenterp() @@ -304,26 +318,41 @@ static int sgx_urts_vdso_handler(long rdi, long rsi, long rdx, long ursp, long r //need to handle exception here __u64 *user_data = (__u64*)run->user_data; CTrustThread* trust_thread = reinterpret_cast(user_data[1]); + void *ocall_table = reinterpret_cast(user_data[0]); if(trust_thread == NULL) { run->user_data = SGX_ERROR_UNEXPECTED; return 0; } - void *ocall_table = reinterpret_cast(user_data[0]); - //directly use the original tcs - unsigned int ret = do_ecall(ECMD_EXCEPT, ocall_table, NULL, trust_thread); - - if(SGX_SUCCESS == ret) + CEnclave *enclave = trust_thread->get_enclave(); + if(enclave == NULL) { - return SE_ERESUME; + run->user_data = SGX_ERROR_UNEXPECTED; + return 0; + } + if(enclave->get_aex_notify() != true) + { + //directly use the original tcs + unsigned int ret = do_ecall(ECMD_EXCEPT, ocall_table, NULL, trust_thread); + + if(SGX_SUCCESS == ret) + { + return SE_ERESUME; + } + else + { + //for vDSO handler, we have to return error code to trts + //instead of calling old signal handler if registered + run->user_data = (__u64)ret; + return 0; + } } else { - //for vDSO handler, we have to return error code to trts - //instead of calling old signal handler if registered - run->user_data = (__u64)ret; - return 0; + //if vDSO is enabled, return SE_EENTER directly + SE_TRACE(SE_TRACE_DEBUG, "AEX-NOTIFY called, exception_addr=0x%x, exception_error_code=0x%x, exception_vector=0x%x\n", run->exception_addr, run->exception_error_code, run->exception_vector); + return SE_EENTER; } } else if(run->function == SE_EEXIT) diff --git a/psw/urts/parser/update_global_data.hxx b/psw/urts/parser/update_global_data.hxx index 2889587d6..57457a1c8 100644 --- a/psw/urts/parser/update_global_data.hxx +++ b/psw/urts/parser/update_global_data.hxx @@ -97,6 +97,7 @@ namespace { thread_data->last_sp = thread_data->stack_base_addr; thread_data->xsave_size = create_param->xsave_size; thread_data->first_ssa_gpr = (sys_word_t)create_param->ssa_base_addr + metadata->ssa_frame_size * SE_PAGE_SIZE - (uint32_t)sizeof(ssa_gpr_t); + thread_data->first_ssa_xsave = (sys_word_t)create_param->ssa_base_addr; thread_data->flags = 0; // TD address relative to TCS thread_data->tls_addr = (sys_word_t)create_param->tls_addr; @@ -173,6 +174,7 @@ namespace { global_data->elrange_start_address= 0; global_data->elrange_size = global_data->enclave_size; } + global_data->edmm_bk_overhead = (sys_word_t)create_param->edmm_bk_overhead; return true; } } diff --git a/psw/urts/se_detect.cpp b/psw/urts/se_detect.cpp index 9def8d41d..4cc818ded 100644 --- a/psw/urts/se_detect.cpp +++ b/psw/urts/se_detect.cpp @@ -48,6 +48,22 @@ bool is_se_supported() return true; } +bool is_edeccssa_supported() +{ + if(false == is_se_supported()) + { + return false; + } + + int cpu_info[4] = {0, 0, 0, 0}; + __cpuidex(cpu_info, SE_LEAF, 0); + if (!(cpu_info[0] & (1<(enclave->get_debug_info()); enclave->set_extra_debug_info(const_cast(loader.get_secs()), loader); + //if enclave enables aex notify + if(loader.get_secs().attributes.flags & SGX_FLAGS_AEX_NOTIFY) + { + enclave->set_aex_notify(true); + } //add enclave to enclave pool before init_enclave because in simualtion //mode init_enclave will rely on CEnclavePool to get Enclave instance. @@ -557,6 +562,12 @@ sgx_status_t _create_enclave_from_buffer_ex(const bool debug, uint8_t *base_addr goto clean_return; } } + //AEX Notify doesn't support simulation mode + if((sgx_misc_attr.secs_attr.flags & SGX_FLAGS_AEX_NOTIFY) && (get_enclave_creator()->use_se_hw() == false)) + { + ret = SGX_ERROR_FEATURE_NOT_SUPPORTED; + goto clean_return; + } lc = new SGXLaunchToken(&metadata->enclave_css, &sgx_misc_attr.secs_attr, NULL); #ifndef SE_SIM diff --git a/sdk/Makefile b/sdk/Makefile index 4c95dd3d7..2f8e8c851 100644 --- a/sdk/Makefile +++ b/sdk/Makefile @@ -43,7 +43,7 @@ endif opt_check_failed: @echo "ERROR: Please run 'download_prebuilt.sh' to download the prebuilt optimized libraries before compiling." @echo "Exiting......" - @exit -2 + @exit 3 .PHONY: all all: $(CHECK_OPT) diff --git a/sdk/Makefile.source b/sdk/Makefile.source index 6ebb8fb33..b4636bfee 100644 --- a/sdk/Makefile.source +++ b/sdk/Makefile.source @@ -44,6 +44,7 @@ # - openmp: libsgx_omp.a # - protobuf: libsgx_protobuf.a # - ttls: libsgx_ttls.a +# - mbedtls: libsgx_mbedcrypto.a # - Untrtusted libraries # - ukey_exchange: libsgx_ukey_exchange.a # - uprotected_fs: libsgx_uprotected_fs.a @@ -66,7 +67,7 @@ LIBTCXX := $(BUILD_DIR)/libsgx_tcxx.a LIBTSE := $(BUILD_DIR)/libsgx_tservice.a .PHONY: components -components: tstdc tcxx tservice trts tcrypto tkey_exchange ukey_exchange tprotected_fs uprotected_fs ptrace sample_crypto libcapable simulation signtool edger8r tcmalloc sgx_pcl sgx_encrypt sgx_tswitchless sgx_uswitchless pthread openmp protobuf ttls utls +components: tstdc tcxx tservice trts tcrypto tkey_exchange ukey_exchange tprotected_fs uprotected_fs ptrace sample_crypto libcapable simulation signtool edger8r tcmalloc sgx_pcl sgx_encrypt sgx_tswitchless sgx_uswitchless pthread openmp protobuf ttls utls mbedtls # --------------------------------------------------- # tstdc @@ -216,6 +217,10 @@ endif ttls: edger8r $(MAKE) -C ttls +.PHONY: mbedtls +mbedtls: + $(MAKE) -C $(LINUX_EXTERNAL_DIR)/mbedtls + # --------------------------------------------------- # Untrusted libraries # --------------------------------------------------- @@ -316,5 +321,6 @@ clean: $(MAKE) -C $(LINUX_EXTERNAL_DIR)/protobuf clean $(MAKE) -C ttls clean $(MAKE) -C utls clean + $(MAKE) -C $(LINUX_EXTERNAL_DIR)/mbedtls clean @$(RM) $(LIBTLIBC) $(LIBTCXX) $(LIBTSE) @$(RM) $(BUILD_DIR)/libc++_Changes_SGX.txt diff --git a/sdk/debugger_interface/linux/gdb-sgx-plugin/gdb_sgx_plugin.py b/sdk/debugger_interface/linux/gdb-sgx-plugin/gdb_sgx_plugin.py index 672edfdc7..82724e5f9 100644 --- a/sdk/debugger_interface/linux/gdb-sgx-plugin/gdb_sgx_plugin.py +++ b/sdk/debugger_interface/linux/gdb-sgx-plugin/gdb_sgx_plugin.py @@ -151,13 +151,14 @@ def init_enclave_debug(self): if (self.enclave_type & ET_SIM) != ET_SIM and (self.enclave_type & ET_DEBUG) != ET_DEBUG: print ('Warning: {0:s} is a product hardware enclave. It can\'t be debugged and sgx_emmt doesn\'t work'.format(self.enclave_path)) return -1 - # set TCS debug flag + # set TCS debug flag, clear AEXNOTIFY for tcs_addr in self.tcs_addr_list: string = read_from_memory(tcs_addr + 8, 4) if string == None: return 0 flag = struct.unpack('I', string)[0] flag |= 1 + flag &= (~2) gdb_cmd = "set *(unsigned int *)%#x = %#x" %(tcs_addr + 8, flag) gdb.execute(gdb_cmd, False, True) #If it is a product enclave, won't reach here. @@ -322,6 +323,8 @@ def fini_enclave_debug(self): self.show_emmt() try: # clear TCS debug flag + # TODO - We may also need to recover AEXNOTIFY bit. + # It requires us to save the orig AEXNOTIFY bit before init_enclave_debug() for tcs_addr in self.tcs_addr_list: string = read_from_memory(tcs_addr + 8, 4) if string == None: @@ -681,7 +684,9 @@ def stop(self): if string == None: return False flag = struct.unpack('I', string)[0] + # set TCS debug flag, clear AEXNOTIFY flag |= 1 + flag &= (~2) gdb_cmd = "set *(unsigned int *)%#x = %#x" %(tcs_addr + 8, flag) gdb.execute(gdb_cmd, False, True) return False diff --git a/sdk/sample_libcrypto/Makefile b/sdk/sample_libcrypto/Makefile index 2046892e1..ba7c499b2 100644 --- a/sdk/sample_libcrypto/Makefile +++ b/sdk/sample_libcrypto/Makefile @@ -47,7 +47,7 @@ LDFLAGS += $(COMMON_LDFLAGS) -Wl,--version-script,sample_libcrypto.lds -Wl,--gc- OBJS := sample_libcrypto.o -IPPDISP_DIR := $(LINUX_SDK_DIR)/tlibcrypto/ipp/ipp_disp +IPPDISP_DIR := $(LINUX_SDK_DIR)/tlibcrypto/ipp/ipp_disp/intel64 C_SRC := $(wildcard $(IPPDISP_DIR)/*.c) C_OBJS := $(patsubst $(IPPDISP_DIR)/%.c, %.o, $(C_SRC)) C_OBJS := $(sort $(C_OBJS)) diff --git a/sdk/sample_libcrypto/sample_libcrypto.cpp b/sdk/sample_libcrypto/sample_libcrypto.cpp index fdccad1d8..bcce95b49 100644 --- a/sdk/sample_libcrypto/sample_libcrypto.cpp +++ b/sdk/sample_libcrypto/sample_libcrypto.cpp @@ -107,7 +107,10 @@ extern "C" int memset_s(void *s, size_t smax, int c, size_t n) #define UNUSED(val) (void)(val) #endif - +__attribute__((constructor)) void sample_init_ipp_crypto() +{ + ippcpInit(); +} static uint32_t seed = (uint32_t)(9); diff --git a/sdk/sign_tool/SignTool/Makefile b/sdk/sign_tool/SignTool/Makefile index e0d241642..f9ce24796 100644 --- a/sdk/sign_tool/SignTool/Makefile +++ b/sdk/sign_tool/SignTool/Makefile @@ -36,7 +36,7 @@ CFLAGS += -Werror CFLAGS += -fpie -DOPENSSL_API_COMPAT=10101 CXXFLAGS += -fpie -DOPENSSL_API_COMPAT=10101 -LDFLAGS := -pie $(COMMON_LDFLAGS) +LDFLAGS := -pie $(COMMON_LDFLAGS) -Wno-odr INC += $(ADDED_INC) INC += -I$(COMMON_DIR)/inc \ diff --git a/sdk/sign_tool/SignTool/manage_metadata.cpp b/sdk/sign_tool/SignTool/manage_metadata.cpp index 333d668f4..56ce09daa 100644 --- a/sdk/sign_tool/SignTool/manage_metadata.cpp +++ b/sdk/sign_tool/SignTool/manage_metadata.cpp @@ -304,6 +304,13 @@ bool CMetadata::fill_enclave_css(const xml_parameter_t *para) m_metadata->enclave_css.body.attributes.flags |= SGX_FLAGS_KSS; m_metadata->enclave_css.body.attribute_mask.flags |= SGX_FLAGS_KSS; } + + if (para[ENABLEAEXNOTIFY].value == 1) + { + m_metadata->enclave_css.body.attributes.flags |= SGX_FLAGS_AEX_NOTIFY; + m_metadata->enclave_css.body.attribute_mask.flags |= SGX_FLAGS_AEX_NOTIFY; + } + if (memcpy_s(&(m_metadata->enclave_css.body.isvext_prod_id), SGX_ISVEXT_PROD_ID_SIZE, &(para[ISVEXTPRODID_L].value), sizeof(para[ISVEXTPRODID_L].value))) { @@ -599,48 +606,53 @@ bool CMetadata::check_xml_parameter(const xml_parameter_t *parameter) return true; } -uint64_t CMetadata::calculate_rts_bk_overhead() +static uint64_t edmm_aligned_overhead(uint32_t size) { - se_trace(SE_TRACE_DEBUG, "ema_overhead: %lld, bit_array_overhead: %lld\n", sizeof(struct ema_t_), sizeof(struct bit_array_)); - - // alignment value according to sgx-emm emalloc.c - const uint32_t ema_align = 0x10; - const uint32_t page_count_align = 0x80; + // header size/alignment/min_block_size comes from the emalloc + // implementation in sgx-emm module + const uint64_t header_size = sizeof(uint64_t); + const uint64_t alignment = 0x8; + const uint64_t min_block_size = 0x10; + uint64_t bsize = ROUND_TO(size + header_size, alignment); + return bsize < min_block_size ? min_block_size : bsize; +} - uint64_t ema_overhead = ROUND_TO(sizeof(struct ema_t_), ema_align); - uint64_t bit_array_overhead = ROUND_TO(sizeof(struct bit_array_), ema_align); +uint64_t CMetadata::calculate_rts_bk_overhead() +{ + uint64_t ema_overhead = edmm_aligned_overhead(sizeof(struct ema_t_)); + uint64_t bit_array_overhead = edmm_aligned_overhead(sizeof(struct bit_array_)); // MIN heap uint32_t page_count = (uint32_t)(m_create_param.heap_min_size >> SE_PAGE_SHIFT); - uint64_t heap_node_overhead = ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + uint64_t heap_node_overhead = ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); if(m_create_param.heap_init_size > m_create_param.heap_min_size) { // INIT heap page_count = (uint32_t)((m_create_param.heap_init_size - m_create_param.heap_min_size) >> SE_PAGE_SHIFT); - heap_node_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + heap_node_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); } if(m_create_param.heap_max_size > m_create_param.heap_init_size) { page_count = (uint32_t)((m_create_param.heap_max_size - m_create_param.heap_init_size) >> SE_PAGE_SHIFT); - heap_node_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + heap_node_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); } page_count = (uint32_t)(m_create_param.rsrv_min_size >> SE_PAGE_SHIFT); - uint64_t rsrv_node_overhead = ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + uint64_t rsrv_node_overhead = ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); if(m_create_param.rsrv_init_size > m_create_param.rsrv_min_size) { // INIT RSRV page_count = (uint32_t)((m_create_param.rsrv_init_size - m_create_param.rsrv_min_size) >> SE_PAGE_SHIFT); - rsrv_node_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + rsrv_node_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); } if(m_create_param.rsrv_max_size > m_create_param.rsrv_init_size) { page_count = (uint32_t)((m_create_param.rsrv_max_size - m_create_param.rsrv_init_size) >> SE_PAGE_SHIFT); - rsrv_node_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + rsrv_node_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); } // guard page | stack | guard page | TCS | SSA | guard page | TLS @@ -650,13 +662,13 @@ uint64_t CMetadata::calculate_rts_bk_overhead() // stack page_count = (uint32_t)(m_create_param.stack_min_size >> SE_PAGE_SHIFT); - non_removed_ctx_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + non_removed_ctx_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); removed_ctx_overhead += ema_overhead; if(m_create_param.stack_max_size > m_create_param.stack_min_size) { page_count = (uint32_t)((m_create_param.stack_max_size - m_create_param.stack_min_size) >> SE_PAGE_SHIFT); - non_removed_ctx_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + non_removed_ctx_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); removed_ctx_overhead += ema_overhead; } @@ -666,12 +678,12 @@ uint64_t CMetadata::calculate_rts_bk_overhead() // tcs page_count = TCS_SIZE >> SE_PAGE_SHIFT; - non_removed_ctx_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + non_removed_ctx_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); removed_ctx_overhead += ema_overhead; // ssa page_count = m_metadata->ssa_frame_size * SSA_NUM; - non_removed_ctx_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + non_removed_ctx_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); removed_ctx_overhead += ema_overhead; // guard page @@ -685,7 +697,7 @@ uint64_t CMetadata::calculate_rts_bk_overhead() { page_count += (uint32_t)(ROUND_TO_PAGE(section->virtual_size()) >> SE_PAGE_SHIFT); } - non_removed_ctx_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(page_count, page_count_align) >> 3); + non_removed_ctx_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(page_count, 8) >> 3)); removed_ctx_overhead += ema_overhead; uint32_t tcs_min_pool = 0; /* Number of static threads (EADD) */ @@ -736,14 +748,15 @@ uint64_t CMetadata::calculate_rts_bk_overhead() std::vector sections = m_parser->get_sections(); for (auto s : sections) { uint32_t p_count = (uint32_t)(ROUND_TO_PAGE(s->virtual_size()) >> SE_PAGE_SHIFT); - total_sections_overhead += ema_overhead + bit_array_overhead + (ROUND_TO(p_count, page_count_align) >> 3); + total_sections_overhead += ema_overhead + bit_array_overhead + edmm_aligned_overhead((ROUND_TO(p_count, 8) >> 3)); } return heap_node_overhead + rsrv_node_overhead + total_non_removed_ctx_overhead + total_removed_ctx_overhead + - total_sections_overhead; + total_sections_overhead + + ema_overhead; // potential ema node for the last guard page } void *CMetadata::alloc_buffer_from_metadata(uint32_t size) @@ -1187,52 +1200,27 @@ bool CMetadata::build_layout_table() // SGX2 metadata required if ((meta_versions & 2u) == 2u) { - // 0x10000 due to the requirement from sgx-emm's min_block_size - uint64_t aligned_overhead = ROUND_TO(calculate_rts_bk_overhead(), 0x10000); - se_trace(SE_TRACE_DEBUG, "raw overhead: 0x%016llX\n", aligned_overhead); - - uint64_t units_of_block_size = aligned_overhead >> 16; - uint8_t reserve_cnt = 0; - while (units_of_block_size > 0) + uint64_t user_region_size = 0; + if (m_create_param.user_region_size > 0) { - ++reserve_cnt; - units_of_block_size >>= 1; + user_region_size = m_create_param.user_region_size; + // one-byte ema bookkeeping struct can roughly cover 2^15 byte data + uint64_t overhead = (m_create_param.user_region_size >> 15); + uint64_t aligned_overhead = ROUND_TO_PAGE(overhead) > 0 ? ROUND_TO_PAGE(overhead) : SE_PAGE_SIZE; + m_create_param.edmm_bk_overhead += aligned_overhead; } - if (reserve_cnt >= 30) - { - // There's a limit in emalloc.c that max_emalloc_size is 2^28 bytes. So when - // reservation count reaches 30, we reach that limit. - se_trace(SE_TRACE_ERROR, "Exceed RTS bookkeeping limit\n"); - return false; - } + const uint64_t initial_reserve_size = 0x10000; + const uint64_t guard_size = 0x8000; + const uint64_t reserve_overhead = 32; - se_trace(SE_TRACE_DEBUG, "ema reservation time: %d\n", reserve_cnt); - - // The memory reservation implementation in sgx-emm emalloc.c works like this: - // The initial reserve size is 16 pages (0x10000 bytes) and will double the size - // each time a new reservation is needed. That is, we will have these reservation - // sizes: 0x100000B for the 1st reserve, 0x200000B for the 2nd, 0x40000B for the 3rd. - // Therefore, if our rts ema overhead needs one reservation, we need 0x10000B, if it - // needs two reservation, we need 0x10000+0x20000=0x30000B, if it needs three, we - // need 0x10000+0x20000+0x40000=0x70000. - // Therefore, if we scale down 0x10000, we will have this pattern: 1, 3, 7, 15, ... - // which can be described as 2 ^ (number of reservation time) - 1. - // The memory reservation in emalloc.c also reserve two guard pages around the target - // memory region in each reservation, so we need an extra 0x10000B each time. - // Therefore, the total overhead should be (2^reserve_cnt - 1 + reserve_cnt) * 0x10000B. - uint64_t user_region_size = ((uint64_t)((1 << reserve_cnt) - 1 + reserve_cnt)) << 16; - se_trace(SE_TRACE_ERROR, "RTS bookkeeping overhead: 0x%016llX\n", user_region_size); + m_create_param.edmm_bk_overhead += calculate_rts_bk_overhead(); + uint64_t aligned_overhead = ROUND_TO(m_create_param.edmm_bk_overhead + reserve_overhead, initial_reserve_size); + user_region_size += aligned_overhead + (guard_size << 1); + m_create_param.edmm_bk_overhead = aligned_overhead; - if (m_create_param.user_region_size > 0) - { - user_region_size += m_create_param.user_region_size; - - // one-byte ema bookkeeping struct can roughly cover 2^15 byte data - uint64_t extra_overhead = (m_create_param.user_region_size >> 15); - user_region_size += ROUND_TO_PAGE(extra_overhead); - } - se_trace(SE_TRACE_ERROR, "Total user region size: 0x%016llX\n", user_region_size); + se_trace(SE_TRACE_DEBUG, "Total user region size: 0x%016llX\n", user_region_size); + se_trace(SE_TRACE_DEBUG, "Total edmm overhead: 0x%016llX\n", m_create_param.edmm_bk_overhead); memset(&layout, 0, sizeof(layout)); layout.entry.id = LAYOUT_ID_USER_REGION; @@ -1458,17 +1446,6 @@ bool CMetadata::build_gd_template(uint8_t *data, uint32_t *data_size) { m_create_param.rsrv_offset = (size_t)layout_rsrv->rva; } - - layout_entry_t * layout_user = get_entry_by_id(LAYOUT_ID_USER_REGION, false); - if (NULL == layout_user) - { - m_create_param.user_region_offset = (size_t)0; - } - else - { - m_create_param.user_region_offset = (size_t)layout_user->rva; - } - size_t tmp_tls_addr = (size_t)(get_entry_by_id(LAYOUT_ID_TD)->rva - get_entry_by_id(LAYOUT_ID_TCS)->rva); m_create_param.td_addr = tmp_tls_addr + (size_t)((get_entry_by_id(LAYOUT_ID_TD)->page_count - 1) << SE_PAGE_SHIFT); @@ -1502,6 +1479,11 @@ bool CMetadata::build_tcs_template(tcs_t *tcs) { return false; } + if( m_metadata->enclave_css.body.attributes.flags & SGX_FLAGS_AEX_NOTIFY ) + { + tcs->flags |= TCS_FLAG_AEXNOTIFY; + } + tcs->oentry += offset; tcs->nssa = SSA_NUM; tcs->cssa = 0; @@ -1664,13 +1646,13 @@ bool CMetadata::check_config() { // SGX2 metadata only m_meta_verions = 1u << 1; - se_trace(SE_TRACE_ERROR, "\033[0;32mINFO: Enclave configuration 'MiscSelect' and 'MiscSelectMask' will prevent enclave from running on SGX1 platform. To make it run on SGX1 platform, suggest to set MiscMask[0]=0 and MiscSelect[0]=1.\n\033[0m"); - return true; } - - // SGX1 and SGX2 metadata - m_meta_verions = (1u << 1) | 1u; - se_trace(SE_TRACE_ERROR, "\033[0;32mINFO: Enclave configuration 'MiscSelect' and 'MiscSelectMask' will work on SGX1 and SGX2 platforms with respective metadata.\n\033[0m"); + else + { + // SGX1 and SGX2 metadata + m_meta_verions = (1u << 1) | 1u; + } + se_trace(SE_TRACE_ERROR, "\033[0;32mINFO: Enclave configuration 'MiscSelect' and 'MiscSelectMask' will prevent enclave from running on SGX1 platform. To make it run on SGX1 platform, suggest to set MiscSelect[0]=0.\n\033[0m"); return true; } diff --git a/sdk/sign_tool/SignTool/manage_metadata.h b/sdk/sign_tool/SignTool/manage_metadata.h index 337e13078..84f5a076b 100644 --- a/sdk/sign_tool/SignTool/manage_metadata.h +++ b/sdk/sign_tool/SignTool/manage_metadata.h @@ -85,7 +85,8 @@ typedef enum _para_type_t ELRANGESIZE, PKRU, AMX, - USERREGIONSIZE + USERREGIONSIZE, + ENABLEAEXNOTIFY } para_type_t; typedef struct _xml_parameter_t diff --git a/sdk/sign_tool/SignTool/sign_tool.cpp b/sdk/sign_tool/SignTool/sign_tool.cpp index 3fe8ef769..a29079904 100644 --- a/sdk/sign_tool/SignTool/sign_tool.cpp +++ b/sdk/sign_tool/SignTool/sign_tool.cpp @@ -1333,7 +1333,8 @@ int main(int argc, char* argv[]) {"ELRangeSize", 0xFFFFFFFFFFFFFFFF, 0x1000, 0, 0}, {"PKRU", FEATURE_LOADER_SELECTS, FEATURE_MUST_BE_DISABLED, FEATURE_MUST_BE_DISABLED, 0}, {"AMX", FEATURE_LOADER_SELECTS, FEATURE_MUST_BE_DISABLED, FEATURE_MUST_BE_DISABLED, 0}, - {"UserRegionSize", ENCLAVE_MAX_SIZE_64/2, 0, USER_REGION_SIZE, 0}}; + {"UserRegionSize", ENCLAVE_MAX_SIZE_64/2, 0, USER_REGION_SIZE, 0}, + {"EnableAEXNotify", 1, 0, 0, 0}}; const char *path[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; uint8_t enclave_hash[SGX_HASH_SIZE] = {0}; uint8_t metadata_raw[METADATA_SIZE]; diff --git a/sdk/simulation/trtssim/linux/Makefile b/sdk/simulation/trtssim/linux/Makefile index bcb68e5d4..0e8614402 100644 --- a/sdk/simulation/trtssim/linux/Makefile +++ b/sdk/simulation/trtssim/linux/Makefile @@ -67,6 +67,7 @@ TRTS1_OBJS := init_enclave.o \ trts_xsave.o \ init_optimized_lib.o \ trts_add_trim.o \ + trts_aex.o \ trts_emm_sim.o TRTS2_OBJS := trts_nsp.o @@ -81,6 +82,7 @@ TLS_OBJS := get_tcs.o \ restore_tls.o TLDR_ASM_OBJS := trts_pic.o \ + trts_mitigation.o \ metadata_sec.o \ xsave_gnu.o \ thunk.o diff --git a/sdk/switchless/sgx_uswitchless/sl_uswitchless_untrusted.c b/sdk/switchless/sgx_uswitchless/sl_uswitchless_untrusted.c index 5c9fd8e0a..61bca885d 100644 --- a/sdk/switchless/sgx_uswitchless/sl_uswitchless_untrusted.c +++ b/sdk/switchless/sgx_uswitchless/sl_uswitchless_untrusted.c @@ -144,10 +144,12 @@ sgx_status_t sl_init_uswitchless(sgx_enclave_id_t enclave_id, const void* config status = SGX_ERROR_UNEXPECTED; sl_uswitchless_free(uswitchless_p); } + else + { + *switchless_pp = uswitchless_p; + } } - *switchless_pp = uswitchless_p; - return status; } diff --git a/sdk/tlibcrypto/Makefile b/sdk/tlibcrypto/Makefile index bb048e95e..33a4009af 100644 --- a/sdk/tlibcrypto/Makefile +++ b/sdk/tlibcrypto/Makefile @@ -88,7 +88,7 @@ LIB_NAME := libsgx_tcrypto_ipp.a endif #($(USE_CRYPTO_LIB), 0) -C_Files := $(wildcard ipp/ipp_disp/*.c) +C_Files := $(wildcard ipp/ipp_disp/intel64/*.c) C_OBJS := $(C_Files:.c=.o) C_OBJS := $(sort $(C_OBJS)) @@ -138,9 +138,9 @@ all: $(TARGET) $(DISP_LIB_NAME) | $(BUILD_DIR) .PHONY: clean clean: - @$(RM) *.o ipp/*.o ipp/ipp_disp/*.o sgxssl/*.o $(TARGET) $(BUILD_DIR)/$(TARGET) $(LIB_NAME) $(DISP_LIB_NAME) $(BUILD_DIR)/$(DISP_LIB_NAME) + @$(RM) *.o ipp/*.o ipp/ipp_disp/intel64/*.o sgxssl/*.o $(TARGET) $(BUILD_DIR)/$(TARGET) $(LIB_NAME) $(DISP_LIB_NAME) $(BUILD_DIR)/$(DISP_LIB_NAME) .PHONY: rebuild rebuild: $(MAKE) clean - $(MAKE) all \ No newline at end of file + $(MAKE) all diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippcpGetLibVersion.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippcpGetLibVersion.c new file mode 100644 index 000000000..fe4bb3f3f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippcpGetLibVersion.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppLibraryVersion*, k1_ippcpGetLibVersion, (void) ) +IPPAPI( const IppLibraryVersion*, l9_ippcpGetLibVersion, (void) ) +IPPAPI( const IppLibraryVersion*, y8_ippcpGetLibVersion, (void) ) + +IPPFUN( const IppLibraryVersion*, sgx_disp_ippcpGetLibVersion, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippcpGetLibVersion( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippcpGetLibVersion( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippcpGetLibVersion( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC.c new file mode 100644 index 000000000..ff36a5999 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS1.c new file mode 100644 index 000000000..45701bffc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS2.c new file mode 100644 index 000000000..0c0a6b7c7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS3.c new file mode 100644 index 000000000..bd1256849 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCBC_CS3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCFB.c new file mode 100644 index 000000000..08f5b9e6b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCTR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCTR.c new file mode 100644 index 000000000..ee3edd2ea --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptCTR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, l9_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, y8_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptECB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptECB.c new file mode 100644 index 000000000..66bb3701a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptECB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) +IPPAPI(IppStatus, l9_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) +IPPAPI(IppStatus, y8_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptOFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptOFB.c new file mode 100644 index 000000000..8724414c4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptOFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptXTS_Direct.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptXTS_Direct.c new file mode 100644 index 000000000..a8bf50ebb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESDecryptXTS_Direct.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) +IPPAPI(IppStatus, l9_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) +IPPAPI(IppStatus, y8_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC.c new file mode 100644 index 000000000..6d7ae7985 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS1.c new file mode 100644 index 000000000..8691fa94a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS2.c new file mode 100644 index 000000000..293f64551 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS3.c new file mode 100644 index 000000000..a88d463d3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCBC_CS3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCFB.c new file mode 100644 index 000000000..1a664f91e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCTR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCTR.c new file mode 100644 index 000000000..a0b318416 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptCTR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, l9_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, y8_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptECB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptECB.c new file mode 100644 index 000000000..071d7f559 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptECB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) +IPPAPI(IppStatus, l9_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) +IPPAPI(IppStatus, y8_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptOFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptOFB.c new file mode 100644 index 000000000..b1cca949f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptOFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptXTS_Direct.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptXTS_Direct.c new file mode 100644 index 000000000..089bbf9fd --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESEncryptXTS_Direct.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) +IPPAPI(IppStatus, l9_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) +IPPAPI(IppStatus, y8_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESGetSize.c new file mode 100644 index 000000000..5f2f2e5be --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESGetSize,(int *pSize)) +IPPAPI(IppStatus, l9_ippsAESGetSize,(int *pSize)) +IPPAPI(IppStatus, y8_ippsAESGetSize,(int *pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESGetSize,(int *pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESInit.c new file mode 100644 index 000000000..1eafc8180 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) +IPPAPI(IppStatus, l9_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) +IPPAPI(IppStatus, y8_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESPack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESPack.c new file mode 100644 index 000000000..eb016f608 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESPack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, l9_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, y8_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESPack( pCtx, pBuffer, bufSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESPack( pCtx, pBuffer, bufSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESPack( pCtx, pBuffer, bufSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESSetKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESSetKey.c new file mode 100644 index 000000000..ed5903b24 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESSetKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) +IPPAPI(IppStatus, l9_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) +IPPAPI(IppStatus, y8_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESSetKey( pKey, keyLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESSetKey( pKey, keyLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESSetKey( pKey, keyLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESSetupNoise.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESSetupNoise.c new file mode 100644 index 000000000..166c24e36 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESSetupNoise.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESSetupNoise,(Ipp32u noiseLevel, IppsAESSpec* pCtx)) +IPPAPI(IppStatus, l9_ippsAESSetupNoise,(Ipp32u noiseLevel, IppsAESSpec* pCtx)) +IPPAPI(IppStatus, y8_ippsAESSetupNoise,(Ipp32u noiseLevel, IppsAESSpec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsAESSetupNoise,(Ipp32u noiseLevel, IppsAESSpec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESSetupNoise( noiseLevel, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESSetupNoise( noiseLevel, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESSetupNoise( noiseLevel, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESUnpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESUnpack.c new file mode 100644 index 000000000..9dff7b8ad --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAESUnpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) +IPPAPI(IppStatus, l9_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) +IPPAPI(IppStatus, y8_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAESUnpack( pBuffer, pCtx, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAESUnpack( pBuffer, pCtx, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAESUnpack( pBuffer, pCtx, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMDecrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMDecrypt.c new file mode 100644 index 000000000..1354e65ce --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMDecrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMEncrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMEncrypt.c new file mode 100644 index 000000000..26ccc56cf --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMEncrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMGetSize.c new file mode 100644 index 000000000..17657fa30 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMGetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsAES_CCMGetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsAES_CCMGetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMGetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMGetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMGetTag.c new file mode 100644 index 000000000..24f213836 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMGetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMGetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMGetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMGetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMInit.c new file mode 100644 index 000000000..ab83f2288 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) +IPPAPI(IppStatus, l9_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) +IPPAPI(IppStatus, y8_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMMessageLen.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMMessageLen.c new file mode 100644 index 000000000..15d72dce7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMMessageLen.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMMessageLen( msgLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMMessageLen( msgLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMMessageLen( msgLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMStart.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMStart.c new file mode 100644 index 000000000..e6d525988 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMStart.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMTagLen.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMTagLen.c new file mode 100644 index 000000000..a8d729bb6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CCMTagLen.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CCMTagLen( tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CCMTagLen( tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CCMTagLen( tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACFinal.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACFinal.c new file mode 100644 index 000000000..fcac840ec --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACFinal.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CMACFinal( pMD, mdLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CMACFinal( pMD, mdLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CMACFinal( pMD, mdLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACGetSize.c new file mode 100644 index 000000000..7dd0ef21d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CMACGetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsAES_CMACGetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsAES_CMACGetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CMACGetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CMACGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CMACGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CMACGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACGetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACGetTag.c new file mode 100644 index 000000000..6e44435ed --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACGetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CMACGetTag( pMD, mdLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CMACGetTag( pMD, mdLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CMACGetTag( pMD, mdLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACInit.c new file mode 100644 index 000000000..3a6fbd3be --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) +IPPAPI(IppStatus, l9_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) +IPPAPI(IppStatus, y8_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACSetupNoise.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACSetupNoise.c new file mode 100644 index 000000000..4ad9b1b60 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACSetupNoise.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CMACSetupNoise,(Ipp32u noiseLevel, IppsAES_CMACState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CMACSetupNoise,(Ipp32u noiseLevel, IppsAES_CMACState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CMACSetupNoise,(Ipp32u noiseLevel, IppsAES_CMACState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CMACSetupNoise,(Ipp32u noiseLevel, IppsAES_CMACState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CMACSetupNoise( noiseLevel, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CMACSetupNoise( noiseLevel, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CMACSetupNoise( noiseLevel, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACUpdate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACUpdate.c new file mode 100644 index 000000000..addc2b229 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_CMACUpdate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) +IPPAPI(IppStatus, l9_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) +IPPAPI(IppStatus, y8_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_CMACUpdate( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_CMACUpdate( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_CMACUpdate( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_EncryptCFB16_MB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_EncryptCFB16_MB.c new file mode 100644 index 000000000..588d85cfb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_EncryptCFB16_MB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) +IPPAPI(IppStatus, l9_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) +IPPAPI(IppStatus, y8_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMDecrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMDecrypt.c new file mode 100644 index 000000000..fc11d7249 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMDecrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMEncrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMEncrypt.c new file mode 100644 index 000000000..ee71f6fdb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMEncrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMGetSize.c new file mode 100644 index 000000000..80f0b3b17 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMGetSize,(int * pSize)) +IPPAPI(IppStatus, l9_ippsAES_GCMGetSize,(int * pSize)) +IPPAPI(IppStatus, y8_ippsAES_GCMGetSize,(int * pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMGetSize,(int * pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMGetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMGetTag.c new file mode 100644 index 000000000..9d03d278a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMGetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMInit.c new file mode 100644 index 000000000..f31d1cb9b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) +IPPAPI(IppStatus, l9_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) +IPPAPI(IppStatus, y8_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMProcessAAD.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMProcessAAD.c new file mode 100644 index 000000000..2a4bd0201 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMProcessAAD.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMProcessAAD( pAAD, aadLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMProcessAAD( pAAD, aadLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMProcessAAD( pAAD, aadLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMProcessIV.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMProcessIV.c new file mode 100644 index 000000000..63788a8d5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMProcessIV.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMProcessIV( pIV, ivLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMProcessIV( pIV, ivLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMProcessIV( pIV, ivLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMReset.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMReset.c new file mode 100644 index 000000000..a50a1f7b7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMReset.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMReset,(IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMReset,(IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMReset,(IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMReset,(IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMReset( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMReset( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMReset( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMSetupNoise.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMSetupNoise.c new file mode 100644 index 000000000..78fb4728d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMSetupNoise.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMSetupNoise,(Ipp32u noiseLevel, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMSetupNoise,(Ipp32u noiseLevel, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMSetupNoise,(Ipp32u noiseLevel, IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMSetupNoise,(Ipp32u noiseLevel, IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMSetupNoise( noiseLevel, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMSetupNoise( noiseLevel, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMSetupNoise( noiseLevel, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMStart.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMStart.c new file mode 100644 index 000000000..606080f30 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_GCMStart.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, l9_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) +IPPAPI(IppStatus, y8_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_S2V_CMAC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_S2V_CMAC.c new file mode 100644 index 000000000..ef349cd9d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_S2V_CMAC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) +IPPAPI(IppStatus, l9_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) +IPPAPI(IppStatus, y8_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_SIVDecrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_SIVDecrypt.c new file mode 100644 index 000000000..03d5f5d9b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_SIVDecrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) +IPPAPI(IppStatus, l9_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) +IPPAPI(IppStatus, y8_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_SIVEncrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_SIVEncrypt.c new file mode 100644 index 000000000..04f19a4fb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_SIVEncrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) +IPPAPI(IppStatus, l9_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) +IPPAPI(IppStatus, y8_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSDecrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSDecrypt.c new file mode 100644 index 000000000..6691d14b1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSDecrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) +IPPAPI(IppStatus, l9_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) +IPPAPI(IppStatus, y8_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSEncrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSEncrypt.c new file mode 100644 index 000000000..01d7ed02b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSEncrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) +IPPAPI(IppStatus, l9_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) +IPPAPI(IppStatus, y8_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSGetSize.c new file mode 100644 index 000000000..16340b3c9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_XTSGetSize,(int * pSize)) +IPPAPI(IppStatus, l9_ippsAES_XTSGetSize,(int * pSize)) +IPPAPI(IppStatus, y8_ippsAES_XTSGetSize,(int * pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_XTSGetSize,(int * pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_XTSGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_XTSGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_XTSGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSInit.c new file mode 100644 index 000000000..f4d2c3d90 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAES_XTSInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) +IPPAPI(IppStatus, l9_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) +IPPAPI(IppStatus, y8_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourCheckKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourCheckKey.c new file mode 100644 index 000000000..d1ca7f2e1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourCheckKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) +IPPAPI(IppStatus, l9_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) +IPPAPI(IppStatus, y8_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourDecrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourDecrypt.c new file mode 100644 index 000000000..0715e5e5a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourDecrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) +IPPAPI(IppStatus, l9_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) +IPPAPI(IppStatus, y8_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourEncrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourEncrypt.c new file mode 100644 index 000000000..d079366f4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourEncrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) +IPPAPI(IppStatus, l9_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) +IPPAPI(IppStatus, y8_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourGetSize.c new file mode 100644 index 000000000..9f0306049 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourGetSize, (int* pSize)) +IPPAPI(IppStatus, l9_ippsARCFourGetSize, (int* pSize)) +IPPAPI(IppStatus, y8_ippsARCFourGetSize, (int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourGetSize, (int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourInit.c new file mode 100644 index 000000000..5a22c25b0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) +IPPAPI(IppStatus, l9_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) +IPPAPI(IppStatus, y8_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourInit( pKey, keyLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourInit( pKey, keyLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourInit( pKey, keyLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourPack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourPack.c new file mode 100644 index 000000000..259394916 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourPack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourPack( pCtx, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourPack( pCtx, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourPack( pCtx, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourReset.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourReset.c new file mode 100644 index 000000000..eb957d781 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourReset.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourReset, (IppsARCFourState* pCtx)) +IPPAPI(IppStatus, l9_ippsARCFourReset, (IppsARCFourState* pCtx)) +IPPAPI(IppStatus, y8_ippsARCFourReset, (IppsARCFourState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourReset, (IppsARCFourState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourReset( pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourReset( pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourReset( pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourUnpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourUnpack.c new file mode 100644 index 000000000..c350f8947 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsARCFourUnpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) +IPPAPI(IppStatus, l9_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) +IPPAPI(IppStatus, y8_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsARCFourUnpack( pBuffer, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsARCFourUnpack( pBuffer, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsARCFourUnpack( pBuffer, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAdd_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAdd_BN.c new file mode 100644 index 000000000..425d83fae --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsAdd_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsAdd_BN( pA, pB, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsAdd_BN( pA, pB, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsAdd_BN( pA, pB, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsBigNumGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsBigNumGetSize.c new file mode 100644 index 000000000..30aea76b7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsBigNumGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsBigNumGetSize,(int length, int* pSize)) +IPPAPI(IppStatus, l9_ippsBigNumGetSize,(int length, int* pSize)) +IPPAPI(IppStatus, y8_ippsBigNumGetSize,(int length, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsBigNumGetSize,(int length, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsBigNumGetSize( length, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsBigNumGetSize( length, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsBigNumGetSize( length, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsBigNumInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsBigNumInit.c new file mode 100644 index 000000000..b3274f812 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsBigNumInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsBigNumInit,(int length, IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsBigNumInit,(int length, IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsBigNumInit,(int length, IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsBigNumInit,(int length, IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsBigNumInit( length, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsBigNumInit( length, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsBigNumInit( length, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsCmpZero_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsCmpZero_BN.c new file mode 100644 index 000000000..a0d28d945 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsCmpZero_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) +IPPAPI(IppStatus, l9_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) +IPPAPI(IppStatus, y8_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) + +IPPFUN(IppStatus, sgx_disp_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsCmpZero_BN( pBN, pResult ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsCmpZero_BN( pBN, pResult ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsCmpZero_BN( pBN, pResult ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsCmp_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsCmp_BN.c new file mode 100644 index 000000000..7a08e1b7c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsCmp_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) +IPPAPI(IppStatus, l9_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) +IPPAPI(IppStatus, y8_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) + +IPPFUN(IppStatus, sgx_disp_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsCmp_BN( pA, pB, pResult ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsCmp_BN( pA, pB, pResult ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsCmp_BN( pA, pB, pResult ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESGetSize.c new file mode 100644 index 000000000..d12993d08 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDESGetSize,(int *size)) +IPPAPI(IppStatus, l9_ippsDESGetSize,(int *size)) +IPPAPI(IppStatus, y8_ippsDESGetSize,(int *size)) + +IPPFUN(IppStatus, sgx_disp_ippsDESGetSize,(int *size)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDESGetSize( size ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDESGetSize( size ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDESGetSize( size ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESInit.c new file mode 100644 index 000000000..f59ad337d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) +IPPAPI(IppStatus, l9_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) +IPPAPI(IppStatus, y8_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDESInit( pKey, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDESInit( pKey, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDESInit( pKey, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESPack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESPack.c new file mode 100644 index 000000000..af93a528c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESPack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDESPack( pCtx, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDESPack( pCtx, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDESPack( pCtx, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESUnpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESUnpack.c new file mode 100644 index 000000000..3108912ea --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDESUnpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) +IPPAPI(IppStatus, l9_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) +IPPAPI(IppStatus, y8_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDESUnpack( pBuffer, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDESUnpack( pBuffer, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDESUnpack( pBuffer, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLGetResultString.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLGetResultString.c new file mode 100644 index 000000000..5b2b988de --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLGetResultString.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const char*, k1_ippsDLGetResultString, (IppDLResult code)) +IPPAPI( const char*, l9_ippsDLGetResultString, (IppDLResult code)) +IPPAPI( const char*, y8_ippsDLGetResultString, (IppDLResult code)) + +IPPFUN( const char*, sgx_disp_ippsDLGetResultString, (IppDLResult code)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLGetResultString( code ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLGetResultString( code ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLGetResultString( code ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenKeyPair.c new file mode 100644 index 000000000..0236dc3c5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenerateDH.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenerateDH.c new file mode 100644 index 000000000..280050c6c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenerateDH.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenerateDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenerateDSA.c new file mode 100644 index 000000000..388a62974 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGenerateDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGet.c new file mode 100644 index 000000000..d229f584d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPGet( pP, pR, pG, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPGet( pP, pR, pG, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPGet( pP, pR, pG, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGetDP.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGetDP.c new file mode 100644 index 000000000..47d52b61a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGetDP.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPGetDP( pDP, tag, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPGetDP( pDP, tag, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPGetDP( pDP, tag, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGetSize.c new file mode 100644 index 000000000..e67084661 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) +IPPAPI(IppStatus, l9_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) +IPPAPI(IppStatus, y8_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPInit.c new file mode 100644 index 000000000..a4ac5c06f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPPack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPPack.c new file mode 100644 index 000000000..4563315c8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPPack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPPack( pCtx, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPPack( pCtx, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPPack( pCtx, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPPublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPPublicKey.c new file mode 100644 index 000000000..632ddbca7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPPublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSet.c new file mode 100644 index 000000000..70d677f4a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPSet( pP, pR, pG, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPSet( pP, pR, pG, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPSet( pP, pR, pG, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSetDP.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSetDP.c new file mode 100644 index 000000000..b16f35b2b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSetDP.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPSetDP( pDP, tag, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPSetDP( pDP, tag, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPSetDP( pDP, tag, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSetKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSetKeyPair.c new file mode 100644 index 000000000..b796cbee5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSetKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSharedSecretDH.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSharedSecretDH.c new file mode 100644 index 000000000..bb7f28486 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSharedSecretDH.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSignDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSignDSA.c new file mode 100644 index 000000000..bb8f99456 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPSignDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPUnpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPUnpack.c new file mode 100644 index 000000000..4e95c4d27 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPUnpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPUnpack( pBuffer, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPUnpack( pBuffer, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPUnpack( pBuffer, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateDH.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateDH.c new file mode 100644 index 000000000..8bca6e18b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateDH.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateDSA.c new file mode 100644 index 000000000..32ce65a11 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateKeyPair.c new file mode 100644 index 000000000..370c52b48 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPValidateKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPVerifyDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPVerifyDSA.c new file mode 100644 index 000000000..c0805f1c0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDLPVerifyDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) +IPPAPI(IppStatus, l9_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) +IPPAPI(IppStatus, y8_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDiv_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDiv_BN.c new file mode 100644 index 000000000..6e0cea27c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsDiv_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsDiv_BN( pA, pB, pQ, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsDiv_BN( pA, pB, pQ, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsDiv_BN( pA, pB, pQ, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCGetResultString.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCGetResultString.c new file mode 100644 index 000000000..567085a5d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCGetResultString.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const char*, k1_ippsECCGetResultString, (IppECResult code)) +IPPAPI( const char*, l9_ippsECCGetResultString, (IppECResult code)) +IPPAPI( const char*, y8_ippsECCGetResultString, (IppECResult code)) + +IPPFUN( const char*, sgx_disp_ippsECCGetResultString, (IppECResult code)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCGetResultString( code ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCGetResultString( code ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCGetResultString( code ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPAddPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPAddPoint.c new file mode 100644 index 000000000..c8e0d5990 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPAddPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPAddPoint( pP, pQ, pR, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPAddPoint( pP, pQ, pR, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPAddPoint( pP, pQ, pR, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd192r1.c new file mode 100644 index 000000000..efb4f2be2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPBindGxyTblStd192r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPBindGxyTblStd192r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPBindGxyTblStd192r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd224r1.c new file mode 100644 index 000000000..2dcbba9bb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPBindGxyTblStd224r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPBindGxyTblStd224r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPBindGxyTblStd224r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd256r1.c new file mode 100644 index 000000000..aa93559e1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPBindGxyTblStd256r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPBindGxyTblStd256r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPBindGxyTblStd256r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd384r1.c new file mode 100644 index 000000000..6cd0edcce --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPBindGxyTblStd384r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPBindGxyTblStd384r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPBindGxyTblStd384r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd521r1.c new file mode 100644 index 000000000..f7cfd03ac --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStd521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPBindGxyTblStd521r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPBindGxyTblStd521r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPBindGxyTblStd521r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStdSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStdSM2.c new file mode 100644 index 000000000..2947e5bcf --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPBindGxyTblStdSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPBindGxyTblStdSM2( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPBindGxyTblStdSM2( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPBindGxyTblStdSM2( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPCheckPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPCheckPoint.c new file mode 100644 index 000000000..2ddc31166 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPCheckPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPCheckPoint( pP, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPCheckPoint( pP, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPCheckPoint( pP, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPComparePoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPComparePoint.c new file mode 100644 index 000000000..bd3f7e16c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPComparePoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPComparePoint( pP, pQ, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPComparePoint( pP, pQ, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPComparePoint( pP, pQ, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGenKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGenKeyPair.c new file mode 100644 index 000000000..0ef6065e2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGenKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGet.c new file mode 100644 index 000000000..6ab76ac17 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetOrderBitSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetOrderBitSize.c new file mode 100644 index 000000000..1654880e4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetOrderBitSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetOrderBitSize( pBitSize, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetOrderBitSize( pBitSize, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetOrderBitSize( pBitSize, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetPoint.c new file mode 100644 index 000000000..4c0805ba4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetPoint( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetPoint( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetPoint( pX, pY, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSize.c new file mode 100644 index 000000000..c4f563ba6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSize,(int feBitSize, int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSize,(int feBitSize, int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSize,(int feBitSize, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSize,(int feBitSize, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSize( feBitSize, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSize( feBitSize, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSize( feBitSize, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd128r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd128r1.c new file mode 100644 index 000000000..f828805d2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd128r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd128r1,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd128r1,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd128r1,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd128r1,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd128r1( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd128r1( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd128r1( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd128r2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd128r2.c new file mode 100644 index 000000000..7d208acde --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd128r2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd128r2,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd128r2,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd128r2,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd128r2,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd128r2( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd128r2( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd128r2( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd192r1.c new file mode 100644 index 000000000..99692f064 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd192r1,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd192r1,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd192r1,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd192r1,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd192r1( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd192r1( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd192r1( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd224r1.c new file mode 100644 index 000000000..50d346cb1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd224r1,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd224r1,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd224r1,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd224r1,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd224r1( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd224r1( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd224r1( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd256r1.c new file mode 100644 index 000000000..2edeb151f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd256r1,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd256r1,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd256r1,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd256r1,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd256r1( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd256r1( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd256r1( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd384r1.c new file mode 100644 index 000000000..ef24bf5ae --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd384r1,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd384r1,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd384r1,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd384r1,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd384r1( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd384r1( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd384r1( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd521r1.c new file mode 100644 index 000000000..9b034c615 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStd521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStd521r1,(int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStd521r1,(int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStd521r1,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStd521r1,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStd521r1( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStd521r1( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStd521r1( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStdSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStdSM2.c new file mode 100644 index 000000000..5938d68e0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPGetSizeStdSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPGetSizeStdSM2, (int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPGetSizeStdSM2, (int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPGetSizeStdSM2, (int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPGetSizeStdSM2, (int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPGetSizeStdSM2( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPGetSizeStdSM2( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPGetSizeStdSM2( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInit.c new file mode 100644 index 000000000..50a85a15f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInit( feBitSize, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInit( feBitSize, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInit( feBitSize, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd128r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd128r1.c new file mode 100644 index 000000000..dd9febd23 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd128r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd128r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd128r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd128r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd128r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd128r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd128r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd128r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd128r2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd128r2.c new file mode 100644 index 000000000..204628cf2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd128r2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd128r2,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd128r2,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd128r2,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd128r2,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd128r2( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd128r2( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd128r2( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd192r1.c new file mode 100644 index 000000000..352b3d4ba --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd192r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd192r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd192r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd192r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd192r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd192r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd192r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd224r1.c new file mode 100644 index 000000000..ec39a7406 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd224r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd224r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd224r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd224r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd224r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd224r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd224r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd256r1.c new file mode 100644 index 000000000..4749c1bf3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd256r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd256r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd256r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd256r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd256r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd256r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd256r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd384r1.c new file mode 100644 index 000000000..d4d65ca19 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd384r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd384r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd384r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd384r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd384r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd384r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd384r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd521r1.c new file mode 100644 index 000000000..913fc907d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStd521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStd521r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStd521r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStd521r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStd521r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStd521r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStd521r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStd521r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStdSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStdSM2.c new file mode 100644 index 000000000..47b9f70e7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPInitStdSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPInitStdSM2, (IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPInitStdSM2, (IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPInitStdSM2, (IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPInitStdSM2, (IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPInitStdSM2( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPInitStdSM2( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPInitStdSM2( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPMulPointScalar.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPMulPointScalar.c new file mode 100644 index 000000000..b808d3f07 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPMulPointScalar.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPMulPointScalar( pP, pK, pR, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPMulPointScalar( pP, pK, pR, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPMulPointScalar( pP, pK, pR, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPNegativePoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPNegativePoint.c new file mode 100644 index 000000000..dc8eb6100 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPNegativePoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPNegativePoint( pP, pR, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPNegativePoint( pP, pR, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPNegativePoint( pP, pR, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPointGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPointGetSize.c new file mode 100644 index 000000000..58faabca9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPointGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPPointGetSize,(int feBitSize, int* pSize)) +IPPAPI(IppStatus, l9_ippsECCPPointGetSize,(int feBitSize, int* pSize)) +IPPAPI(IppStatus, y8_ippsECCPPointGetSize,(int feBitSize, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPPointGetSize,(int feBitSize, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPPointGetSize( feBitSize, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPPointGetSize( feBitSize, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPPointGetSize( feBitSize, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPointInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPointInit.c new file mode 100644 index 000000000..b4b8b887c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPointInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) +IPPAPI(IppStatus, l9_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) +IPPAPI(IppStatus, y8_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPPointInit( feBitSize, pPoint ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPPointInit( feBitSize, pPoint ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPPointInit( feBitSize, pPoint ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPublicKey.c new file mode 100644 index 000000000..d2e283d80 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPPublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPPublicKey( pPrivate, pPublic, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPPublicKey( pPrivate, pPublic, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPPublicKey( pPrivate, pPublic, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSet.c new file mode 100644 index 000000000..2d31a2b57 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetKeyPair.c new file mode 100644 index 000000000..6241f8bac --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetPoint.c new file mode 100644 index 000000000..d37c4db38 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetPoint( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetPoint( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetPoint( pX, pY, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetPointAtInfinity.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetPointAtInfinity.c new file mode 100644 index 000000000..9c90b668e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetPointAtInfinity.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetPointAtInfinity( pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetPointAtInfinity( pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetPointAtInfinity( pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd.c new file mode 100644 index 000000000..78bd0a916 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd( flag, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd( flag, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd( flag, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd128r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd128r1.c new file mode 100644 index 000000000..f7f82db22 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd128r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd128r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd128r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd128r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd128r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd128r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd128r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd128r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd128r2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd128r2.c new file mode 100644 index 000000000..807596969 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd128r2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd128r2,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd128r2,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd128r2,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd128r2,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd128r2( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd128r2( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd128r2( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd192r1.c new file mode 100644 index 000000000..75dccae9d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd192r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd192r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd192r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd192r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd192r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd192r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd192r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd224r1.c new file mode 100644 index 000000000..77a9c6dc3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd224r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd224r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd224r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd224r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd224r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd224r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd224r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd256r1.c new file mode 100644 index 000000000..cb20f02b7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd256r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd256r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd256r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd256r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd256r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd256r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd256r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd384r1.c new file mode 100644 index 000000000..3e1ce3d96 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd384r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd384r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd384r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd384r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd384r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd384r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd384r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd521r1.c new file mode 100644 index 000000000..5354012a0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStd521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStd521r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStd521r1,(IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStd521r1,(IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStd521r1,(IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStd521r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStd521r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStd521r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStdSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStdSM2.c new file mode 100644 index 000000000..3f2fb608d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSetStdSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSetStdSM2, (IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSetStdSM2, (IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSetStdSM2, (IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSetStdSM2, (IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSetStdSM2( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSetStdSM2( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSetStdSM2( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSharedSecretDH.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSharedSecretDH.c new file mode 100644 index 000000000..03fbde341 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSharedSecretDH.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSharedSecretDHC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSharedSecretDHC.c new file mode 100644 index 000000000..fa1f58c9e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSharedSecretDHC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignDSA.c new file mode 100644 index 000000000..392ff1b2d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignNR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignNR.c new file mode 100644 index 000000000..ccf49a53d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignNR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignSM2.c new file mode 100644 index 000000000..4cbc6d435 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPSignSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPValidate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPValidate.c new file mode 100644 index 000000000..8b7a2e245 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPValidate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPValidateKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPValidateKeyPair.c new file mode 100644 index 000000000..c1c1a9380 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPValidateKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifyDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifyDSA.c new file mode 100644 index 000000000..7dfd3824f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifyDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifyNR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifyNR.c new file mode 100644 index 000000000..28e316846 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifyNR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifySM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifySM2.c new file mode 100644 index 000000000..b3737f9b1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsECCPVerifySM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, l9_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) +IPPAPI(IppStatus, y8_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsExtGet_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsExtGet_BN.c new file mode 100644 index 000000000..077294736 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsExtGet_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpAdd.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpAdd.c new file mode 100644 index 000000000..ceb8efb90 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpAdd.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpAdd( pA, pB, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpAdd( pA, pB, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpAdd( pA, pB, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpAdd_PE.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpAdd_PE.c new file mode 100644 index 000000000..3030b3129 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpAdd_PE.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpCmpElement.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpCmpElement.c new file mode 100644 index 000000000..aaed7d3c2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpCmpElement.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpCmpElement( pA, pB, pResult, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpCmpElement( pA, pB, pResult, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpCmpElement( pA, pB, pResult, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpConj.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpConj.c new file mode 100644 index 000000000..2b06fc817 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpConj.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpConj( pA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpConj( pA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpConj( pA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpCpyElement.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpCpyElement.c new file mode 100644 index 000000000..58fdaed25 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpCpyElement.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpCpyElement( pA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpCpyElement( pA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpCpyElement( pA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECAddPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECAddPoint.c new file mode 100644 index 000000000..ef705415b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECAddPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECAddPoint( pP, pQ, pR, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECAddPoint( pP, pQ, pR, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECAddPoint( pP, pQ, pR, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd192r1.c new file mode 100644 index 000000000..1a2521f0a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECBindGxyTblStd192r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECBindGxyTblStd192r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECBindGxyTblStd192r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd224r1.c new file mode 100644 index 000000000..901bd1d99 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECBindGxyTblStd224r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECBindGxyTblStd224r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECBindGxyTblStd224r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd256r1.c new file mode 100644 index 000000000..68ca27e7b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECBindGxyTblStd256r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECBindGxyTblStd256r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECBindGxyTblStd256r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd384r1.c new file mode 100644 index 000000000..6955f1d2d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECBindGxyTblStd384r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECBindGxyTblStd384r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECBindGxyTblStd384r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd521r1.c new file mode 100644 index 000000000..ef380ce20 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStd521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECBindGxyTblStd521r1( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECBindGxyTblStd521r1( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECBindGxyTblStd521r1( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStdSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStdSM2.c new file mode 100644 index 000000000..234f6431a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECBindGxyTblStdSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECBindGxyTblStdSM2( pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECBindGxyTblStdSM2( pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECBindGxyTblStdSM2( pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECCmpPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECCmpPoint.c new file mode 100644 index 000000000..074e85d4f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECCmpPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECCpyPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECCpyPoint.c new file mode 100644 index 000000000..3dcd8a898 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECCpyPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECCpyPoint( pA, pR, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECCpyPoint( pA, pR, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECCpyPoint( pA, pR, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECDecryptSM2_Ext.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECDecryptSM2_Ext.c new file mode 100644 index 000000000..458fac799 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECDecryptSM2_Ext.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECDecryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsBigNumState *pPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECDecryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsBigNumState *pPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECDecryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsBigNumState *pPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECDecryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsBigNumState *pPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECDecryptSM2_Ext( pOut, maxOutLen, pOutSize, pInp, inpLen, pPrvKey, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECDecryptSM2_Ext( pOut, maxOutLen, pOutSize, pInp, inpLen, pPrvKey, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECDecryptSM2_Ext( pOut, maxOutLen, pOutSize, pInp, inpLen, pPrvKey, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECDecryptSM2_Ext_DecMsgSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECDecryptSM2_Ext_DecMsgSize.c new file mode 100644 index 000000000..f829ebcc1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECDecryptSM2_Ext_DecMsgSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECDecryptSM2_Ext_DecMsgSize, (const IppsGFpECState *pEC, int ctMsgSize, int *pSize)) +IPPAPI(IppStatus, l9_ippsGFpECDecryptSM2_Ext_DecMsgSize, (const IppsGFpECState *pEC, int ctMsgSize, int *pSize)) +IPPAPI(IppStatus, y8_ippsGFpECDecryptSM2_Ext_DecMsgSize, (const IppsGFpECState *pEC, int ctMsgSize, int *pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECDecryptSM2_Ext_DecMsgSize, (const IppsGFpECState *pEC, int ctMsgSize, int *pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECDecryptSM2_Ext_DecMsgSize( pEC, ctMsgSize, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECDecryptSM2_Ext_DecMsgSize( pEC, ctMsgSize, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECDecryptSM2_Ext_DecMsgSize( pEC, ctMsgSize, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESDecrypt_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESDecrypt_SM2.c new file mode 100644 index 000000000..959c9a54f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESDecrypt_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) +IPPAPI(IppStatus, l9_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) +IPPAPI(IppStatus, y8_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESEncrypt_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESEncrypt_SM2.c new file mode 100644 index 000000000..9028ef9de --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESEncrypt_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) +IPPAPI(IppStatus, l9_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) +IPPAPI(IppStatus, y8_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESFinal_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESFinal_SM2.c new file mode 100644 index 000000000..9584682a8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESFinal_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) +IPPAPI(IppStatus, l9_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) +IPPAPI(IppStatus, y8_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESGetBuffersSize_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESGetBuffersSize_SM2.c new file mode 100644 index 000000000..f03e2edfc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESGetBuffersSize_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) +IPPAPI(IppStatus, l9_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) +IPPAPI(IppStatus, y8_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESGetSize_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESGetSize_SM2.c new file mode 100644 index 000000000..5b81053a6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESGetSize_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) +IPPAPI(IppStatus, l9_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) +IPPAPI(IppStatus, y8_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESGetSize_SM2( pEC, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESGetSize_SM2( pEC, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESGetSize_SM2( pEC, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESInit_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESInit_SM2.c new file mode 100644 index 000000000..47406068b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESInit_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) +IPPAPI(IppStatus, l9_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) +IPPAPI(IppStatus, y8_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESSetKey_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESSetKey_SM2.c new file mode 100644 index 000000000..d3d47848e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESSetKey_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESStart_SM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESStart_SM2.c new file mode 100644 index 000000000..8fdb22f3d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECESStart_SM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) +IPPAPI(IppStatus, l9_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) +IPPAPI(IppStatus, y8_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECESStart_SM2( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECESStart_SM2( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECESStart_SM2( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECEncryptSM2_Ext.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECEncryptSM2_Ext.c new file mode 100644 index 000000000..547c2e9a5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECEncryptSM2_Ext.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECEncryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsGFpECPoint *pPublicKey, IppsGFpECPoint *pEhpPublicKey, IppsBigNumState *pEphPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECEncryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsGFpECPoint *pPublicKey, IppsGFpECPoint *pEhpPublicKey, IppsBigNumState *pEphPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECEncryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsGFpECPoint *pPublicKey, IppsGFpECPoint *pEhpPublicKey, IppsBigNumState *pEphPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECEncryptSM2_Ext, (Ipp8u *pOut, int maxOutLen, int *pOutSize, const Ipp8u *pInp, int inpLen, const IppsGFpECPoint *pPublicKey, IppsGFpECPoint *pEhpPublicKey, IppsBigNumState *pEphPrvKey, IppsGFpECState *pEC, Ipp8u *pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECEncryptSM2_Ext( pOut, maxOutLen, pOutSize, pInp, inpLen, pPublicKey, pEhpPublicKey, pEphPrvKey, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECEncryptSM2_Ext( pOut, maxOutLen, pOutSize, pInp, inpLen, pPublicKey, pEhpPublicKey, pEphPrvKey, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECEncryptSM2_Ext( pOut, maxOutLen, pOutSize, pInp, inpLen, pPublicKey, pEhpPublicKey, pEphPrvKey, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECEncryptSM2_Ext_EncMsgSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECEncryptSM2_Ext_EncMsgSize.c new file mode 100644 index 000000000..bf3d8dba1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECEncryptSM2_Ext_EncMsgSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECEncryptSM2_Ext_EncMsgSize, (const IppsGFpECState *pEC, int ptMsgSize, int *pSize)) +IPPAPI(IppStatus, l9_ippsGFpECEncryptSM2_Ext_EncMsgSize, (const IppsGFpECState *pEC, int ptMsgSize, int *pSize)) +IPPAPI(IppStatus, y8_ippsGFpECEncryptSM2_Ext_EncMsgSize, (const IppsGFpECState *pEC, int ptMsgSize, int *pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECEncryptSM2_Ext_EncMsgSize, (const IppsGFpECState *pEC, int ptMsgSize, int *pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECEncryptSM2_Ext_EncMsgSize( pEC, ptMsgSize, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECEncryptSM2_Ext_EncMsgSize( pEC, ptMsgSize, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECEncryptSM2_Ext_EncMsgSize( pEC, ptMsgSize, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGet.c new file mode 100644 index 000000000..406f7255c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGet( ppGFp, pA, pB, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGet( ppGFp, pA, pB, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGet( ppGFp, pA, pB, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetInfo_GF.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetInfo_GF.c new file mode 100644 index 000000000..be189da32 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetInfo_GF.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGetInfo_GF( pInfo, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGetInfo_GF( pInfo, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGetInfo_GF( pInfo, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPoint.c new file mode 100644 index 000000000..c3f5dfd4c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPointOctString.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPointOctString.c new file mode 100644 index 000000000..e5ffb8505 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPointOctString.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPointRegular.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPointRegular.c new file mode 100644 index 000000000..7645e5e5d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetPointRegular.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetSize.c new file mode 100644 index 000000000..69ed99f88 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) +IPPAPI(IppStatus, l9_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) +IPPAPI(IppStatus, y8_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGetSize( pGFp, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGetSize( pGFp, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGetSize( pGFp, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetSubgroup.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetSubgroup.c new file mode 100644 index 000000000..4bb0ee2e1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECGetSubgroup.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInit.c new file mode 100644 index 000000000..d582ce813 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInit( pGFp, pA, pB, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInit( pGFp, pA, pB, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInit( pGFp, pA, pB, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd128r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd128r1.c new file mode 100644 index 000000000..92167daab --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd128r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd128r1( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd128r1( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd128r1( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd128r2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd128r2.c new file mode 100644 index 000000000..16ee7450a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd128r2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd128r2( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd128r2( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd128r2( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd192r1.c new file mode 100644 index 000000000..1989171f3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd192r1( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd192r1( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd192r1( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd224r1.c new file mode 100644 index 000000000..82059508c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd224r1( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd224r1( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd224r1( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd256r1.c new file mode 100644 index 000000000..585a9019e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd256r1( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd256r1( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd256r1( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd384r1.c new file mode 100644 index 000000000..376bda965 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd384r1( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd384r1( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd384r1( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd521r1.c new file mode 100644 index 000000000..2d64a508e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStd521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStd521r1( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStd521r1( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStd521r1( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStdBN256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStdBN256.c new file mode 100644 index 000000000..b8b83ff82 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStdBN256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStdBN256( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStdBN256( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStdBN256( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStdSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStdSM2.c new file mode 100644 index 000000000..53de49dd5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECInitStdSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECInitStdSM2( pGFp, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECInitStdSM2( pGFp, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECInitStdSM2( pGFp, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Confirm.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Confirm.c new file mode 100644 index 000000000..f57b8d3d6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Confirm.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECKeyExchangeSM2_Confirm, (const Ipp8u pSPeer[IPP_SM3_DIGEST_BYTESIZE], int* pStatus, IppsGFpECKeyExchangeSM2State* pKE)) +IPPAPI(IppStatus, l9_ippsGFpECKeyExchangeSM2_Confirm, (const Ipp8u pSPeer[IPP_SM3_DIGEST_BYTESIZE], int* pStatus, IppsGFpECKeyExchangeSM2State* pKE)) +IPPAPI(IppStatus, y8_ippsGFpECKeyExchangeSM2_Confirm, (const Ipp8u pSPeer[IPP_SM3_DIGEST_BYTESIZE], int* pStatus, IppsGFpECKeyExchangeSM2State* pKE)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECKeyExchangeSM2_Confirm, (const Ipp8u pSPeer[IPP_SM3_DIGEST_BYTESIZE], int* pStatus, IppsGFpECKeyExchangeSM2State* pKE)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECKeyExchangeSM2_Confirm( pSPeer, pStatus, pKE ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECKeyExchangeSM2_Confirm( pSPeer, pStatus, pKE ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECKeyExchangeSM2_Confirm( pSPeer, pStatus, pKE ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_GetSize.c new file mode 100644 index 000000000..2889695dd --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECKeyExchangeSM2_GetSize, (const IppsGFpECState* pEC, int* pSize)) +IPPAPI(IppStatus, l9_ippsGFpECKeyExchangeSM2_GetSize, (const IppsGFpECState* pEC, int* pSize)) +IPPAPI(IppStatus, y8_ippsGFpECKeyExchangeSM2_GetSize, (const IppsGFpECState* pEC, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECKeyExchangeSM2_GetSize, (const IppsGFpECState* pEC, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECKeyExchangeSM2_GetSize( pEC, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECKeyExchangeSM2_GetSize( pEC, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECKeyExchangeSM2_GetSize( pEC, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Init.c new file mode 100644 index 000000000..3d10f9e57 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECKeyExchangeSM2_Init, (IppsGFpECKeyExchangeSM2State* pKE, IppsKeyExchangeRoleSM2 role, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECKeyExchangeSM2_Init, (IppsGFpECKeyExchangeSM2State* pKE, IppsKeyExchangeRoleSM2 role, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECKeyExchangeSM2_Init, (IppsGFpECKeyExchangeSM2State* pKE, IppsKeyExchangeRoleSM2 role, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECKeyExchangeSM2_Init, (IppsGFpECKeyExchangeSM2State* pKE, IppsKeyExchangeRoleSM2 role, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECKeyExchangeSM2_Init( pKE, role, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECKeyExchangeSM2_Init( pKE, role, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECKeyExchangeSM2_Init( pKE, role, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Setup.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Setup.c new file mode 100644 index 000000000..4882b99d0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_Setup.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECKeyExchangeSM2_Setup, (const Ipp8u pZSelf[IPP_SM3_DIGEST_BYTESIZE], const Ipp8u pZPeer[IPP_SM3_DIGEST_BYTESIZE], const IppsGFpECPoint *pPublicKeySelf, const IppsGFpECPoint *pPublicKeyPeer, const IppsGFpECPoint *pEphPublicKeySelf, const IppsGFpECPoint *pEphPublicKeyPeer, IppsGFpECKeyExchangeSM2State *pKE)) +IPPAPI(IppStatus, l9_ippsGFpECKeyExchangeSM2_Setup, (const Ipp8u pZSelf[IPP_SM3_DIGEST_BYTESIZE], const Ipp8u pZPeer[IPP_SM3_DIGEST_BYTESIZE], const IppsGFpECPoint *pPublicKeySelf, const IppsGFpECPoint *pPublicKeyPeer, const IppsGFpECPoint *pEphPublicKeySelf, const IppsGFpECPoint *pEphPublicKeyPeer, IppsGFpECKeyExchangeSM2State *pKE)) +IPPAPI(IppStatus, y8_ippsGFpECKeyExchangeSM2_Setup, (const Ipp8u pZSelf[IPP_SM3_DIGEST_BYTESIZE], const Ipp8u pZPeer[IPP_SM3_DIGEST_BYTESIZE], const IppsGFpECPoint *pPublicKeySelf, const IppsGFpECPoint *pPublicKeyPeer, const IppsGFpECPoint *pEphPublicKeySelf, const IppsGFpECPoint *pEphPublicKeyPeer, IppsGFpECKeyExchangeSM2State *pKE)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECKeyExchangeSM2_Setup, (const Ipp8u pZSelf[IPP_SM3_DIGEST_BYTESIZE], const Ipp8u pZPeer[IPP_SM3_DIGEST_BYTESIZE], const IppsGFpECPoint *pPublicKeySelf, const IppsGFpECPoint *pPublicKeyPeer, const IppsGFpECPoint *pEphPublicKeySelf, const IppsGFpECPoint *pEphPublicKeyPeer, IppsGFpECKeyExchangeSM2State *pKE)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECKeyExchangeSM2_Setup( pZSelf, pZPeer, pPublicKeySelf, pPublicKeyPeer, pEphPublicKeySelf, pEphPublicKeyPeer, pKE ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECKeyExchangeSM2_Setup( pZSelf, pZPeer, pPublicKeySelf, pPublicKeyPeer, pEphPublicKeySelf, pEphPublicKeyPeer, pKE ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECKeyExchangeSM2_Setup( pZSelf, pZPeer, pPublicKeySelf, pPublicKeyPeer, pEphPublicKeySelf, pEphPublicKeyPeer, pKE ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_SharedKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_SharedKey.c new file mode 100644 index 000000000..1f36a272d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECKeyExchangeSM2_SharedKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECKeyExchangeSM2_SharedKey, (Ipp8u* pSharedKey, int sharedKeySize, Ipp8u* pSSelf, const IppsBigNumState* pPrvKey, IppsBigNumState* pEphPrvKey, IppsGFpECKeyExchangeSM2State *pKE, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECKeyExchangeSM2_SharedKey, (Ipp8u* pSharedKey, int sharedKeySize, Ipp8u* pSSelf, const IppsBigNumState* pPrvKey, IppsBigNumState* pEphPrvKey, IppsGFpECKeyExchangeSM2State *pKE, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECKeyExchangeSM2_SharedKey, (Ipp8u* pSharedKey, int sharedKeySize, Ipp8u* pSSelf, const IppsBigNumState* pPrvKey, IppsBigNumState* pEphPrvKey, IppsGFpECKeyExchangeSM2State *pKE, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECKeyExchangeSM2_SharedKey, (Ipp8u* pSharedKey, int sharedKeySize, Ipp8u* pSSelf, const IppsBigNumState* pPrvKey, IppsBigNumState* pEphPrvKey, IppsGFpECKeyExchangeSM2State *pKE, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECKeyExchangeSM2_SharedKey( pSharedKey, sharedKeySize, pSSelf, pPrvKey, pEphPrvKey, pKE, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECKeyExchangeSM2_SharedKey( pSharedKey, sharedKeySize, pSSelf, pPrvKey, pEphPrvKey, pKE, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECKeyExchangeSM2_SharedKey( pSharedKey, sharedKeySize, pSSelf, pPrvKey, pEphPrvKey, pKE, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMakePoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMakePoint.c new file mode 100644 index 000000000..5e6a0c18a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMakePoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECMakePoint( pX, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECMakePoint( pX, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECMakePoint( pX, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMessageRepresentationSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMessageRepresentationSM2.c new file mode 100644 index 000000000..d98a2038d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMessageRepresentationSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECMessageRepresentationSM2, (IppsBigNumState* pMsgDigest, const Ipp8u* pMsg, int msgLen, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pRegPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECMessageRepresentationSM2, (IppsBigNumState* pMsgDigest, const Ipp8u* pMsg, int msgLen, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pRegPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECMessageRepresentationSM2, (IppsBigNumState* pMsgDigest, const Ipp8u* pMsg, int msgLen, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pRegPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECMessageRepresentationSM2, (IppsBigNumState* pMsgDigest, const Ipp8u* pMsg, int msgLen, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pRegPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECMessageRepresentationSM2( pMsgDigest, pMsg, msgLen, pUserID, userIDLen, pRegPublic, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECMessageRepresentationSM2( pMsgDigest, pMsg, msgLen, pUserID, userIDLen, pRegPublic, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECMessageRepresentationSM2( pMsgDigest, pMsg, msgLen, pUserID, userIDLen, pRegPublic, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMulPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMulPoint.c new file mode 100644 index 000000000..aa30dbf33 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECMulPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECNegPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECNegPoint.c new file mode 100644 index 000000000..fdbea9b24 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECNegPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECNegPoint( pP, pR, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECNegPoint( pP, pR, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECNegPoint( pP, pR, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPointGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPointGetSize.c new file mode 100644 index 000000000..bdbdd0e32 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPointGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) +IPPAPI(IppStatus, l9_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) +IPPAPI(IppStatus, y8_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECPointGetSize( pEC, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECPointGetSize( pEC, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECPointGetSize( pEC, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPointInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPointInit.c new file mode 100644 index 000000000..1c5495930 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPointInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECPointInit( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECPointInit( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECPointInit( pX, pY, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPrivateKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPrivateKey.c new file mode 100644 index 000000000..8140f4bb4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPrivateKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPublicKey.c new file mode 100644 index 000000000..b0e851568 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECPublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECScratchBufferSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECScratchBufferSize.c new file mode 100644 index 000000000..25e21b076 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECScratchBufferSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) +IPPAPI(IppStatus, l9_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) +IPPAPI(IppStatus, y8_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSet.c new file mode 100644 index 000000000..6e6961b04 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSet( pA, pB, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSet( pA, pB, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSet( pA, pB, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPoint.c new file mode 100644 index 000000000..1680a601b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointAtInfinity.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointAtInfinity.c new file mode 100644 index 000000000..6b198143a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointAtInfinity.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointAtInfinity( pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointAtInfinity( pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointAtInfinity( pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHash.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHash.c new file mode 100644 index 000000000..f6a8948ec --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHash.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHashBackCompatible.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHashBackCompatible.c new file mode 100644 index 000000000..4ace24968 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHashBackCompatible.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHashBackCompatible_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHashBackCompatible_rmf.c new file mode 100644 index 000000000..59973e41a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHashBackCompatible_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHash_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHash_rmf.c new file mode 100644 index 000000000..654156148 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointHash_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointOctString.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointOctString.c new file mode 100644 index 000000000..d64f9e4f7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointOctString.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointRandom.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointRandom.c new file mode 100644 index 000000000..5c6b7b891 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointRandom.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointRegular.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointRegular.c new file mode 100644 index 000000000..3f6fbbcf4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetPointRegular.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetSubgroup.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetSubgroup.c new file mode 100644 index 000000000..dea90103d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSetSubgroup.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSharedSecretDH.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSharedSecretDH.c new file mode 100644 index 000000000..bc645bea4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSharedSecretDH.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSharedSecretDHC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSharedSecretDHC.c new file mode 100644 index 000000000..318ca5706 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSharedSecretDHC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignDSA.c new file mode 100644 index 000000000..e4228f723 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignNR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignNR.c new file mode 100644 index 000000000..d03150332 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignNR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSignNR, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSignNR, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSignNR, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSignNR, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignSM2.c new file mode 100644 index 000000000..c2bc626ab --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECSignSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECSignSM2, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECSignSM2, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECSignSM2, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECSignSM2, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstKeyPair.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstKeyPair.c new file mode 100644 index 000000000..5c86a9cdd --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstKeyPair.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstPoint.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstPoint.c new file mode 100644 index 000000000..1ae5e0d5b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstPoint.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) +IPPAPI(IppStatus, l9_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) +IPPAPI(IppStatus, y8_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECTstPoint( pP, pResult, pEC ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECTstPoint( pP, pResult, pEC ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECTstPoint( pP, pResult, pEC ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstPointInSubgroup.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstPointInSubgroup.c new file mode 100644 index 000000000..f95328d3e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECTstPointInSubgroup.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECUserIDHashSM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECUserIDHashSM2.c new file mode 100644 index 000000000..96ad52269 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECUserIDHashSM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECUserIDHashSM2, (Ipp8u* pZaDigest, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pPublicKey, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECUserIDHashSM2, (Ipp8u* pZaDigest, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pPublicKey, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECUserIDHashSM2, (Ipp8u* pZaDigest, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pPublicKey, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECUserIDHashSM2, (Ipp8u* pZaDigest, const Ipp8u* pUserID, int userIDLen, const IppsGFpECPoint* pPublicKey, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECUserIDHashSM2( pZaDigest, pUserID, userIDLen, pPublicKey, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECUserIDHashSM2( pZaDigest, pUserID, userIDLen, pPublicKey, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECUserIDHashSM2( pZaDigest, pUserID, userIDLen, pPublicKey, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerify.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerify.c new file mode 100644 index 000000000..1c295152c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerify.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifyDSA.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifyDSA.c new file mode 100644 index 000000000..1ce8d5b44 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifyDSA.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECVerifyDSA, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECVerifyDSA, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECVerifyDSA, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECVerifyDSA, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifyNR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifyNR.c new file mode 100644 index 000000000..cd26ad18c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifyNR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECVerifyNR, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECVerifyNR, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECVerifyNR, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECVerifyNR, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifySM2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifySM2.c new file mode 100644 index 000000000..7bc0126a0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpECVerifySM2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpECVerifySM2, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpECVerifySM2, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpECVerifySM2, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpECVerifySM2, (const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpElementGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpElementGetSize.c new file mode 100644 index 000000000..7b39871b9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpElementGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) +IPPAPI(IppStatus, l9_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) +IPPAPI(IppStatus, y8_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpElementGetSize( pGFp, pElementSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpElementGetSize( pGFp, pElementSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpElementGetSize( pGFp, pElementSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpElementInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpElementInit.c new file mode 100644 index 000000000..0669cb1ad --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpElementInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpElementInit( pA, lenA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpElementInit( pA, lenA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpElementInit( pA, lenA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpExp.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpExp.c new file mode 100644 index 000000000..e628e90f0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpExp.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetElement.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetElement.c new file mode 100644 index 000000000..90b984acd --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetElement.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetElementOctString.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetElementOctString.c new file mode 100644 index 000000000..66a24ab87 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetElementOctString.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetInfo.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetInfo.c new file mode 100644 index 000000000..51dd52782 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetInfo.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpGetInfo( pInfo, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpGetInfo( pInfo, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpGetInfo( pInfo, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetSize.c new file mode 100644 index 000000000..9217a63a2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpGetSize, (int feBitSize, int* pSize)) +IPPAPI(IppStatus, l9_ippsGFpGetSize, (int feBitSize, int* pSize)) +IPPAPI(IppStatus, y8_ippsGFpGetSize, (int feBitSize, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpGetSize, (int feBitSize, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpGetSize( feBitSize, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpGetSize( feBitSize, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpGetSize( feBitSize, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInit.c new file mode 100644 index 000000000..e89c22bf0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInitArbitrary.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInitArbitrary.c new file mode 100644 index 000000000..1c2660e8a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInitArbitrary.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInitFixed.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInitFixed.c new file mode 100644 index 000000000..b446c1af2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInitFixed.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInv.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInv.c new file mode 100644 index 000000000..9eaf47650 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpInv.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpInv( pA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpInv( pA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpInv( pA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpIsUnityElement.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpIsUnityElement.c new file mode 100644 index 000000000..a14ba7c80 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpIsUnityElement.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpIsUnityElement( pA, pResult, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpIsUnityElement( pA, pResult, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpIsUnityElement( pA, pResult, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpIsZeroElement.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpIsZeroElement.c new file mode 100644 index 000000000..c892ebc05 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpIsZeroElement.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpIsZeroElement( pA, pResult, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpIsZeroElement( pA, pResult, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpIsZeroElement( pA, pResult, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p192r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p192r1.c new file mode 100644 index 000000000..2fb95de19 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p192r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p192r1, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p192r1, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p192r1, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p192r1, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p192r1( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p192r1( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p192r1( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p224r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p224r1.c new file mode 100644 index 000000000..aa0fa6bad --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p224r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p224r1, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p224r1, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p224r1, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p224r1, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p224r1( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p224r1( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p224r1( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256.c new file mode 100644 index 000000000..cbcaa6e06 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p256, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p256( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p256( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p256( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256bn.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256bn.c new file mode 100644 index 000000000..5ffaa507a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256bn.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256bn, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256bn, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256bn, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p256bn, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p256bn( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p256bn( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p256bn( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256r1.c new file mode 100644 index 000000000..8168b3540 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256r1, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256r1, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256r1, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p256r1, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p256r1( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p256r1( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p256r1( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256sm2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256sm2.c new file mode 100644 index 000000000..0967af995 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p256sm2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256sm2,(void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256sm2,(void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256sm2,(void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p256sm2,(void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p256sm2( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p256sm2( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p256sm2( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p384r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p384r1.c new file mode 100644 index 000000000..572eee4f4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p384r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p384r1, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p384r1, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p384r1, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p384r1, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p384r1( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p384r1( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p384r1( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p521r1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p521r1.c new file mode 100644 index 000000000..5e8ce6f6e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_p521r1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p521r1, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p521r1, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p521r1, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_p521r1, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_p521r1( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_p521r1( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_p521r1( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_pArb.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_pArb.c new file mode 100644 index 000000000..db3914725 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMethod_pArb.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_pArb, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_pArb, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_pArb, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpMethod_pArb, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMethod_pArb( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMethod_pArb( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMethod_pArb( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMul.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMul.c new file mode 100644 index 000000000..61bd884c2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMul.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMul( pA, pB, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMul( pA, pB, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMul( pA, pB, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMul_PE.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMul_PE.c new file mode 100644 index 000000000..641752df7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMul_PE.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMultiExp.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMultiExp.c new file mode 100644 index 000000000..32ba1bf9e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpMultiExp.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpNeg.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpNeg.c new file mode 100644 index 000000000..7a50ef285 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpNeg.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpNeg( pA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpNeg( pA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpNeg( pA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpScratchBufferSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpScratchBufferSize.c new file mode 100644 index 000000000..f8672b395 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpScratchBufferSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) +IPPAPI(IppStatus, l9_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) +IPPAPI(IppStatus, y8_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElement.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElement.c new file mode 100644 index 000000000..fad6aae00 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElement.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSetElement( pA, lenA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSetElement( pA, lenA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSetElement( pA, lenA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementHash.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementHash.c new file mode 100644 index 000000000..f0c92ccb4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementHash.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) +IPPAPI(IppStatus, l9_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) +IPPAPI(IppStatus, y8_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementHash_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementHash_rmf.c new file mode 100644 index 000000000..e7c99d2d4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementHash_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementOctString.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementOctString.c new file mode 100644 index 000000000..bd8d1476f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementOctString.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementRandom.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementRandom.c new file mode 100644 index 000000000..192259705 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementRandom.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementRegular.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementRegular.c new file mode 100644 index 000000000..41e80c601 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSetElementRegular.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSetElementRegular( pBN, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSetElementRegular( pBN, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSetElementRegular( pBN, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSqr.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSqr.c new file mode 100644 index 000000000..4d62f4ba8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSqr.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSqr( pA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSqr( pA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSqr( pA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSqrt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSqrt.c new file mode 100644 index 000000000..4b2ae0d49 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSqrt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSqrt( pA, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSqrt( pA, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSqrt( pA, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSub.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSub.c new file mode 100644 index 000000000..7af4d6863 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSub.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSub( pA, pB, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSub( pA, pB, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSub( pA, pB, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSub_PE.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSub_PE.c new file mode 100644 index 000000000..964830f6f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpSub_PE.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, l9_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +IPPAPI(IppStatus, y8_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxGetSize.c new file mode 100644 index 000000000..50d443bdc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) +IPPAPI(IppStatus, l9_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) +IPPAPI(IppStatus, y8_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxGetSize( pGroundGF, degree, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxGetSize( pGroundGF, degree, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxGetSize( pGroundGF, degree, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxInit.c new file mode 100644 index 000000000..b5b8853b9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) +IPPAPI(IppStatus, l9_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) +IPPAPI(IppStatus, y8_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxInitBinomial.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxInitBinomial.c new file mode 100644 index 000000000..5095c9cbc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxInitBinomial.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) +IPPAPI(IppStatus, l9_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) +IPPAPI(IppStatus, y8_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) + +IPPFUN(IppStatus, sgx_disp_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom.c new file mode 100644 index 000000000..7c0f894e1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpxMethod_binom, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxMethod_binom( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxMethod_binom( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxMethod_binom( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom2.c new file mode 100644 index 000000000..615633268 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom2, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom2, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom2, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpxMethod_binom2, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxMethod_binom2( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxMethod_binom2( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxMethod_binom2( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom2_epid2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom2_epid2.c new file mode 100644 index 000000000..47124df67 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom2_epid2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom2_epid2,(void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom2_epid2,(void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom2_epid2,(void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpxMethod_binom2_epid2,(void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxMethod_binom2_epid2( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxMethod_binom2_epid2( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxMethod_binom2_epid2( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom3.c new file mode 100644 index 000000000..72f68e39e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom3, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom3, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom3, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpxMethod_binom3, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxMethod_binom3( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxMethod_binom3( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxMethod_binom3( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom3_epid2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom3_epid2.c new file mode 100644 index 000000000..7ddcca3f9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_binom3_epid2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom3_epid2,(void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom3_epid2,(void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom3_epid2,(void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpxMethod_binom3_epid2,(void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxMethod_binom3_epid2( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxMethod_binom3_epid2( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxMethod_binom3_epid2( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_com.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_com.c new file mode 100644 index 000000000..5abfc2002 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGFpxMethod_com.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_com, (void) ) +IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_com, (void) ) +IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_com, (void) ) + +IPPFUN( const IppsGFpMethod*, sgx_disp_ippsGFpxMethod_com, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGFpxMethod_com( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGFpxMethod_com( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGFpxMethod_com( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGcd_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGcd_BN.c new file mode 100644 index 000000000..885b309a4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGcd_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) +IPPAPI(IppStatus, l9_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) +IPPAPI(IppStatus, y8_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) + +IPPFUN(IppStatus, sgx_disp_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGcd_BN( pA, pB, pGCD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGcd_BN( pA, pB, pGCD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGcd_BN( pA, pB, pGCD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGetOctString_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGetOctString_BN.c new file mode 100644 index 000000000..50cae0536 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGetOctString_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGetOctString_BN( pStr, strLen, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGetOctString_BN( pStr, strLen, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGetOctString_BN( pStr, strLen, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGetSize_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGetSize_BN.c new file mode 100644 index 000000000..3df66c04d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGetSize_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) +IPPAPI(IppStatus, l9_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) +IPPAPI(IppStatus, y8_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGetSize_BN( pBN, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGetSize_BN( pBN, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGetSize_BN( pBN, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGet_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGet_BN.c new file mode 100644 index 000000000..c9ad5a8a1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsGet_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsGet_BN( pSgn, pLength, pData, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsGet_BN( pSgn, pLength, pData, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsGet_BN( pSgn, pLength, pData, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACDuplicate_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACDuplicate_rmf.c new file mode 100644 index 000000000..f569c4a91 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACDuplicate_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) +IPPAPI(IppStatus, l9_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) +IPPAPI(IppStatus, y8_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACFinal_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACFinal_rmf.c new file mode 100644 index 000000000..8e258d309 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACFinal_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, l9_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, y8_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACGetSize_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACGetSize_rmf.c new file mode 100644 index 000000000..8da676a7b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACGetSize_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACGetSize_rmf,(int* pSize)) +IPPAPI(IppStatus, l9_ippsHMACGetSize_rmf,(int* pSize)) +IPPAPI(IppStatus, y8_ippsHMACGetSize_rmf,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACGetSize_rmf,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACGetSize_rmf( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACGetSize_rmf( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACGetSize_rmf( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACGetTag_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACGetTag_rmf.c new file mode 100644 index 000000000..e5b963e14 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACGetTag_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, l9_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, y8_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACInit_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACInit_rmf.c new file mode 100644 index 000000000..8fd83e1ca --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACInit_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACMessage_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACMessage_rmf.c new file mode 100644 index 000000000..c98315c19 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACMessage_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACPack_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACPack_rmf.c new file mode 100644 index 000000000..98aea09f4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACPack_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, l9_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, y8_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACUnpack_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACUnpack_rmf.c new file mode 100644 index 000000000..0718ed4fb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACUnpack_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, l9_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, y8_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACUnpack_rmf( pBuffer, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACUnpack_rmf( pBuffer, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACUnpack_rmf( pBuffer, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACUpdate_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACUpdate_rmf.c new file mode 100644 index 000000000..ef6ad5250 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMACUpdate_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, l9_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) +IPPAPI(IppStatus, y8_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMACUpdate_rmf( pSrc, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMACUpdate_rmf( pSrc, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMACUpdate_rmf( pSrc, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Duplicate.c new file mode 100644 index 000000000..12d034f5a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) +IPPAPI(IppStatus, l9_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) +IPPAPI(IppStatus, y8_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Final.c new file mode 100644 index 000000000..2149a3e1a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) +IPPAPI(IppStatus, l9_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) +IPPAPI(IppStatus, y8_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Final( pMD, mdLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Final( pMD, mdLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Final( pMD, mdLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_GetSize.c new file mode 100644 index 000000000..27737af6f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsHMAC_GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsHMAC_GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_GetTag.c new file mode 100644 index 000000000..d6e860b68 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) +IPPAPI(IppStatus, l9_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) +IPPAPI(IppStatus, y8_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_GetTag( pMD, mdLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_GetTag( pMD, mdLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_GetTag( pMD, mdLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Init.c new file mode 100644 index 000000000..f4d882da2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, l9_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, y8_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Message.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Message.c new file mode 100644 index 000000000..e6eba4eb6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Message.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, l9_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, y8_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Pack.c new file mode 100644 index 000000000..ef5c8c73c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, l9_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, y8_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Unpack.c new file mode 100644 index 000000000..ff388771b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) +IPPAPI(IppStatus, l9_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) +IPPAPI(IppStatus, y8_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Unpack( pBuffer, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Unpack( pBuffer, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Unpack( pBuffer, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Update.c new file mode 100644 index 000000000..39cd5878e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHMAC_Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) +IPPAPI(IppStatus, l9_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) +IPPAPI(IppStatus, y8_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHMAC_Update( pSrc, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHMAC_Update( pSrc, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHMAC_Update( pSrc, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashDuplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashDuplicate.c new file mode 100644 index 000000000..4d73af125 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashDuplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) +IPPAPI(IppStatus, l9_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) +IPPAPI(IppStatus, y8_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashDuplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashDuplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashDuplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashDuplicate_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashDuplicate_rmf.c new file mode 100644 index 000000000..5c64ca44c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashDuplicate_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) +IPPAPI(IppStatus, l9_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) +IPPAPI(IppStatus, y8_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashDuplicate_rmf( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashDuplicate_rmf( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashDuplicate_rmf( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashFinal.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashFinal.c new file mode 100644 index 000000000..0884187d8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashFinal.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) +IPPAPI(IppStatus, l9_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) +IPPAPI(IppStatus, y8_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashFinal( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashFinal( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashFinal( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashFinal_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashFinal_rmf.c new file mode 100644 index 000000000..59f7825d7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashFinal_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) +IPPAPI(IppStatus, l9_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) +IPPAPI(IppStatus, y8_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashFinal_rmf( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashFinal_rmf( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashFinal_rmf( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetInfo_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetInfo_rmf.c new file mode 100644 index 000000000..603af841f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetInfo_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) +IPPAPI(IppStatus, l9_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) +IPPAPI(IppStatus, y8_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashGetInfo_rmf( pInfo, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashGetInfo_rmf( pInfo, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashGetInfo_rmf( pInfo, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetSize.c new file mode 100644 index 000000000..ac7e3250a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashGetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsHashGetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsHashGetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHashGetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetSize_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetSize_rmf.c new file mode 100644 index 000000000..2f12eadfc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetSize_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashGetSize_rmf,(int* pSize)) +IPPAPI(IppStatus, l9_ippsHashGetSize_rmf,(int* pSize)) +IPPAPI(IppStatus, y8_ippsHashGetSize_rmf,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHashGetSize_rmf,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashGetSize_rmf( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashGetSize_rmf( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashGetSize_rmf( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetTag.c new file mode 100644 index 000000000..a8a93d774 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) +IPPAPI(IppStatus, l9_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) +IPPAPI(IppStatus, y8_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashGetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashGetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashGetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetTag_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetTag_rmf.c new file mode 100644 index 000000000..bbd8e764d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashGetTag_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) +IPPAPI(IppStatus, l9_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) +IPPAPI(IppStatus, y8_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashGetTag_rmf( pMD, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashGetTag_rmf( pMD, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashGetTag_rmf( pMD, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashInit.c new file mode 100644 index 000000000..20431a58e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, l9_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, y8_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) + +IPPFUN(IppStatus, sgx_disp_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashInit( pState, hashAlg ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashInit( pState, hashAlg ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashInit( pState, hashAlg ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashInit_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashInit_rmf.c new file mode 100644 index 000000000..cb2eacb63 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashInit_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashInit_rmf( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashInit_rmf( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashInit_rmf( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMessage.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMessage.c new file mode 100644 index 000000000..e350c8b4e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMessage.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, l9_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, y8_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) + +IPPFUN(IppStatus, sgx_disp_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMessage( pMsg, len, pMD, hashAlg ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMessage( pMsg, len, pMD, hashAlg ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMessage( pMsg, len, pMD, hashAlg ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMessage_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMessage_rmf.c new file mode 100644 index 000000000..1c6f4fdde --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMessage_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodGetInfo.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodGetInfo.c new file mode 100644 index 000000000..49855124a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodGetInfo.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodGetInfo( pInfo, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodGetInfo( pInfo, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodGetInfo( pInfo, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodGetSize.c new file mode 100644 index 000000000..1d82cab89 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodGetSize, (int* pSize) ) +IPPAPI( IppStatus, l9_ippsHashMethodGetSize, (int* pSize) ) +IPPAPI( IppStatus, y8_ippsHashMethodGetSize, (int* pSize) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodGetSize, (int* pSize) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_MD5.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_MD5.c new file mode 100644 index 000000000..55e28d14b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_MD5.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_MD5( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_MD5( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_MD5( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1.c new file mode 100644 index 000000000..1b82fd7d0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA1( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA1( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA1( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1_NI.c new file mode 100644 index 000000000..a81067c0d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA1_NI( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA1_NI( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA1_NI( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1_TT.c new file mode 100644 index 000000000..55f9e416b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA1_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA1_TT( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA1_TT( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA1_TT( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224.c new file mode 100644 index 000000000..9a86c13b7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA224( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA224( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA224( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224_NI.c new file mode 100644 index 000000000..79186d59a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA224_NI( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA224_NI( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA224_NI( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224_TT.c new file mode 100644 index 000000000..ac57a19f9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA224_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA224_TT( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA224_TT( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA224_TT( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256.c new file mode 100644 index 000000000..a0dd3df48 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA256( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA256( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA256( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256_NI.c new file mode 100644 index 000000000..6f62c601c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA256_NI( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA256_NI( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA256_NI( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256_TT.c new file mode 100644 index 000000000..2315646a1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA256_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA256_TT( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA256_TT( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA256_TT( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA384.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA384.c new file mode 100644 index 000000000..6eab7d3c6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA384.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA384( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA384( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA384( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512.c new file mode 100644 index 000000000..d46f08d1c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA512( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA512( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA512( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512_224.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512_224.c new file mode 100644 index 000000000..3500b6548 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512_224.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA512_224( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA512_224( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA512_224( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512_256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512_256.c new file mode 100644 index 000000000..15f1a3b36 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SHA512_256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SHA512_256( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SHA512_256( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SHA512_256( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SM3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SM3.c new file mode 100644 index 000000000..8e1ef35d6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethodSet_SM3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethodSet_SM3( pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethodSet_SM3( pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethodSet_SM3( pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_MD5.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_MD5.c new file mode 100644 index 000000000..8f1acf2c5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_MD5.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_MD5, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_MD5, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_MD5, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_MD5, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_MD5( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_MD5( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_MD5( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1.c new file mode 100644 index 000000000..a7b3810c0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA1, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA1, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA1, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA1, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA1( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA1( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA1( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1_NI.c new file mode 100644 index 000000000..a84bde762 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA1_NI, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA1_NI, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA1_NI, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA1_NI, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA1_NI( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA1_NI( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA1_NI( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1_TT.c new file mode 100644 index 000000000..32d4f1bb0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA1_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA1_TT, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA1_TT, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA1_TT, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA1_TT, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA1_TT( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA1_TT( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA1_TT( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224.c new file mode 100644 index 000000000..47b8b22d9 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA224, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA224, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA224, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA224, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA224( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA224( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA224( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224_NI.c new file mode 100644 index 000000000..37d70475d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA224_NI, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA224_NI, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA224_NI, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA224_NI, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA224_NI( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA224_NI( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA224_NI( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224_TT.c new file mode 100644 index 000000000..64a56a020 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA224_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA224_TT, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA224_TT, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA224_TT, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA224_TT, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA224_TT( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA224_TT( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA224_TT( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256.c new file mode 100644 index 000000000..ce118ef98 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA256, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA256, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA256, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA256, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA256( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA256( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA256( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256_NI.c new file mode 100644 index 000000000..938954dfb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA256_NI, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA256_NI, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA256_NI, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA256_NI, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA256_NI( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA256_NI( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA256_NI( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256_TT.c new file mode 100644 index 000000000..0bd67389b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA256_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA256_TT, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA256_TT, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA256_TT, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA256_TT, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA256_TT( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA256_TT( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA256_TT( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA384.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA384.c new file mode 100644 index 000000000..7c77b1309 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA384.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA384, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA384, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA384, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA384, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA384( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA384( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA384( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512.c new file mode 100644 index 000000000..aa774b47f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA512, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA512, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA512, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA512, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA512( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA512( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA512( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512_224.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512_224.c new file mode 100644 index 000000000..b090f0dcc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512_224.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA512_224, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA512_224, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA512_224, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA512_224, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA512_224( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA512_224( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA512_224( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512_256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512_256.c new file mode 100644 index 000000000..fb1cd7bd0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SHA512_256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA512_256, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA512_256, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA512_256, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SHA512_256, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SHA512_256( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SHA512_256( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SHA512_256( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SM3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SM3.c new file mode 100644 index 000000000..81b8e1720 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashMethod_SM3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SM3, (void) ) +IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SM3, (void) ) +IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SM3, (void) ) + +IPPFUN( const IppsHashMethod*, sgx_disp_ippsHashMethod_SM3, (void) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashMethod_SM3( ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashMethod_SM3( ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashMethod_SM3( ); + } else + return NULL; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashPack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashPack.c new file mode 100644 index 000000000..838baca79 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashPack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, l9_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, y8_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashPack( pState, pBuffer, bufSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashPack( pState, pBuffer, bufSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashPack( pState, pBuffer, bufSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashPack_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashPack_rmf.c new file mode 100644 index 000000000..ff37a744b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashPack_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, l9_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) +IPPAPI(IppStatus, y8_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) + +IPPFUN(IppStatus, sgx_disp_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashPack_rmf( pState, pBuffer, bufSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashPack_rmf( pState, pBuffer, bufSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashPack_rmf( pState, pBuffer, bufSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224.c new file mode 100644 index 000000000..39630722e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA224( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA224( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA224( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224_NI.c new file mode 100644 index 000000000..c856dd0a2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA224_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA224_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA224_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA224_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA224_NI( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA224_NI( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA224_NI( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224_TT.c new file mode 100644 index 000000000..db94f24a2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA224_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA224_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA224_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA224_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA224_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA224_TT( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA224_TT( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA224_TT( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256.c new file mode 100644 index 000000000..78cebdff4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA256( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA256( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA256( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256_NI.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256_NI.c new file mode 100644 index 000000000..e9e8358f5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256_NI.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA256_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA256_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA256_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA256_NI, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA256_NI( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA256_NI( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA256_NI( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256_TT.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256_TT.c new file mode 100644 index 000000000..ad6ef2956 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA256_TT.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA256_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA256_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA256_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA256_TT, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA256_TT( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA256_TT( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA256_TT( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA384.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA384.c new file mode 100644 index 000000000..f8218e9b7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA384.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA384, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA384, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA384, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA384, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA384( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA384( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA384( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512.c new file mode 100644 index 000000000..dd4b43dc4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA512, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA512, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA512, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA512, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA512( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA512( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA512( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512_224.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512_224.c new file mode 100644 index 000000000..4b321ee06 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512_224.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA512_224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA512_224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA512_224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA512_224, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA512_224( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA512_224( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA512_224( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512_256.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512_256.c new file mode 100644 index 000000000..dd4196db5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SHA512_256.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SHA512_256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SHA512_256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SHA512_256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SHA512_256, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SHA512_256( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SHA512_256( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SHA512_256( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SM3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SM3.c new file mode 100644 index 000000000..fc8a7396f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashStateMethodSet_SM3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI( IppStatus, k1_ippsHashStateMethodSet_SM3, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, l9_ippsHashStateMethodSet_SM3, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +IPPAPI( IppStatus, y8_ippsHashStateMethodSet_SM3, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) + +IPPFUN( IppStatus, sgx_disp_ippsHashStateMethodSet_SM3, (IppsHashState_rmf* pState, IppsHashMethod* pMethod) ) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashStateMethodSet_SM3( pState, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashStateMethodSet_SM3( pState, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashStateMethodSet_SM3( pState, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUnpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUnpack.c new file mode 100644 index 000000000..6dd3ba3d8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUnpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) +IPPAPI(IppStatus, l9_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) +IPPAPI(IppStatus, y8_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashUnpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashUnpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashUnpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUnpack_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUnpack_rmf.c new file mode 100644 index 000000000..8a142d62a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUnpack_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) +IPPAPI(IppStatus, l9_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) +IPPAPI(IppStatus, y8_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashUnpack_rmf( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashUnpack_rmf( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashUnpack_rmf( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUpdate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUpdate.c new file mode 100644 index 000000000..1708a7f5f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUpdate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) +IPPAPI(IppStatus, l9_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) +IPPAPI(IppStatus, y8_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashUpdate( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashUpdate( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashUpdate( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUpdate_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUpdate_rmf.c new file mode 100644 index 000000000..291444f0f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsHashUpdate_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) +IPPAPI(IppStatus, l9_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) +IPPAPI(IppStatus, y8_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsHashUpdate_rmf( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsHashUpdate_rmf( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsHashUpdate_rmf( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMAC_BN_I.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMAC_BN_I.c new file mode 100644 index 000000000..df35c0e33 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMAC_BN_I.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMAC_BN_I( pA, pB, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMAC_BN_I( pA, pB, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMAC_BN_I( pA, pB, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Duplicate.c new file mode 100644 index 000000000..e40a5122d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) +IPPAPI(IppStatus, l9_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) +IPPAPI(IppStatus, y8_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Final.c new file mode 100644 index 000000000..2c10b8f25 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) +IPPAPI(IppStatus, l9_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) +IPPAPI(IppStatus, y8_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5GetSize.c new file mode 100644 index 000000000..662512216 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsMD5GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsMD5GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5GetTag.c new file mode 100644 index 000000000..dce8b00b4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) +IPPAPI(IppStatus, l9_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) +IPPAPI(IppStatus, y8_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Init.c new file mode 100644 index 000000000..facf95149 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5Init,(IppsMD5State* pState)) +IPPAPI(IppStatus, l9_ippsMD5Init,(IppsMD5State* pState)) +IPPAPI(IppStatus, y8_ippsMD5Init,(IppsMD5State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5Init,(IppsMD5State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5MessageDigest.c new file mode 100644 index 000000000..16cf2eefc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Pack.c new file mode 100644 index 000000000..e92a3d077 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Unpack.c new file mode 100644 index 000000000..a771838a6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) +IPPAPI(IppStatus, l9_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) +IPPAPI(IppStatus, y8_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Update.c new file mode 100644 index 000000000..5de972334 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMD5Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) +IPPAPI(IppStatus, l9_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) +IPPAPI(IppStatus, y8_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMD5Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMD5Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMD5Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF.c new file mode 100644 index 000000000..cd125e5fa --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, l9_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) +IPPAPI(IppStatus, y8_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) + +IPPFUN(IppStatus, sgx_disp_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF1_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF1_rmf.c new file mode 100644 index 000000000..7580ded2e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF1_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF2_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF2_rmf.c new file mode 100644 index 000000000..cdcb2fcd0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMGF2_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, l9_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) +IPPAPI(IppStatus, y8_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) + +IPPFUN(IppStatus, sgx_disp_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsModInv_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsModInv_BN.c new file mode 100644 index 000000000..5e6c9fa97 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsModInv_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) +IPPAPI(IppStatus, l9_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) +IPPAPI(IppStatus, y8_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) + +IPPFUN(IppStatus, sgx_disp_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsModInv_BN( pA, pM, pInv ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsModInv_BN( pA, pM, pInv ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsModInv_BN( pA, pM, pInv ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMod_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMod_BN.c new file mode 100644 index 000000000..f2499a29c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMod_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMod_BN( pA, pM, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMod_BN( pA, pM, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMod_BN( pA, pM, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontExp.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontExp.c new file mode 100644 index 000000000..fac540ba3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontExp.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontExp( pA, pE, m, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontExp( pA, pE, m, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontExp( pA, pE, m, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontForm.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontForm.c new file mode 100644 index 000000000..e8b0f8b26 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontForm.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontForm( pA, pCtx, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontForm( pA, pCtx, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontForm( pA, pCtx, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontGet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontGet.c new file mode 100644 index 000000000..c4f3fdfaf --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontGet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) +IPPAPI(IppStatus, l9_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) +IPPAPI(IppStatus, y8_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontGet( pModulo, pSize, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontGet( pModulo, pSize, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontGet( pModulo, pSize, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontGetSize.c new file mode 100644 index 000000000..887076099 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) +IPPAPI(IppStatus, l9_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) +IPPAPI(IppStatus, y8_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontGetSize( method, length, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontGetSize( method, length, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontGetSize( method, length, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontInit.c new file mode 100644 index 000000000..a6e4b080f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) +IPPAPI(IppStatus, l9_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) +IPPAPI(IppStatus, y8_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontInit( method, length, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontInit( method, length, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontInit( method, length, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontMul.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontMul.c new file mode 100644 index 000000000..296d322cc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontMul.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontMul( pA, pB, m, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontMul( pA, pB, m, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontMul( pA, pB, m, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontSet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontSet.c new file mode 100644 index 000000000..df84d94e8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMontSet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) +IPPAPI(IppStatus, l9_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) +IPPAPI(IppStatus, y8_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMontSet( pModulo, size, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMontSet( pModulo, size, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMontSet( pModulo, size, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMul_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMul_BN.c new file mode 100644 index 000000000..0f51bf4ab --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsMul_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsMul_BN( pA, pB, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsMul_BN( pA, pB, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsMul_BN( pA, pB, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGGetSeed.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGGetSeed.c new file mode 100644 index 000000000..6e8e0b807 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGGetSeed.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) +IPPAPI(IppStatus, l9_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) +IPPAPI(IppStatus, y8_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGGetSeed( pCtx, pSeed ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGGetSeed( pCtx, pSeed ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGGetSeed( pCtx, pSeed ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGGetSize.c new file mode 100644 index 000000000..9d0c0ab4c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGGetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsPRNGGetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsPRNGGetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGGetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGInit.c new file mode 100644 index 000000000..a7423800d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGInit( seedBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGInit( seedBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGInit( seedBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetAugment.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetAugment.c new file mode 100644 index 000000000..93a2aa429 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetAugment.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGSetAugment( pAug, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGSetAugment( pAug, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGSetAugment( pAug, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetH0.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetH0.c new file mode 100644 index 000000000..79880e740 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetH0.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGSetH0( pH0, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGSetH0( pH0, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGSetH0( pH0, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetModulus.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetModulus.c new file mode 100644 index 000000000..938e4182c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetModulus.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGSetModulus( pMod, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGSetModulus( pMod, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGSetModulus( pMod, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetSeed.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetSeed.c new file mode 100644 index 000000000..64441f1ab --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGSetSeed.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGSetSeed( pSeed, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGSetSeed( pSeed, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGSetSeed( pSeed, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGen.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGen.c new file mode 100644 index 000000000..0f54d9227 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGen.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGen( pRand, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGen( pRand, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGen( pRand, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGenRDRAND.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGenRDRAND.c new file mode 100644 index 000000000..7723ae488 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGenRDRAND.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGenRDRAND( pRand, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGenRDRAND( pRand, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGenRDRAND( pRand, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGenRDRAND_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGenRDRAND_BN.c new file mode 100644 index 000000000..d2cb38bc1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGenRDRAND_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGen_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGen_BN.c new file mode 100644 index 000000000..5f59ea47a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPRNGen_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, l9_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, y8_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPRNGen_BN( pRand, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPRNGen_BN( pRand, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPRNGen_BN( pRand, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGen.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGen.c new file mode 100644 index 000000000..dbfca4823 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGen.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGen_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGen_BN.c new file mode 100644 index 000000000..4d368b5a8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGen_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGet.c new file mode 100644 index 000000000..ee0c46b1e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) +IPPAPI(IppStatus, l9_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) +IPPAPI(IppStatus, y8_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeGet( pPrime, pLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeGet( pPrime, pLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeGet( pPrime, pLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGetSize.c new file mode 100644 index 000000000..69926e62b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeGetSize,(int nMaxBits, int* pSize)) +IPPAPI(IppStatus, l9_ippsPrimeGetSize,(int nMaxBits, int* pSize)) +IPPAPI(IppStatus, y8_ippsPrimeGetSize,(int nMaxBits, int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeGetSize,(int nMaxBits, int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeGetSize( nMaxBits, pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeGetSize( nMaxBits, pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeGetSize( nMaxBits, pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGet_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGet_BN.c new file mode 100644 index 000000000..ff4b9a51f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeGet_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) +IPPAPI(IppStatus, l9_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) +IPPAPI(IppStatus, y8_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeGet_BN( pPrime, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeGet_BN( pPrime, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeGet_BN( pPrime, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeInit.c new file mode 100644 index 000000000..6ceb594a6 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) +IPPAPI(IppStatus, l9_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) +IPPAPI(IppStatus, y8_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeInit( nMaxBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeInit( nMaxBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeInit( nMaxBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeSet.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeSet.c new file mode 100644 index 000000000..8a4c22008 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeSet.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) +IPPAPI(IppStatus, l9_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) +IPPAPI(IppStatus, y8_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeSet( pPrime, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeSet( pPrime, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeSet( pPrime, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeSet_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeSet_BN.c new file mode 100644 index 000000000..43ccd07eb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeSet_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) +IPPAPI(IppStatus, l9_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) +IPPAPI(IppStatus, y8_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeSet_BN( pPrime, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeSet_BN( pPrime, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeSet_BN( pPrime, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeTest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeTest.c new file mode 100644 index 000000000..8ee64f96c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeTest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeTest_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeTest_BN.c new file mode 100644 index 000000000..bcbca8fd4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsPrimeTest_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_OAEP.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_OAEP.c new file mode 100644 index 000000000..352ab1577 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_OAEP.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_OAEP_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_OAEP_rmf.c new file mode 100644 index 000000000..09232d53d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_OAEP_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_PKCSv15.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_PKCSv15.c new file mode 100644 index 000000000..71ac07972 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSADecrypt_PKCSv15.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_OAEP.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_OAEP.c new file mode 100644 index 000000000..46120d905 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_OAEP.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_OAEP_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_OAEP_rmf.c new file mode 100644 index 000000000..ab493f150 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_OAEP_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_PKCSv15.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_PKCSv15.c new file mode 100644 index 000000000..e0ca19533 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAEncrypt_PKCSv15.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PKCS1v15.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PKCS1v15.c new file mode 100644 index 000000000..a0d481791 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PKCS1v15.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PKCS1v15_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PKCS1v15_rmf.c new file mode 100644 index 000000000..da4a962c5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PKCS1v15_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PSS.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PSS.c new file mode 100644 index 000000000..a9f561b65 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PSS.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PSS_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PSS_rmf.c new file mode 100644 index 000000000..119392b37 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSASign_PSS_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PKCS1v15.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PKCS1v15.c new file mode 100644 index 000000000..1c4860d5f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PKCS1v15.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PKCS1v15_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PKCS1v15_rmf.c new file mode 100644 index 000000000..e8f3d7985 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PKCS1v15_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PSS.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PSS.c new file mode 100644 index 000000000..1f786e3ed --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PSS.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PSS_rmf.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PSS_rmf.c new file mode 100644 index 000000000..5f95bfe3a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSAVerify_PSS_rmf.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_Decrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_Decrypt.c new file mode 100644 index 000000000..6d7d601e1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_Decrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_Encrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_Encrypt.c new file mode 100644 index 000000000..95f2a26cd --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_Encrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, l9_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) +IPPAPI(IppStatus, y8_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GenerateKeys.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GenerateKeys.c new file mode 100644 index 000000000..44c401386 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GenerateKeys.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetBufferSizePrivateKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetBufferSizePrivateKey.c new file mode 100644 index 000000000..86ea72a91 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetBufferSizePrivateKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetBufferSizePublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetBufferSizePublicKey.c new file mode 100644 index 000000000..2887876ed --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetBufferSizePublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPrivateKeyType1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPrivateKeyType1.c new file mode 100644 index 000000000..50dbf2de5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPrivateKeyType1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPrivateKeyType2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPrivateKeyType2.c new file mode 100644 index 000000000..365ca362d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPrivateKeyType2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPublicKey.c new file mode 100644 index 000000000..2390fedf8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetPublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePrivateKeyType1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePrivateKeyType1.c new file mode 100644 index 000000000..f7ca0d1a8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePrivateKeyType1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) +IPPAPI(IppStatus, l9_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) +IPPAPI(IppStatus, y8_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePrivateKeyType2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePrivateKeyType2.c new file mode 100644 index 000000000..c62bfaf8b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePrivateKeyType2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) +IPPAPI(IppStatus, l9_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) +IPPAPI(IppStatus, y8_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePublicKey.c new file mode 100644 index 000000000..8e9a8274f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_GetSizePublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) +IPPAPI(IppStatus, l9_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) +IPPAPI(IppStatus, y8_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPrivateKeyType1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPrivateKeyType1.c new file mode 100644 index 000000000..d3cc2fe08 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPrivateKeyType1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) +IPPAPI(IppStatus, l9_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) +IPPAPI(IppStatus, y8_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPrivateKeyType2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPrivateKeyType2.c new file mode 100644 index 000000000..ed5ef6061 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPrivateKeyType2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) +IPPAPI(IppStatus, l9_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) +IPPAPI(IppStatus, y8_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPublicKey.c new file mode 100644 index 000000000..8d34cf1de --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_InitPublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) +IPPAPI(IppStatus, l9_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) +IPPAPI(IppStatus, y8_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPrivateKeyType1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPrivateKeyType1.c new file mode 100644 index 000000000..03f0f9803 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPrivateKeyType1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPrivateKeyType2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPrivateKeyType2.c new file mode 100644 index 000000000..09f19f411 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPrivateKeyType2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPublicKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPublicKey.c new file mode 100644 index 000000000..5190b4c57 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_SetPublicKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) +IPPAPI(IppStatus, l9_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) +IPPAPI(IppStatus, y8_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_ValidateKeys.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_ValidateKeys.c new file mode 100644 index 000000000..867ecec1e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRSA_ValidateKeys.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, l9_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) +IPPAPI(IppStatus, y8_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) + +IPPFUN(IppStatus, sgx_disp_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRef_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRef_BN.c new file mode 100644 index 000000000..a520daec2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsRef_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsRef_BN( pSgn, bitSize, ppData, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsRef_BN( pSgn, bitSize, ppData, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsRef_BN( pSgn, bitSize, ppData, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Duplicate.c new file mode 100644 index 000000000..3d696695f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) +IPPAPI(IppStatus, l9_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) +IPPAPI(IppStatus, y8_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Final.c new file mode 100644 index 000000000..92c5ec4b4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) +IPPAPI(IppStatus, l9_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) +IPPAPI(IppStatus, y8_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1GetSize.c new file mode 100644 index 000000000..a623a5491 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSHA1GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSHA1GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1GetTag.c new file mode 100644 index 000000000..383f649aa --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) +IPPAPI(IppStatus, l9_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) +IPPAPI(IppStatus, y8_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Init.c new file mode 100644 index 000000000..e94ed519d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1Init,(IppsSHA1State* pState)) +IPPAPI(IppStatus, l9_ippsSHA1Init,(IppsSHA1State* pState)) +IPPAPI(IppStatus, y8_ippsSHA1Init,(IppsSHA1State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1Init,(IppsSHA1State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1MessageDigest.c new file mode 100644 index 000000000..4a51a3873 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Pack.c new file mode 100644 index 000000000..cb26b14f0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Unpack.c new file mode 100644 index 000000000..334c77d26 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) +IPPAPI(IppStatus, l9_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) +IPPAPI(IppStatus, y8_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Update.c new file mode 100644 index 000000000..dee3a61e0 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA1Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) +IPPAPI(IppStatus, l9_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) +IPPAPI(IppStatus, y8_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA1Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA1Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA1Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Duplicate.c new file mode 100644 index 000000000..1d624c3f5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) +IPPAPI(IppStatus, l9_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) +IPPAPI(IppStatus, y8_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Final.c new file mode 100644 index 000000000..ab7a5fda2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) +IPPAPI(IppStatus, l9_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) +IPPAPI(IppStatus, y8_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224GetSize.c new file mode 100644 index 000000000..e7f801086 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSHA224GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSHA224GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224GetTag.c new file mode 100644 index 000000000..50d1ca64f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) +IPPAPI(IppStatus, l9_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) +IPPAPI(IppStatus, y8_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Init.c new file mode 100644 index 000000000..da1d4d7d2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224Init,(IppsSHA224State* pState)) +IPPAPI(IppStatus, l9_ippsSHA224Init,(IppsSHA224State* pState)) +IPPAPI(IppStatus, y8_ippsSHA224Init,(IppsSHA224State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224Init,(IppsSHA224State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224MessageDigest.c new file mode 100644 index 000000000..cf78bd16f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Pack.c new file mode 100644 index 000000000..5364a9e66 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Unpack.c new file mode 100644 index 000000000..f79d1c5b3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) +IPPAPI(IppStatus, l9_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) +IPPAPI(IppStatus, y8_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Update.c new file mode 100644 index 000000000..f8afd7e75 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA224Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) +IPPAPI(IppStatus, l9_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) +IPPAPI(IppStatus, y8_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA224Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA224Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA224Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Duplicate.c new file mode 100644 index 000000000..01df16096 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) +IPPAPI(IppStatus, l9_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) +IPPAPI(IppStatus, y8_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Final.c new file mode 100644 index 000000000..f8c43ef10 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) +IPPAPI(IppStatus, l9_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) +IPPAPI(IppStatus, y8_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256GetSize.c new file mode 100644 index 000000000..765706204 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSHA256GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSHA256GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256GetTag.c new file mode 100644 index 000000000..01a560880 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) +IPPAPI(IppStatus, l9_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) +IPPAPI(IppStatus, y8_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Init.c new file mode 100644 index 000000000..f781e0e83 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256Init,(IppsSHA256State* pState)) +IPPAPI(IppStatus, l9_ippsSHA256Init,(IppsSHA256State* pState)) +IPPAPI(IppStatus, y8_ippsSHA256Init,(IppsSHA256State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256Init,(IppsSHA256State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256MessageDigest.c new file mode 100644 index 000000000..0f0f374ed --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Pack.c new file mode 100644 index 000000000..65ecbb330 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Unpack.c new file mode 100644 index 000000000..bfe9d6c10 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) +IPPAPI(IppStatus, l9_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) +IPPAPI(IppStatus, y8_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Update.c new file mode 100644 index 000000000..6e560afc1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA256Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) +IPPAPI(IppStatus, l9_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) +IPPAPI(IppStatus, y8_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA256Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA256Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA256Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Duplicate.c new file mode 100644 index 000000000..e708bcecf --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) +IPPAPI(IppStatus, l9_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) +IPPAPI(IppStatus, y8_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Final.c new file mode 100644 index 000000000..d5d3f79e5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) +IPPAPI(IppStatus, l9_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) +IPPAPI(IppStatus, y8_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384GetSize.c new file mode 100644 index 000000000..d7ddc38e1 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSHA384GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSHA384GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384GetTag.c new file mode 100644 index 000000000..0db3c1d7a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) +IPPAPI(IppStatus, l9_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) +IPPAPI(IppStatus, y8_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Init.c new file mode 100644 index 000000000..0d078f18a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384Init,(IppsSHA384State* pState)) +IPPAPI(IppStatus, l9_ippsSHA384Init,(IppsSHA384State* pState)) +IPPAPI(IppStatus, y8_ippsSHA384Init,(IppsSHA384State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384Init,(IppsSHA384State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384MessageDigest.c new file mode 100644 index 000000000..95b3f7842 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Pack.c new file mode 100644 index 000000000..1f319b871 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Unpack.c new file mode 100644 index 000000000..d6a90536b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) +IPPAPI(IppStatus, l9_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) +IPPAPI(IppStatus, y8_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Update.c new file mode 100644 index 000000000..d7e21c9f7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA384Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) +IPPAPI(IppStatus, l9_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) +IPPAPI(IppStatus, y8_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA384Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA384Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA384Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Duplicate.c new file mode 100644 index 000000000..82082ffd5 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) +IPPAPI(IppStatus, l9_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) +IPPAPI(IppStatus, y8_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Final.c new file mode 100644 index 000000000..826d6e7f8 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) +IPPAPI(IppStatus, l9_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) +IPPAPI(IppStatus, y8_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512GetSize.c new file mode 100644 index 000000000..312d8ae7c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSHA512GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSHA512GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512GetTag.c new file mode 100644 index 000000000..00404c522 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) +IPPAPI(IppStatus, l9_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) +IPPAPI(IppStatus, y8_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Init.c new file mode 100644 index 000000000..bd98c260e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512Init,(IppsSHA512State* pState)) +IPPAPI(IppStatus, l9_ippsSHA512Init,(IppsSHA512State* pState)) +IPPAPI(IppStatus, y8_ippsSHA512Init,(IppsSHA512State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512Init,(IppsSHA512State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512MessageDigest.c new file mode 100644 index 000000000..70d0ec4e4 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Pack.c new file mode 100644 index 000000000..9316ca3af --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Unpack.c new file mode 100644 index 000000000..b5a78915e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) +IPPAPI(IppStatus, l9_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) +IPPAPI(IppStatus, y8_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Update.c new file mode 100644 index 000000000..b59451b14 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSHA512Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) +IPPAPI(IppStatus, l9_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) +IPPAPI(IppStatus, y8_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSHA512Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSHA512Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSHA512Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Duplicate.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Duplicate.c new file mode 100644 index 000000000..ae0d2cf35 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Duplicate.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) +IPPAPI(IppStatus, l9_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) +IPPAPI(IppStatus, y8_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3Duplicate( pSrcState, pDstState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3Duplicate( pSrcState, pDstState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Final.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Final.c new file mode 100644 index 000000000..3e093c57e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Final.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) +IPPAPI(IppStatus, l9_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) +IPPAPI(IppStatus, y8_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3Final( pMD, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3Final( pMD, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3Final( pMD, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3GetSize.c new file mode 100644 index 000000000..46b3d619c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3GetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSM3GetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSM3GetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3GetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3GetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3GetTag.c new file mode 100644 index 000000000..d6691ad2d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3GetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) +IPPAPI(IppStatus, l9_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) +IPPAPI(IppStatus, y8_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3GetTag( pTag, tagLen, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3GetTag( pTag, tagLen, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Init.c new file mode 100644 index 000000000..c740148ed --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3Init,(IppsSM3State* pState)) +IPPAPI(IppStatus, l9_ippsSM3Init,(IppsSM3State* pState)) +IPPAPI(IppStatus, y8_ippsSM3Init,(IppsSM3State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3Init,(IppsSM3State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3Init( pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3Init( pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3Init( pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3MessageDigest.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3MessageDigest.c new file mode 100644 index 000000000..ef6d4a05f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3MessageDigest.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, l9_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +IPPAPI(IppStatus, y8_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3MessageDigest( pMsg, len, pMD ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3MessageDigest( pMsg, len, pMD ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Pack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Pack.c new file mode 100644 index 000000000..2a90376d3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Pack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, l9_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) +IPPAPI(IppStatus, y8_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3Pack( pState, pBuffer ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3Pack( pState, pBuffer ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3Pack( pState, pBuffer ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Unpack.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Unpack.c new file mode 100644 index 000000000..690714e09 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Unpack.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) +IPPAPI(IppStatus, l9_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) +IPPAPI(IppStatus, y8_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3Unpack( pBuffer, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3Unpack( pBuffer, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3Unpack( pBuffer, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Update.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Update.c new file mode 100644 index 000000000..39bcad78a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSM3Update.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) +IPPAPI(IppStatus, l9_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) +IPPAPI(IppStatus, y8_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) + +IPPFUN(IppStatus, sgx_disp_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSM3Update( pSrc, len, pState ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSM3Update( pSrc, len, pState ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSM3Update( pSrc, len, pState ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC.c new file mode 100644 index 000000000..aff7791cc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS1.c new file mode 100644 index 000000000..2b7e8e44f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS2.c new file mode 100644 index 000000000..a39d7e195 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS3.c new file mode 100644 index 000000000..aa6301513 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCBC_CS3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCFB.c new file mode 100644 index 000000000..b4d1a6c18 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCTR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCTR.c new file mode 100644 index 000000000..fd8e6ee2b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptCTR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptECB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptECB.c new file mode 100644 index 000000000..1a9b4f26f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptECB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptOFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptOFB.c new file mode 100644 index 000000000..24a5aceec --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4DecryptOFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC.c new file mode 100644 index 000000000..8412bb6a7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS1.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS1.c new file mode 100644 index 000000000..ebfdd92b7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS1.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS2.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS2.c new file mode 100644 index 000000000..0f1c9ebf7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS2.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS3.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS3.c new file mode 100644 index 000000000..7c41090f3 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCBC_CS3.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCFB.c new file mode 100644 index 000000000..64eeced64 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCTR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCTR.c new file mode 100644 index 000000000..4154f615b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptCTR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptECB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptECB.c new file mode 100644 index 000000000..b7cd73259 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptECB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptOFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptOFB.c new file mode 100644 index 000000000..0eb3b7bd7 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4EncryptOFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4GetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4GetSize.c new file mode 100644 index 000000000..80dbc8c3d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4GetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4GetSize,(int *pSize)) +IPPAPI(IppStatus, l9_ippsSMS4GetSize,(int *pSize)) +IPPAPI(IppStatus, y8_ippsSMS4GetSize,(int *pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4GetSize,(int *pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4GetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4GetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4GetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4Init.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4Init.c new file mode 100644 index 000000000..b1845c755 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4Init.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) +IPPAPI(IppStatus, l9_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) +IPPAPI(IppStatus, y8_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4SetKey.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4SetKey.c new file mode 100644 index 000000000..09172933c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4SetKey.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4SetKey( pKey, keyLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4SetKey( pKey, keyLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4SetKey( pKey, keyLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMDecrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMDecrypt.c new file mode 100644 index 000000000..03306391c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMDecrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMEncrypt.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMEncrypt.c new file mode 100644 index 000000000..22817efbb --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMEncrypt.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMGetSize.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMGetSize.c new file mode 100644 index 000000000..f118c802e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMGetSize.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMGetSize,(int* pSize)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMGetSize,(int* pSize)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMGetSize,(int* pSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMGetSize,(int* pSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMGetSize( pSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMGetSize( pSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMGetSize( pSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMGetTag.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMGetTag.c new file mode 100644 index 000000000..aa9455bc2 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMGetTag.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMInit.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMInit.c new file mode 100644 index 000000000..bbdb66189 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMInit.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMMessageLen.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMMessageLen.c new file mode 100644 index 000000000..a8cd0381b --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMMessageLen.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMMessageLen( msgLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMMessageLen( msgLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMMessageLen( msgLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMStart.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMStart.c new file mode 100644 index 000000000..744e5ae6e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMStart.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMTagLen.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMTagLen.c new file mode 100644 index 000000000..eb801212c --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSMS4_CCMTagLen.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, l9_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) +IPPAPI(IppStatus, y8_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSMS4_CCMTagLen( tagLen, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSMS4_CCMTagLen( tagLen, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSMS4_CCMTagLen( tagLen, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSetOctString_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSetOctString_BN.c new file mode 100644 index 000000000..49743e662 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSetOctString_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSetOctString_BN( pStr, strLen, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSetOctString_BN( pStr, strLen, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSetOctString_BN( pStr, strLen, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSet_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSet_BN.c new file mode 100644 index 000000000..9af25431e --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSet_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) +IPPAPI(IppStatus, l9_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) +IPPAPI(IppStatus, y8_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) + +IPPFUN(IppStatus, sgx_disp_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSet_BN( sgn, length, pData, pBN ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSet_BN( sgn, length, pData, pBN ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSet_BN( sgn, length, pData, pBN ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSub_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSub_BN.c new file mode 100644 index 000000000..7a3abc295 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsSub_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, l9_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +IPPAPI(IppStatus, y8_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) + +IPPFUN(IppStatus, sgx_disp_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsSub_BN( pA, pB, pR ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsSub_BN( pA, pB, pR ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsSub_BN( pA, pB, pR ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCBC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCBC.c new file mode 100644 index 000000000..85da7632d --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCBC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, l9_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, y8_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCFB.c new file mode 100644 index 000000000..c7a499b06 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, l9_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, y8_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCTR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCTR.c new file mode 100644 index 000000000..4a82c4d74 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptCTR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, l9_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, y8_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptECB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptECB.c new file mode 100644 index 000000000..5bcd29859 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptECB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) +IPPAPI(IppStatus, l9_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) +IPPAPI(IppStatus, y8_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptOFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptOFB.c new file mode 100644 index 000000000..876a1bdfe --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESDecryptOFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCBC.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCBC.c new file mode 100644 index 000000000..2f9fc5ccc --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCBC.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, l9_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, y8_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCFB.c new file mode 100644 index 000000000..87ce91706 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, l9_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +IPPAPI(IppStatus, y8_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCTR.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCTR.c new file mode 100644 index 000000000..6e5b50b49 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptCTR.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, l9_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) +IPPAPI(IppStatus, y8_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptECB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptECB.c new file mode 100644 index 000000000..67d95614a --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptECB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) +IPPAPI(IppStatus, l9_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) +IPPAPI(IppStatus, y8_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptOFB.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptOFB.c new file mode 100644 index 000000000..3d4af1130 --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTDESEncryptOFB.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) +IPPAPI(IppStatus, l9_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) +IPPAPI(IppStatus, y8_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) + +IPPFUN(IppStatus, sgx_disp_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTRNGenRDSEED.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTRNGenRDSEED.c new file mode 100644 index 000000000..dcc2fe28f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTRNGenRDSEED.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, l9_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, y8_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTRNGenRDSEED( pRand, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTRNGenRDSEED( pRand, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTRNGenRDSEED( pRand, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTRNGenRDSEED_BN.c b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTRNGenRDSEED_BN.c new file mode 100644 index 000000000..54fba285f --- /dev/null +++ b/sdk/tlibcrypto/ipp/ipp_disp/intel64/ippsTRNGenRDSEED_BN.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "ippcp.h" + +#ifndef IPP_CALL +#define IPP_CALL IPP_STDCALL +#endif +#define IPPFUN(type,name,arg) extern type IPP_CALL name arg + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if defined (_M_AMD64) || defined (__x86_64__) + +#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) +#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) +#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) + +#ifdef __cplusplus +extern "C" { +#endif + +IPPAPI(IppStatus, k1_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, l9_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) +IPPAPI(IppStatus, y8_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) + +IPPFUN(IppStatus, sgx_disp_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) +{ + Ipp64u _features; + _features = ippcpGetEnabledCpuFeatures(); + + if( AVX3I_FEATURES == ( _features & AVX3I_FEATURES )) { + return k1_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); + } else + if( ippCPUID_AVX2 == ( _features & ippCPUID_AVX2 )) { + return l9_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); + } else + if( ippCPUID_SSE42 == ( _features & ippCPUID_SSE42 )) { + return y8_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); + } else + return ippStsCpuNotSupportedErr; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00000.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00000.c deleted file mode 100644 index af7275142..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00000.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppLibraryVersion*, y8_ippcpGetLibVersion, (void) ) -IPPAPI( const IppLibraryVersion*, l9_ippcpGetLibVersion, (void) ) -IPPAPI( const IppLibraryVersion*, k1_ippcpGetLibVersion, (void) ) - -IPPFUN( const IppLibraryVersion*,sgx_disp_ippcpGetLibVersion, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippcpGetLibVersion( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippcpGetLibVersion( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippcpGetLibVersion( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppLibraryVersion*, p8_ippcpGetLibVersion, (void) ) -IPPAPI( const IppLibraryVersion*, h9_ippcpGetLibVersion, (void) ) - -IPPFUN( const IppLibraryVersion*,sgx_disp_ippcpGetLibVersion, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippcpGetLibVersion( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippcpGetLibVersion( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00001.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00001.c deleted file mode 100644 index f8baca34d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00001.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDESGetSize,(int *size)) -IPPAPI(IppStatus, l9_ippsDESGetSize,(int *size)) -IPPAPI(IppStatus, k1_ippsDESGetSize,(int *size)) - -IPPFUN(IppStatus,sgx_disp_ippsDESGetSize,(int *size)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDESGetSize( size ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDESGetSize( size ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDESGetSize( size ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDESGetSize,(int *size)) -IPPAPI(IppStatus, h9_ippsDESGetSize,(int *size)) - -IPPFUN(IppStatus,sgx_disp_ippsDESGetSize,(int *size)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDESGetSize( size ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDESGetSize( size ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00002.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00002.c deleted file mode 100644 index 310861e1b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00002.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) -IPPAPI(IppStatus, l9_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) -IPPAPI(IppStatus, k1_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDESInit( pKey, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDESInit( pKey, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDESInit( pKey, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) -IPPAPI(IppStatus, h9_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDESInit,(const Ipp8u* pKey, IppsDESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDESInit( pKey, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDESInit( pKey, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00003.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00003.c deleted file mode 100644 index 2545e617a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00003.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDESPack( pCtx, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDESPack( pCtx, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDESPack( pCtx, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsDESPack,(const IppsDESSpec* pCtx, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDESPack( pCtx, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDESPack( pCtx, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00004.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00004.c deleted file mode 100644 index 704251b9e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00004.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) -IPPAPI(IppStatus, l9_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) -IPPAPI(IppStatus, k1_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDESUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDESUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDESUnpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) -IPPAPI(IppStatus, h9_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDESUnpack,(const Ipp8u* pBuffer, IppsDESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDESUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDESUnpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00005.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00005.c deleted file mode 100644 index 8cdc8e3c5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00005.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -IPPAPI(IppStatus, l9_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -IPPAPI(IppStatus, k1_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -IPPAPI(IppStatus, h9_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESEncryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00006.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00006.c deleted file mode 100644 index 077a084d2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00006.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -IPPAPI(IppStatus, l9_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -IPPAPI(IppStatus, k1_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -IPPAPI(IppStatus, h9_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESDecryptECB( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00007.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00007.c deleted file mode 100644 index 4fe7c4950..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00007.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, l9_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, k1_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, h9_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESEncryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00008.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00008.c deleted file mode 100644 index 4e33f907e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00008.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, l9_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, k1_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, h9_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESDecryptCBC( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00009.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00009.c deleted file mode 100644 index 73b9f67aa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00009.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, l9_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, k1_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, h9_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00010.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00010.c deleted file mode 100644 index 88b994b92..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00010.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, l9_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, k1_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -IPPAPI(IppStatus, h9_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, const Ipp8u* pIV, IppsCPPadding padding)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx1, pCtx2, pCtx3, pIV, padding ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00011.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00011.c deleted file mode 100644 index 674979398..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00011.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00012.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00012.c deleted file mode 100644 index 858e3f63f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00012.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx1, pCtx2, pCtx3, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00013.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00013.c deleted file mode 100644 index e76957bec..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00013.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, l9_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, k1_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, h9_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESEncryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00014.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00014.c deleted file mode 100644 index dc535cce5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00014.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, l9_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, k1_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, h9_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsTDESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsDESSpec* pCtx1, const IppsDESSpec* pCtx2, const IppsDESSpec* pCtx3, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTDESDecryptCTR( pSrc, pDst, len, pCtx1, pCtx2, pCtx3, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00015.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00015.c deleted file mode 100644 index 6fb991355..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00015.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESGetSize,(int *pSize)) -IPPAPI(IppStatus, l9_ippsAESGetSize,(int *pSize)) -IPPAPI(IppStatus, k1_ippsAESGetSize,(int *pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESGetSize,(int *pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESGetSize,(int *pSize)) -IPPAPI(IppStatus, h9_ippsAESGetSize,(int *pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESGetSize,(int *pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00016.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00016.c deleted file mode 100644 index 0d6634592..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00016.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) -IPPAPI(IppStatus, l9_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) -IPPAPI(IppStatus, k1_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) -IPPAPI(IppStatus, h9_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESInit( pKey, keyLen, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00017.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00017.c deleted file mode 100644 index 02f6c6383..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00017.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) -IPPAPI(IppStatus, l9_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) -IPPAPI(IppStatus, k1_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESSetKey( pKey, keyLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESSetKey( pKey, keyLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESSetKey( pKey, keyLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) -IPPAPI(IppStatus, h9_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsAESSetKey,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESSetKey( pKey, keyLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESSetKey( pKey, keyLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00018.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00018.c deleted file mode 100644 index 2b6feed3d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00018.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, l9_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, k1_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESPack( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESPack( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESPack( pCtx, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, h9_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESPack,(const IppsAESSpec* pCtx, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESPack( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESPack( pCtx, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00019.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00019.c deleted file mode 100644 index 8daa3eff7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00019.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) -IPPAPI(IppStatus, l9_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) -IPPAPI(IppStatus, k1_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESUnpack( pBuffer, pCtx, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESUnpack( pBuffer, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESUnpack( pBuffer, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) -IPPAPI(IppStatus, h9_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESUnpack,(const Ipp8u* pBuffer, IppsAESSpec* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESUnpack( pBuffer, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESUnpack( pBuffer, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00020.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00020.c deleted file mode 100644 index f04fb4f9a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00020.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -IPPAPI(IppStatus, l9_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -IPPAPI(IppStatus, k1_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -IPPAPI(IppStatus, h9_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00021.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00021.c deleted file mode 100644 index feaba5884..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00021.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -IPPAPI(IppStatus, l9_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -IPPAPI(IppStatus, k1_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -IPPAPI(IppStatus, h9_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00022.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00022.c deleted file mode 100644 index cbc25d5e0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00022.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00023.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00023.c deleted file mode 100644 index 9518854fb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00023.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00024.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00024.c deleted file mode 100644 index 5b108febe..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00024.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00025.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00025.c deleted file mode 100644 index 7c1c38365..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00025.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00026.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00026.c deleted file mode 100644 index 8640f4a2f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00026.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00027.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00027.c deleted file mode 100644 index 8a877c9a1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00027.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00028.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00028.c deleted file mode 100644 index f38b6d528..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00028.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00029.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00029.c deleted file mode 100644 index eaf668f64..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00029.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00030.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00030.c deleted file mode 100644 index 11eba7dfb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00030.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00031.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00031.c deleted file mode 100644 index b389dc67f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00031.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsAESSpec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00032.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00032.c deleted file mode 100644 index 4adf930f1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00032.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00033.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00033.c deleted file mode 100644 index 4c679a138..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00033.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsAESSpec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00034.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00034.c deleted file mode 100644 index c764963fb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00034.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, l9_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, k1_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, h9_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00035.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00035.c deleted file mode 100644 index 364e1cea2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00035.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, l9_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, k1_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, h9_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsAESSpec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00036.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00036.c deleted file mode 100644 index 94cd95a3c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00036.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -IPPAPI(IppStatus, l9_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -IPPAPI(IppStatus, k1_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -IPPAPI(IppStatus, h9_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESEncryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESEncryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00037.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00037.c deleted file mode 100644 index 871e32805..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00037.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -IPPAPI(IppStatus, l9_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -IPPAPI(IppStatus, k1_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -IPPAPI(IppStatus, h9_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) - -IPPFUN(IppStatus,sgx_disp_ippsAESDecryptXTS_Direct,(const Ipp8u* pSrc, Ipp8u* pDst, int encBitsize, int aesBlkNo, const Ipp8u* pTweakPT, const Ipp8u* pKey, int keyBitsize, int dataUnitBitsize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAESDecryptXTS_Direct( pSrc, pDst, encBitsize, aesBlkNo, pTweakPT, pKey, keyBitsize, dataUnitBitsize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00038.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00038.c deleted file mode 100644 index 47fac89d2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00038.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) -IPPAPI(IppStatus, l9_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) -IPPAPI(IppStatus, k1_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) -IPPAPI(IppStatus, h9_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_EncryptCFB16_MB, (const Ipp8u* pSrc[], Ipp8u* pDst[], int len[], const IppsAESSpec* pCtx[], const Ipp8u* pIV[], IppStatus status[], int numBuffers)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_EncryptCFB16_MB( pSrc, pDst, len, pCtx, pIV, status, numBuffers ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00039.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00039.c deleted file mode 100644 index 69c4f843d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00039.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4GetSize,(int *pSize)) -IPPAPI(IppStatus, l9_ippsSMS4GetSize,(int *pSize)) -IPPAPI(IppStatus, k1_ippsSMS4GetSize,(int *pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4GetSize,(int *pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4GetSize,(int *pSize)) -IPPAPI(IppStatus, h9_ippsSMS4GetSize,(int *pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4GetSize,(int *pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00040.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00040.c deleted file mode 100644 index bfe0e1cc5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00040.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) -IPPAPI(IppStatus, l9_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) -IPPAPI(IppStatus, k1_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) -IPPAPI(IppStatus, h9_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4Init,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4Init( pKey, keyLen, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00041.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00041.c deleted file mode 100644 index 5456dbd76..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00041.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4SetKey( pKey, keyLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4SetKey( pKey, keyLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4SetKey( pKey, keyLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4SetKey,(const Ipp8u* pKey, int keyLen, IppsSMS4Spec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4SetKey( pKey, keyLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4SetKey( pKey, keyLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00042.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00042.c deleted file mode 100644 index 42f47c726..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00042.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00043.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00043.c deleted file mode 100644 index af5801a33..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00043.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptECB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptECB( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00044.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00044.c deleted file mode 100644 index b62788b4a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00044.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00045.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00045.c deleted file mode 100644 index aee63ea2e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00045.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00046.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00046.c deleted file mode 100644 index 11aaf656e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00046.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00047.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00047.c deleted file mode 100644 index 3533a72aa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00047.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00048.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00048.c deleted file mode 100644 index 83ebdc0ce..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00048.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptCBC( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00049.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00049.c deleted file mode 100644 index d26d3b449..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00049.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC_CS1,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptCBC_CS1( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00050.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00050.c deleted file mode 100644 index ec5a4625a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00050.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC_CS2,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptCBC_CS2( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00051.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00051.c deleted file mode 100644 index 5e08c0520..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00051.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCBC_CS3,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptCBC_CS3( pSrc, pDst, len, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00052.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00052.c deleted file mode 100644 index 1c6a1bf84..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00052.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00053.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00053.c deleted file mode 100644 index 6ba30b449..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00053.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int cfbBlkSize, const IppsSMS4Spec* pCtx, const Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptCFB( pSrc, pDst, len, cfbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00054.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00054.c deleted file mode 100644 index 934d27488..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00054.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00055.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00055.c deleted file mode 100644 index abda7e7dc..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00055.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptOFB,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int ofbBlkSize, const IppsSMS4Spec* pCtx, Ipp8u* pIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptOFB( pSrc, pDst, len, ofbBlkSize, pCtx, pIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00056.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00056.c deleted file mode 100644 index dcf4f4d03..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00056.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, l9_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, k1_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, h9_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4EncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4EncryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00057.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00057.c deleted file mode 100644 index 9b494adc9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00057.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, l9_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, k1_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -IPPAPI(IppStatus, h9_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4DecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len, const IppsSMS4Spec* pCtx, Ipp8u* pCtrValue, int ctrNumBitSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4DecryptCTR( pSrc, pDst, len, pCtx, pCtrValue, ctrNumBitSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00058.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00058.c deleted file mode 100644 index ea268852b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00058.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMGetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMGetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMGetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00059.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00059.c deleted file mode 100644 index 6963e2287..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00059.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMInit,(const Ipp8u* pKey, int keyLen, IppsSMS4_CCMState* pCtx, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMInit( pKey, keyLen, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00060.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00060.c deleted file mode 100644 index 4a2cd10be..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00060.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMMessageLen( msgLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMMessageLen( msgLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMMessageLen( msgLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMMessageLen,(Ipp64u msgLen, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMMessageLen( msgLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMMessageLen( msgLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00061.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00061.c deleted file mode 100644 index 7c9006118..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00061.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMTagLen( tagLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMTagLen( tagLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMTagLen( tagLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMTagLen,(int tagLen, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMTagLen( tagLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMTagLen( tagLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00062.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00062.c deleted file mode 100644 index 79809d216..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00062.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMStart( pIV, ivLen, pAD, adLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00063.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00063.c deleted file mode 100644 index 8a1575563..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00063.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMEncrypt( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00064.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00064.c deleted file mode 100644 index 440e2a48b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00064.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMDecrypt( pSrc, pDst, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00065.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00065.c deleted file mode 100644 index 616c7f2bf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00065.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, l9_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, k1_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) -IPPAPI(IppStatus, h9_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsSMS4_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsSMS4_CCMState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSMS4_CCMGetTag( pTag, tagLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00066.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00066.c deleted file mode 100644 index 2efa0843a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00066.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMGetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsAES_CCMGetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsAES_CCMGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMGetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsAES_CCMGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00067.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00067.c deleted file mode 100644 index 6f6319064..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00067.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) -IPPAPI(IppStatus, l9_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) -IPPAPI(IppStatus, k1_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) -IPPAPI(IppStatus, h9_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_CCMState* pState, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMInit( pKey, keyLen, pState, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00068.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00068.c deleted file mode 100644 index 41674960d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00068.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMMessageLen( msgLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMMessageLen( msgLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMMessageLen( msgLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMMessageLen,(Ipp64u msgLen, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMMessageLen( msgLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMMessageLen( msgLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00069.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00069.c deleted file mode 100644 index e4d144b98..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00069.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMTagLen( tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMTagLen( tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMTagLen( tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMTagLen,(int tagLen, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMTagLen( tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMTagLen( tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00070.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00070.c deleted file mode 100644 index ee61d86b0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00070.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAD, int adLen, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMStart( pIV, ivLen, pAD, adLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00071.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00071.c deleted file mode 100644 index c4c657517..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00071.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMEncrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00072.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00072.c deleted file mode 100644 index f64003477..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00072.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMDecrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00073.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00073.c deleted file mode 100644 index f7d008f15..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00073.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CCMGetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CCMGetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CCMGetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CCMGetTag,(Ipp8u* pTag, int tagLen, const IppsAES_CCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CCMGetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CCMGetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00074.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00074.c deleted file mode 100644 index 86540a114..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00074.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMGetSize,(int * pSize)) -IPPAPI(IppStatus, l9_ippsAES_GCMGetSize,(int * pSize)) -IPPAPI(IppStatus, k1_ippsAES_GCMGetSize,(int * pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMGetSize,(int * pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMGetSize,(int * pSize)) -IPPAPI(IppStatus, h9_ippsAES_GCMGetSize,(int * pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMGetSize,(int * pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00075.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00075.c deleted file mode 100644 index 71a2f67da..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00075.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) -IPPAPI(IppStatus, l9_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) -IPPAPI(IppStatus, k1_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) -IPPAPI(IppStatus, h9_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMInit( pKey, keyLen, pState, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00076.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00076.c deleted file mode 100644 index 110b8d7dc..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00076.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMReset,(IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMReset,(IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMReset,(IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMReset,(IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMReset( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMReset( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMReset( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMReset,(IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMReset,(IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMReset,(IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMReset( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMReset( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00077.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00077.c deleted file mode 100644 index be6a5523d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00077.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMProcessIV( pIV, ivLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMProcessIV( pIV, ivLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMProcessIV( pIV, ivLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMProcessIV( pIV, ivLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMProcessIV( pIV, ivLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00078.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00078.c deleted file mode 100644 index 58b3f893a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00078.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMProcessAAD( pAAD, ivAAD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMProcessAAD( pAAD, ivAAD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMProcessAAD( pAAD, ivAAD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMProcessAAD( pAAD, ivAAD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMProcessAAD( pAAD, ivAAD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00079.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00079.c deleted file mode 100644 index 3f5fb2f9d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00079.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen, const Ipp8u* pAAD, int aadLen, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMStart( pIV, ivLen, pAAD, aadLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00080.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00080.c deleted file mode 100644 index fdbc59710..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00080.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMEncrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00081.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00081.c deleted file mode 100644 index a70b6c340..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00081.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMDecrypt( pSrc, pDst, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00082.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00082.c deleted file mode 100644 index 058fc1c2f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00082.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) -IPPAPI(IppStatus, l9_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) -IPPAPI(IppStatus, k1_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) -IPPAPI(IppStatus, h9_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_GCMGetTag( pDstTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00083.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00083.c deleted file mode 100644 index 04c5b16e6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00083.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_XTSGetSize,(int * pSize)) -IPPAPI(IppStatus, l9_ippsAES_XTSGetSize,(int * pSize)) -IPPAPI(IppStatus, k1_ippsAES_XTSGetSize,(int * pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSGetSize,(int * pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_XTSGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_XTSGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_XTSGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_XTSGetSize,(int * pSize)) -IPPAPI(IppStatus, h9_ippsAES_XTSGetSize,(int * pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSGetSize,(int * pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_XTSGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_XTSGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00084.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00084.c deleted file mode 100644 index 7f3556102..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00084.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) -IPPAPI(IppStatus, l9_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) -IPPAPI(IppStatus, k1_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) -IPPAPI(IppStatus, h9_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSInit,(const Ipp8u* pKey, int keyLen, int duBitsize, IppsAES_XTSSpec* pCtx,int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_XTSInit( pKey, keyLen, duBitsize, pCtx, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00085.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00085.c deleted file mode 100644 index 2f7d35da7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00085.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -IPPAPI(IppStatus, l9_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -IPPAPI(IppStatus, k1_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -IPPAPI(IppStatus, h9_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_XTSEncrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00086.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00086.c deleted file mode 100644 index f4db2a5e8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00086.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -IPPAPI(IppStatus, l9_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -IPPAPI(IppStatus, k1_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -IPPAPI(IppStatus, h9_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_XTSDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int bitSizeLen, const IppsAES_XTSSpec* pCtx, const Ipp8u* pTweak, int startCipherBlkNo)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_XTSDecrypt( pSrc, pDst, bitSizeLen, pCtx, pTweak, startCipherBlkNo ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00087.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00087.c deleted file mode 100644 index 2225165aa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00087.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) -IPPAPI(IppStatus, l9_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) -IPPAPI(IppStatus, k1_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) -IPPAPI(IppStatus, h9_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_S2V_CMAC,(const Ipp8u* pKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, Ipp8u* pV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_S2V_CMAC( pKey, keyLen, pAD, pADlen, numAD, pV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00088.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00088.c deleted file mode 100644 index c2fd7088c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00088.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) -IPPAPI(IppStatus, l9_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) -IPPAPI(IppStatus, k1_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) -IPPAPI(IppStatus, h9_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_SIVEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u* pSIV, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_SIVEncrypt( pSrc, pDst, len, pSIV, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00089.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00089.c deleted file mode 100644 index e63b28193..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00089.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) -IPPAPI(IppStatus, l9_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) -IPPAPI(IppStatus, k1_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) -IPPAPI(IppStatus, h9_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_SIVDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, int* pAuthPassed, const Ipp8u* pAuthKey, const Ipp8u* pConfKey, int keyLen, const Ipp8u* pAD[], const int pADlen[], int numAD, const Ipp8u* pSIV)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_SIVDecrypt( pSrc, pDst, len, pAuthPassed, pAuthKey, pConfKey, keyLen, pAD, pADlen, numAD, pSIV ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00090.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00090.c deleted file mode 100644 index 35fe89b82..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00090.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CMACGetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsAES_CMACGetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsAES_CMACGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CMACGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CMACGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CMACGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CMACGetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsAES_CMACGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CMACGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CMACGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00091.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00091.c deleted file mode 100644 index 89539adb7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00091.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) -IPPAPI(IppStatus, l9_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) -IPPAPI(IppStatus, k1_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) -IPPAPI(IppStatus, h9_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CMACInit( pKey, keyLen, pState, ctxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00092.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00092.c deleted file mode 100644 index 69ca6e259..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00092.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CMACUpdate( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CMACUpdate( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CMACUpdate( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CMACUpdate( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CMACUpdate( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00093.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00093.c deleted file mode 100644 index 2998da092..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00093.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CMACFinal( pMD, mdLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CMACFinal( pMD, mdLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CMACFinal( pMD, mdLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CMACFinal( pMD, mdLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CMACFinal( pMD, mdLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00094.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00094.c deleted file mode 100644 index dba8be557..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00094.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) -IPPAPI(IppStatus, l9_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) -IPPAPI(IppStatus, k1_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAES_CMACGetTag( pMD, mdLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAES_CMACGetTag( pMD, mdLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAES_CMACGetTag( pMD, mdLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) -IPPAPI(IppStatus, h9_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAES_CMACGetTag( pMD, mdLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAES_CMACGetTag( pMD, mdLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00095.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00095.c deleted file mode 100644 index 8d9e2d37d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00095.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) -IPPAPI(IppStatus, l9_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) -IPPAPI(IppStatus, k1_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) -IPPAPI(IppStatus, h9_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourCheckKey, (const Ipp8u *pKey, int keyLen, IppBool* pIsWeak)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourCheckKey( pKey, keyLen, pIsWeak ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00096.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00096.c deleted file mode 100644 index 8bb94204c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00096.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourGetSize, (int* pSize)) -IPPAPI(IppStatus, l9_ippsARCFourGetSize, (int* pSize)) -IPPAPI(IppStatus, k1_ippsARCFourGetSize, (int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourGetSize, (int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourGetSize, (int* pSize)) -IPPAPI(IppStatus, h9_ippsARCFourGetSize, (int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourGetSize, (int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00097.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00097.c deleted file mode 100644 index 085c66e70..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00097.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, l9_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, k1_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourInit( pKey, keyLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourInit( pKey, keyLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourInit( pKey, keyLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, h9_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourInit, (const Ipp8u *pKey, int keyLen, IppsARCFourState *pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourInit( pKey, keyLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourInit( pKey, keyLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00098.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00098.c deleted file mode 100644 index fc2e91b30..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00098.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourReset, (IppsARCFourState* pCtx)) -IPPAPI(IppStatus, l9_ippsARCFourReset, (IppsARCFourState* pCtx)) -IPPAPI(IppStatus, k1_ippsARCFourReset, (IppsARCFourState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourReset, (IppsARCFourState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourReset( pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourReset( pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourReset( pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourReset, (IppsARCFourState* pCtx)) -IPPAPI(IppStatus, h9_ippsARCFourReset, (IppsARCFourState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourReset, (IppsARCFourState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourReset( pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourReset( pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00099.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00099.c deleted file mode 100644 index 1d7a5e179..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00099.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourPack( pCtx, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourPack( pCtx, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourPack( pCtx, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourPack,(const IppsARCFourState* pCtx, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourPack( pCtx, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourPack( pCtx, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00100.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00100.c deleted file mode 100644 index 963644e87..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00100.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) -IPPAPI(IppStatus, l9_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) -IPPAPI(IppStatus, k1_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourUnpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) -IPPAPI(IppStatus, h9_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourUnpack,(const Ipp8u* pBuffer, IppsARCFourState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourUnpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00101.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00101.c deleted file mode 100644 index 0dbb41523..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00101.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, l9_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, k1_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, h9_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourEncrypt( pSrc, pDst, length, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00102.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00102.c deleted file mode 100644 index 4d80ae7c2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00102.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, l9_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, k1_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -IPPAPI(IppStatus, h9_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsARCFourDecrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsARCFourDecrypt( pSrc, pDst, length, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00103.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00103.c deleted file mode 100644 index 829b0eb1b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00103.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSHA1GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSHA1GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSHA1GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00104.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00104.c deleted file mode 100644 index dd8732d7e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00104.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1Init,(IppsSHA1State* pState)) -IPPAPI(IppStatus, l9_ippsSHA1Init,(IppsSHA1State* pState)) -IPPAPI(IppStatus, k1_ippsSHA1Init,(IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Init,(IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1Init,(IppsSHA1State* pState)) -IPPAPI(IppStatus, h9_ippsSHA1Init,(IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Init,(IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00105.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00105.c deleted file mode 100644 index 159aac3ec..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00105.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) -IPPAPI(IppStatus, l9_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) -IPPAPI(IppStatus, k1_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) -IPPAPI(IppStatus, h9_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Duplicate,(const IppsSHA1State* pSrcState, IppsSHA1State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00106.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00106.c deleted file mode 100644 index ceb78974a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00106.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Pack,(const IppsSHA1State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00107.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00107.c deleted file mode 100644 index af9fb99d1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00107.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) -IPPAPI(IppStatus, l9_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) -IPPAPI(IppStatus, k1_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) -IPPAPI(IppStatus, h9_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Unpack,(const Ipp8u* pBuffer, IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00108.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00108.c deleted file mode 100644 index 054495401..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00108.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) -IPPAPI(IppStatus, l9_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) -IPPAPI(IppStatus, k1_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) -IPPAPI(IppStatus, h9_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Update,(const Ipp8u* pSrc, int len, IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00109.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00109.c deleted file mode 100644 index f020bb75e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00109.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) -IPPAPI(IppStatus, l9_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) -IPPAPI(IppStatus, k1_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) -IPPAPI(IppStatus, h9_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00110.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00110.c deleted file mode 100644 index 81dafa132..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00110.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) -IPPAPI(IppStatus, l9_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) -IPPAPI(IppStatus, k1_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) -IPPAPI(IppStatus, h9_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1Final,(Ipp8u* pMD, IppsSHA1State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00111.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00111.c deleted file mode 100644 index 5fb2bc34d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00111.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA1MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA1MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA1MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA1MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA1MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA1MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00112.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00112.c deleted file mode 100644 index c73bc3782..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00112.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSHA224GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSHA224GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSHA224GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00113.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00113.c deleted file mode 100644 index fb009cd6f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00113.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224Init,(IppsSHA224State* pState)) -IPPAPI(IppStatus, l9_ippsSHA224Init,(IppsSHA224State* pState)) -IPPAPI(IppStatus, k1_ippsSHA224Init,(IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Init,(IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224Init,(IppsSHA224State* pState)) -IPPAPI(IppStatus, h9_ippsSHA224Init,(IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Init,(IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00114.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00114.c deleted file mode 100644 index e2455ea17..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00114.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) -IPPAPI(IppStatus, l9_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) -IPPAPI(IppStatus, k1_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) -IPPAPI(IppStatus, h9_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Duplicate,(const IppsSHA224State* pSrcState, IppsSHA224State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00115.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00115.c deleted file mode 100644 index 49be24ae8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00115.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Pack,(const IppsSHA224State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00116.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00116.c deleted file mode 100644 index 5dabc8a5b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00116.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) -IPPAPI(IppStatus, l9_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) -IPPAPI(IppStatus, k1_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) -IPPAPI(IppStatus, h9_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Unpack,(const Ipp8u* pBuffer, IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00117.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00117.c deleted file mode 100644 index 2adcf5842..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00117.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) -IPPAPI(IppStatus, l9_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) -IPPAPI(IppStatus, k1_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) -IPPAPI(IppStatus, h9_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Update,(const Ipp8u* pSrc, int len, IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00118.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00118.c deleted file mode 100644 index 3ba4e6cb9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00118.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) -IPPAPI(IppStatus, l9_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) -IPPAPI(IppStatus, k1_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) -IPPAPI(IppStatus, h9_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00119.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00119.c deleted file mode 100644 index 603652dda..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00119.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) -IPPAPI(IppStatus, l9_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) -IPPAPI(IppStatus, k1_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) -IPPAPI(IppStatus, h9_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224Final,(Ipp8u* pMD, IppsSHA224State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00120.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00120.c deleted file mode 100644 index d314029ff..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00120.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA224MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA224MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA224MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA224MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA224MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA224MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00121.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00121.c deleted file mode 100644 index c0618bd94..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00121.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSHA256GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSHA256GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSHA256GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00122.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00122.c deleted file mode 100644 index 262f4368e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00122.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256Init,(IppsSHA256State* pState)) -IPPAPI(IppStatus, l9_ippsSHA256Init,(IppsSHA256State* pState)) -IPPAPI(IppStatus, k1_ippsSHA256Init,(IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Init,(IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256Init,(IppsSHA256State* pState)) -IPPAPI(IppStatus, h9_ippsSHA256Init,(IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Init,(IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00123.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00123.c deleted file mode 100644 index 52523fa3e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00123.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) -IPPAPI(IppStatus, l9_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) -IPPAPI(IppStatus, k1_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) -IPPAPI(IppStatus, h9_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Duplicate,(const IppsSHA256State* pSrcState, IppsSHA256State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00124.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00124.c deleted file mode 100644 index 05dc26c3a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00124.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Pack,(const IppsSHA256State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00125.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00125.c deleted file mode 100644 index 62a67ca90..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00125.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) -IPPAPI(IppStatus, l9_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) -IPPAPI(IppStatus, k1_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) -IPPAPI(IppStatus, h9_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Unpack,(const Ipp8u* pBuffer, IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00126.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00126.c deleted file mode 100644 index 9f6758696..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00126.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) -IPPAPI(IppStatus, l9_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) -IPPAPI(IppStatus, k1_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) -IPPAPI(IppStatus, h9_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Update,(const Ipp8u* pSrc, int len, IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00127.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00127.c deleted file mode 100644 index 93038d447..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00127.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) -IPPAPI(IppStatus, l9_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) -IPPAPI(IppStatus, k1_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) -IPPAPI(IppStatus, h9_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00128.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00128.c deleted file mode 100644 index 0ab67c085..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00128.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) -IPPAPI(IppStatus, l9_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) -IPPAPI(IppStatus, k1_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) -IPPAPI(IppStatus, h9_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256Final,(Ipp8u* pMD, IppsSHA256State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00129.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00129.c deleted file mode 100644 index 0659945f2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00129.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA256MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA256MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA256MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA256MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA256MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA256MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00130.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00130.c deleted file mode 100644 index af84e0ef7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00130.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSHA384GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSHA384GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSHA384GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00131.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00131.c deleted file mode 100644 index c0f28db48..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00131.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384Init,(IppsSHA384State* pState)) -IPPAPI(IppStatus, l9_ippsSHA384Init,(IppsSHA384State* pState)) -IPPAPI(IppStatus, k1_ippsSHA384Init,(IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Init,(IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384Init,(IppsSHA384State* pState)) -IPPAPI(IppStatus, h9_ippsSHA384Init,(IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Init,(IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00132.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00132.c deleted file mode 100644 index 27c97a5e6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00132.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) -IPPAPI(IppStatus, l9_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) -IPPAPI(IppStatus, k1_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) -IPPAPI(IppStatus, h9_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Duplicate,(const IppsSHA384State* pSrcState, IppsSHA384State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00133.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00133.c deleted file mode 100644 index 6c7aa366d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00133.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Pack,(const IppsSHA384State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00134.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00134.c deleted file mode 100644 index 829c4b8f1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00134.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) -IPPAPI(IppStatus, l9_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) -IPPAPI(IppStatus, k1_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) -IPPAPI(IppStatus, h9_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Unpack,(const Ipp8u* pBuffer, IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00135.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00135.c deleted file mode 100644 index 894388b11..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00135.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) -IPPAPI(IppStatus, l9_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) -IPPAPI(IppStatus, k1_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) -IPPAPI(IppStatus, h9_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Update,(const Ipp8u* pSrc, int len, IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00136.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00136.c deleted file mode 100644 index bd3d1321e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00136.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) -IPPAPI(IppStatus, l9_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) -IPPAPI(IppStatus, k1_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) -IPPAPI(IppStatus, h9_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00137.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00137.c deleted file mode 100644 index ca6616e3c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00137.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) -IPPAPI(IppStatus, l9_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) -IPPAPI(IppStatus, k1_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) -IPPAPI(IppStatus, h9_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384Final,(Ipp8u* pMD, IppsSHA384State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00138.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00138.c deleted file mode 100644 index be9f63230..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00138.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA384MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA384MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA384MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA384MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA384MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA384MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00139.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00139.c deleted file mode 100644 index a85a2c055..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00139.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSHA512GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSHA512GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSHA512GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00140.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00140.c deleted file mode 100644 index e0034133d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00140.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512Init,(IppsSHA512State* pState)) -IPPAPI(IppStatus, l9_ippsSHA512Init,(IppsSHA512State* pState)) -IPPAPI(IppStatus, k1_ippsSHA512Init,(IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Init,(IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512Init,(IppsSHA512State* pState)) -IPPAPI(IppStatus, h9_ippsSHA512Init,(IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Init,(IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00141.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00141.c deleted file mode 100644 index 78494d127..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00141.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) -IPPAPI(IppStatus, l9_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) -IPPAPI(IppStatus, k1_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) -IPPAPI(IppStatus, h9_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Duplicate,(const IppsSHA512State* pSrcState, IppsSHA512State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00142.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00142.c deleted file mode 100644 index 7d5b8cbb8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00142.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Pack,(const IppsSHA512State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00143.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00143.c deleted file mode 100644 index 079d0831c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00143.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) -IPPAPI(IppStatus, l9_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) -IPPAPI(IppStatus, k1_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) -IPPAPI(IppStatus, h9_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Unpack,(const Ipp8u* pBuffer, IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00144.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00144.c deleted file mode 100644 index 02b7480fb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00144.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) -IPPAPI(IppStatus, l9_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) -IPPAPI(IppStatus, k1_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) -IPPAPI(IppStatus, h9_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Update,(const Ipp8u* pSrc, int len, IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00145.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00145.c deleted file mode 100644 index b874c8e95..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00145.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) -IPPAPI(IppStatus, l9_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) -IPPAPI(IppStatus, k1_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) -IPPAPI(IppStatus, h9_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00146.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00146.c deleted file mode 100644 index aa535c052..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00146.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) -IPPAPI(IppStatus, l9_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) -IPPAPI(IppStatus, k1_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) -IPPAPI(IppStatus, h9_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512Final,(Ipp8u* pMD, IppsSHA512State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00147.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00147.c deleted file mode 100644 index 9002052f7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00147.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSHA512MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSHA512MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSHA512MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSHA512MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSHA512MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSHA512MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00148.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00148.c deleted file mode 100644 index 32a5bd472..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00148.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsMD5GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsMD5GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsMD5GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00149.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00149.c deleted file mode 100644 index 2329a852e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00149.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5Init,(IppsMD5State* pState)) -IPPAPI(IppStatus, l9_ippsMD5Init,(IppsMD5State* pState)) -IPPAPI(IppStatus, k1_ippsMD5Init,(IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Init,(IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5Init,(IppsMD5State* pState)) -IPPAPI(IppStatus, h9_ippsMD5Init,(IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Init,(IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00150.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00150.c deleted file mode 100644 index 9397a0b2c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00150.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) -IPPAPI(IppStatus, l9_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) -IPPAPI(IppStatus, k1_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) -IPPAPI(IppStatus, h9_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Duplicate,(const IppsMD5State* pSrcState, IppsMD5State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00151.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00151.c deleted file mode 100644 index b7420a551..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00151.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Pack,(const IppsMD5State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00152.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00152.c deleted file mode 100644 index 78797cb33..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00152.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) -IPPAPI(IppStatus, l9_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) -IPPAPI(IppStatus, k1_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) -IPPAPI(IppStatus, h9_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Unpack,(const Ipp8u* pBuffer, IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00153.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00153.c deleted file mode 100644 index d99c422be..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00153.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) -IPPAPI(IppStatus, l9_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) -IPPAPI(IppStatus, k1_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) -IPPAPI(IppStatus, h9_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Update,(const Ipp8u* pSrc, int len, IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00154.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00154.c deleted file mode 100644 index 39ffa7839..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00154.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) -IPPAPI(IppStatus, l9_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) -IPPAPI(IppStatus, k1_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) -IPPAPI(IppStatus, h9_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00155.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00155.c deleted file mode 100644 index 16f20d298..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00155.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) -IPPAPI(IppStatus, l9_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) -IPPAPI(IppStatus, k1_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) -IPPAPI(IppStatus, h9_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5Final,(Ipp8u* pMD, IppsMD5State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00156.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00156.c deleted file mode 100644 index d95818298..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00156.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMD5MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMD5MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMD5MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsMD5MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMD5MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMD5MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00157.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00157.c deleted file mode 100644 index 7c2f64714..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00157.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsSM3GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsSM3GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsSM3GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00158.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00158.c deleted file mode 100644 index af5180247..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00158.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3Init,(IppsSM3State* pState)) -IPPAPI(IppStatus, l9_ippsSM3Init,(IppsSM3State* pState)) -IPPAPI(IppStatus, k1_ippsSM3Init,(IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Init,(IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3Init( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3Init,(IppsSM3State* pState)) -IPPAPI(IppStatus, h9_ippsSM3Init,(IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Init,(IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3Init( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3Init( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00159.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00159.c deleted file mode 100644 index c86eab3cf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00159.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) -IPPAPI(IppStatus, l9_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) -IPPAPI(IppStatus, k1_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) -IPPAPI(IppStatus, h9_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Duplicate,(const IppsSM3State* pSrcState, IppsSM3State* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3Duplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3Duplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00160.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00160.c deleted file mode 100644 index 37ce9b17d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00160.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3Pack( pState, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Pack,(const IppsSM3State* pState, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3Pack( pState, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3Pack( pState, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00161.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00161.c deleted file mode 100644 index 9f697070b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00161.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) -IPPAPI(IppStatus, l9_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) -IPPAPI(IppStatus, k1_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3Unpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) -IPPAPI(IppStatus, h9_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Unpack,(const Ipp8u* pBuffer, IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3Unpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3Unpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00162.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00162.c deleted file mode 100644 index 9eb60b711..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00162.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) -IPPAPI(IppStatus, l9_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) -IPPAPI(IppStatus, k1_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3Update( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) -IPPAPI(IppStatus, h9_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Update,(const Ipp8u* pSrc, int len, IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3Update( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3Update( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00163.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00163.c deleted file mode 100644 index d437359b4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00163.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) -IPPAPI(IppStatus, l9_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) -IPPAPI(IppStatus, k1_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) -IPPAPI(IppStatus, h9_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3GetTag,(Ipp8u* pTag, Ipp32u tagLen, const IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3GetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3GetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00164.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00164.c deleted file mode 100644 index e41749d6d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00164.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) -IPPAPI(IppStatus, l9_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) -IPPAPI(IppStatus, k1_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3Final( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) -IPPAPI(IppStatus, h9_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3Final,(Ipp8u* pMD, IppsSM3State* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3Final( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3Final( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00165.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00165.c deleted file mode 100644 index 4eba930f1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00165.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, l9_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, k1_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSM3MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSM3MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSM3MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -IPPAPI(IppStatus, h9_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) - -IPPFUN(IppStatus,sgx_disp_ippsSM3MessageDigest,(const Ipp8u* pMsg, int len, Ipp8u* pMD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSM3MessageDigest( pMsg, len, pMD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSM3MessageDigest( pMsg, len, pMD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00166.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00166.c deleted file mode 100644 index 7e9f05f24..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00166.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashGetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsHashGetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsHashGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashGetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsHashGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00167.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00167.c deleted file mode 100644 index 4ee4ebfce..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00167.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, l9_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, k1_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashInit( pState, hashAlg ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashInit( pState, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashInit( pState, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, h9_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHashInit,(IppsHashState* pState, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashInit( pState, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashInit( pState, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00168.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00168.c deleted file mode 100644 index e2ad120a7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00168.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, l9_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, k1_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashPack( pState, pBuffer, bufSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashPack( pState, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashPack( pState, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, h9_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashPack,(const IppsHashState* pState, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashPack( pState, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashPack( pState, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00169.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00169.c deleted file mode 100644 index 72e06670f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00169.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) -IPPAPI(IppStatus, l9_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) -IPPAPI(IppStatus, k1_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashUnpack( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashUnpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashUnpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) -IPPAPI(IppStatus, h9_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUnpack,(const Ipp8u* pBuffer, IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashUnpack( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashUnpack( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00170.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00170.c deleted file mode 100644 index c1727569f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00170.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) -IPPAPI(IppStatus, l9_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) -IPPAPI(IppStatus, k1_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashDuplicate( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashDuplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashDuplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) -IPPAPI(IppStatus, h9_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashDuplicate,(const IppsHashState* pSrcState, IppsHashState* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashDuplicate( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashDuplicate( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00171.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00171.c deleted file mode 100644 index a173c8112..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00171.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) -IPPAPI(IppStatus, l9_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) -IPPAPI(IppStatus, k1_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashUpdate( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashUpdate( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashUpdate( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) -IPPAPI(IppStatus, h9_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashUpdate( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashUpdate( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00172.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00172.c deleted file mode 100644 index 63f1ad335..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00172.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) -IPPAPI(IppStatus, l9_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) -IPPAPI(IppStatus, k1_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashGetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashGetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashGetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) -IPPAPI(IppStatus, h9_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetTag,(Ipp8u* pTag, int tagLen, const IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashGetTag( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashGetTag( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00173.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00173.c deleted file mode 100644 index 9bb9149d6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00173.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) -IPPAPI(IppStatus, l9_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) -IPPAPI(IppStatus, k1_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashFinal( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashFinal( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashFinal( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) -IPPAPI(IppStatus, h9_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashFinal,(Ipp8u* pMD, IppsHashState* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashFinal( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashFinal( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00174.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00174.c deleted file mode 100644 index 39610e427..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00174.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, l9_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, k1_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMessage( pMsg, len, pMD, hashAlg ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMessage( pMsg, len, pMD, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMessage( pMsg, len, pMD, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, h9_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMessage( pMsg, len, pMD, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMessage( pMsg, len, pMD, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00175.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00175.c deleted file mode 100644 index 6dc25f830..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00175.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_MD5, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_MD5, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_MD5, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_MD5, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_MD5( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_MD5( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_MD5( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_MD5, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_MD5, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_MD5, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_MD5( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_MD5( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00176.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00176.c deleted file mode 100644 index 2983a8c00..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00176.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SM3, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SM3, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SM3, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SM3, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SM3( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SM3( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SM3( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SM3, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SM3, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SM3, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SM3( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SM3( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00177.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00177.c deleted file mode 100644 index 72e1c8af8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00177.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA1, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA1, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA1, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA1( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA1( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA1, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA1, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA1( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00178.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00178.c deleted file mode 100644 index c62850ff3..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00178.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA1_NI, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA1_NI, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA1_NI, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA1_NI, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA1_NI( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA1_NI( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA1_NI( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA1_NI, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA1_NI, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA1_NI, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA1_NI( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA1_NI( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00179.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00179.c deleted file mode 100644 index 5fe504516..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00179.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA1_TT, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA1_TT, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA1_TT, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA1_TT, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA1_TT( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA1_TT( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA1_TT( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA1_TT, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA1_TT, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA1_TT, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA1_TT( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA1_TT( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00180.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00180.c deleted file mode 100644 index 05d4ac6a4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00180.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA256, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA256, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA256, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA256, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA256( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA256( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA256( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA256, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA256, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA256, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA256( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA256( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00181.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00181.c deleted file mode 100644 index bc06781f8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00181.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA256_NI, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA256_NI, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA256_NI, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA256_NI, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA256_NI( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA256_NI( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA256_NI( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA256_NI, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA256_NI, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA256_NI, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA256_NI( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA256_NI( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00182.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00182.c deleted file mode 100644 index 6b9c91ddc..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00182.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA256_TT, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA256_TT, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA256_TT, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA256_TT, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA256_TT( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA256_TT( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA256_TT( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA256_TT, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA256_TT, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA256_TT, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA256_TT( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA256_TT( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00183.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00183.c deleted file mode 100644 index 8c3368d72..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00183.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA224, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA224, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA224, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA224, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA224( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA224( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA224( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA224, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA224, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA224, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA224( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA224( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00184.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00184.c deleted file mode 100644 index e546f916c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00184.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA224_NI, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA224_NI, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA224_NI, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA224_NI, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA224_NI( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA224_NI( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA224_NI( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA224_NI, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA224_NI, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA224_NI, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA224_NI( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA224_NI( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00185.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00185.c deleted file mode 100644 index 2e43a4b9f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00185.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA224_TT, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA224_TT, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA224_TT, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA224_TT, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA224_TT( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA224_TT( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA224_TT( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA224_TT, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA224_TT, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA224_TT, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA224_TT( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA224_TT( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00186.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00186.c deleted file mode 100644 index cf75736aa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00186.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA512, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA512, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA512, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA512, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA512( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA512( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA512( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA512, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA512, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA512, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA512( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA512( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00187.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00187.c deleted file mode 100644 index 4afac172e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00187.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA384, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA384, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA384, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA384, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA384( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA384( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA384( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA384, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA384, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA384, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA384( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA384( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00188.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00188.c deleted file mode 100644 index a24110c55..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00188.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA512_256, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA512_256, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA512_256, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA512_256, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA512_256( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA512_256( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA512_256( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA512_256, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA512_256, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA512_256, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA512_256( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA512_256( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00189.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00189.c deleted file mode 100644 index 01aeac84e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00189.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsHashMethod*, y8_ippsHashMethod_SHA512_224, (void) ) -IPPAPI( const IppsHashMethod*, l9_ippsHashMethod_SHA512_224, (void) ) -IPPAPI( const IppsHashMethod*, k1_ippsHashMethod_SHA512_224, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA512_224, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethod_SHA512_224( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethod_SHA512_224( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethod_SHA512_224( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsHashMethod*, p8_ippsHashMethod_SHA512_224, (void) ) -IPPAPI( const IppsHashMethod*, h9_ippsHashMethod_SHA512_224, (void) ) - -IPPFUN( const IppsHashMethod*,sgx_disp_ippsHashMethod_SHA512_224, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethod_SHA512_224( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethod_SHA512_224( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00190.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00190.c deleted file mode 100644 index 64d8329f3..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00190.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodGetSize, (int* pSize) ) -IPPAPI( IppStatus, l9_ippsHashMethodGetSize, (int* pSize) ) -IPPAPI( IppStatus, k1_ippsHashMethodGetSize, (int* pSize) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodGetSize, (int* pSize) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodGetSize, (int* pSize) ) -IPPAPI( IppStatus, h9_ippsHashMethodGetSize, (int* pSize) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodGetSize, (int* pSize) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00191.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00191.c deleted file mode 100644 index 590421cfb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00191.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_MD5( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_MD5( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_MD5( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_MD5, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_MD5( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_MD5( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00192.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00192.c deleted file mode 100644 index 3ce7cc6fa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00192.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SM3( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SM3( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SM3( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SM3, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SM3( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SM3( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00193.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00193.c deleted file mode 100644 index 03bf66589..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00193.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA1( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA1( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA1( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA1, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA1( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA1( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00194.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00194.c deleted file mode 100644 index dc2c8d8a5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00194.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA1_NI( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA1_NI( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA1_NI( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA1_NI, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA1_NI( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA1_NI( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00195.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00195.c deleted file mode 100644 index 8ef07de58..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00195.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA1_TT( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA1_TT( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA1_TT( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA1_TT, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA1_TT( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA1_TT( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00196.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00196.c deleted file mode 100644 index f42df9cb4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00196.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA256( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA256( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA256( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA256, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA256( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA256( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00197.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00197.c deleted file mode 100644 index 4575d093b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00197.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA256_NI( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA256_NI( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA256_NI( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA256_NI, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA256_NI( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA256_NI( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00198.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00198.c deleted file mode 100644 index 9c4025839..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00198.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA256_TT( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA256_TT( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA256_TT( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA256_TT, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA256_TT( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA256_TT( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00199.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00199.c deleted file mode 100644 index be4c61cbe..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00199.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA224( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA224( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA224( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA224, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA224( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA224( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00200.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00200.c deleted file mode 100644 index e780d60ad..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00200.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA224_NI( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA224_NI( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA224_NI( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA224_NI, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA224_NI( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA224_NI( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00201.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00201.c deleted file mode 100644 index 330f7f5a6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00201.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA224_TT( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA224_TT( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA224_TT( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA224_TT, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA224_TT( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA224_TT( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00202.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00202.c deleted file mode 100644 index 84c12c8b6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00202.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA512( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA512( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA512( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA512, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA512( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA512( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00203.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00203.c deleted file mode 100644 index b99d7e84e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00203.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA384( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA384( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA384( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA384, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA384( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA384( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00204.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00204.c deleted file mode 100644 index 8952ab85a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00204.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA512_256( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA512_256( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA512_256( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA512_256, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA512_256( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA512_256( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00205.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00205.c deleted file mode 100644 index 76804815d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00205.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( IppStatus, y8_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, l9_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, k1_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodSet_SHA512_224( pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodSet_SHA512_224( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodSet_SHA512_224( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI( IppStatus, p8_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) -IPPAPI( IppStatus, h9_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) - -IPPFUN( IppStatus,sgx_disp_ippsHashMethodSet_SHA512_224, (IppsHashMethod* pMethod) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodSet_SHA512_224( pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodSet_SHA512_224( pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00206.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00206.c deleted file mode 100644 index eb58e4d18..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00206.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashGetSize_rmf,(int* pSize)) -IPPAPI(IppStatus, l9_ippsHashGetSize_rmf,(int* pSize)) -IPPAPI(IppStatus, k1_ippsHashGetSize_rmf,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetSize_rmf,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashGetSize_rmf( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashGetSize_rmf( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashGetSize_rmf( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashGetSize_rmf,(int* pSize)) -IPPAPI(IppStatus, h9_ippsHashGetSize_rmf,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetSize_rmf,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashGetSize_rmf( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashGetSize_rmf( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00207.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00207.c deleted file mode 100644 index 995c28739..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00207.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashInit_rmf( pState, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashInit_rmf( pState, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashInit_rmf( pState, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHashInit_rmf,(IppsHashState_rmf* pState, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashInit_rmf( pState, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashInit_rmf( pState, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00208.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00208.c deleted file mode 100644 index fef0e67d0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00208.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, l9_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, k1_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashPack_rmf( pState, pBuffer, bufSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashPack_rmf( pState, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashPack_rmf( pState, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, h9_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHashPack_rmf,(const IppsHashState_rmf* pState, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashPack_rmf( pState, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashPack_rmf( pState, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00209.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00209.c deleted file mode 100644 index 2ecc8d05d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00209.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, l9_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, k1_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashUnpack_rmf( pBuffer, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashUnpack_rmf( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashUnpack_rmf( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, h9_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUnpack_rmf,(const Ipp8u* pBuffer, IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashUnpack_rmf( pBuffer, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashUnpack_rmf( pBuffer, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00210.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00210.c deleted file mode 100644 index 4a90dd8a5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00210.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) -IPPAPI(IppStatus, l9_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) -IPPAPI(IppStatus, k1_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashDuplicate_rmf( pSrcState, pDstState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashDuplicate_rmf( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashDuplicate_rmf( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) -IPPAPI(IppStatus, h9_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashDuplicate_rmf,(const IppsHashState_rmf* pSrcState, IppsHashState_rmf* pDstState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashDuplicate_rmf( pSrcState, pDstState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashDuplicate_rmf( pSrcState, pDstState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00211.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00211.c deleted file mode 100644 index e77bb2e1b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00211.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, l9_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, k1_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashUpdate_rmf( pSrc, len, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashUpdate_rmf( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashUpdate_rmf( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, h9_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashUpdate_rmf( pSrc, len, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashUpdate_rmf( pSrc, len, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00212.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00212.c deleted file mode 100644 index 6155f9cb4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00212.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) -IPPAPI(IppStatus, l9_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) -IPPAPI(IppStatus, k1_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashGetTag_rmf( pMD, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashGetTag_rmf( pMD, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashGetTag_rmf( pMD, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) -IPPAPI(IppStatus, h9_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetTag_rmf,(Ipp8u* pMD, int tagLen, const IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashGetTag_rmf( pMD, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashGetTag_rmf( pMD, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00213.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00213.c deleted file mode 100644 index 4e6027d09..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00213.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, l9_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, k1_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashFinal_rmf( pMD, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashFinal_rmf( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashFinal_rmf( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) -IPPAPI(IppStatus, h9_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashFinal_rmf,(Ipp8u* pMD, IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashFinal_rmf( pMD, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashFinal_rmf( pMD, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00214.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00214.c deleted file mode 100644 index 7d7a57904..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00214.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHashMessage_rmf,(const Ipp8u* pMsg, int len, Ipp8u* pMD, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMessage_rmf( pMsg, len, pMD, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00215.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00215.c deleted file mode 100644 index e9d140369..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00215.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashMethodGetInfo( pInfo, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashMethodGetInfo( pInfo, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashMethodGetInfo( pInfo, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHashMethodGetInfo,(IppsHashInfo* pInfo, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashMethodGetInfo( pInfo, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashMethodGetInfo( pInfo, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00216.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00216.c deleted file mode 100644 index 6cff30c62..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00216.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) -IPPAPI(IppStatus, l9_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) -IPPAPI(IppStatus, k1_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHashGetInfo_rmf( pInfo, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHashGetInfo_rmf( pInfo, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHashGetInfo_rmf( pInfo, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) -IPPAPI(IppStatus, h9_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsHashGetInfo_rmf,(IppsHashInfo* pInfo, const IppsHashState_rmf* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHashGetInfo_rmf( pInfo, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHashGetInfo_rmf( pInfo, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00217.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00217.c deleted file mode 100644 index 13871400c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00217.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, l9_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, k1_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, h9_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMGF( pSeed, seedLen, pMask, maskLen, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00218.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00218.c deleted file mode 100644 index eefb0508e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00218.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsMGF1_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMGF1_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00219.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00219.c deleted file mode 100644 index 033aa2c7e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00219.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsMGF2_rmf,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMGF2_rmf( pSeed, seedLen, pMask, maskLen, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00220.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00220.c deleted file mode 100644 index 9a8097a56..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00220.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_GetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsHMAC_GetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsHMAC_GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_GetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_GetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsHMAC_GetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_GetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_GetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_GetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00221.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00221.c deleted file mode 100644 index f15933813..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00221.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, l9_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, k1_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, h9_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Init( pKey, keyLen, pCtx, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00222.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00222.c deleted file mode 100644 index 1c242fa79..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00222.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, l9_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, k1_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, h9_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Pack,(const IppsHMACState* pCtx, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Pack( pCtx, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00223.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00223.c deleted file mode 100644 index 923027d4c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00223.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) -IPPAPI(IppStatus, l9_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) -IPPAPI(IppStatus, k1_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Unpack( pBuffer, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Unpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Unpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) -IPPAPI(IppStatus, h9_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Unpack,(const Ipp8u* pBuffer, IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Unpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Unpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00224.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00224.c deleted file mode 100644 index 6763e40f3..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00224.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) -IPPAPI(IppStatus, l9_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) -IPPAPI(IppStatus, k1_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) -IPPAPI(IppStatus, h9_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Duplicate,(const IppsHMACState* pSrcCtx, IppsHMACState* pDstCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Duplicate( pSrcCtx, pDstCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00225.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00225.c deleted file mode 100644 index 45c84f02b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00225.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) -IPPAPI(IppStatus, l9_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) -IPPAPI(IppStatus, k1_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Update( pSrc, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Update( pSrc, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Update( pSrc, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) -IPPAPI(IppStatus, h9_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Update( pSrc, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Update( pSrc, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00226.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00226.c deleted file mode 100644 index 12997aeb7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00226.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) -IPPAPI(IppStatus, l9_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) -IPPAPI(IppStatus, k1_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Final( pMD, mdLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Final( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Final( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) -IPPAPI(IppStatus, h9_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Final( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Final( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00227.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00227.c deleted file mode 100644 index fee1eae92..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00227.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) -IPPAPI(IppStatus, l9_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) -IPPAPI(IppStatus, k1_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_GetTag( pMD, mdLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_GetTag( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_GetTag( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) -IPPAPI(IppStatus, h9_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_GetTag( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_GetTag( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00228.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00228.c deleted file mode 100644 index 3095326bf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00228.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, l9_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, k1_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) -IPPAPI(IppStatus, h9_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) - -IPPFUN(IppStatus,sgx_disp_ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, IppHashAlgId hashAlg)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMAC_Message( pMsg, msgLen, pKey, keyLen, pMD, mdLen, hashAlg ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00229.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00229.c deleted file mode 100644 index 9704c400f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00229.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACGetSize_rmf,(int* pSize)) -IPPAPI(IppStatus, l9_ippsHMACGetSize_rmf,(int* pSize)) -IPPAPI(IppStatus, k1_ippsHMACGetSize_rmf,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACGetSize_rmf,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACGetSize_rmf( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACGetSize_rmf( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACGetSize_rmf( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACGetSize_rmf,(int* pSize)) -IPPAPI(IppStatus, h9_ippsHMACGetSize_rmf,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACGetSize_rmf,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACGetSize_rmf( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACGetSize_rmf( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00230.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00230.c deleted file mode 100644 index 70f4f007e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00230.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACInit_rmf,(const Ipp8u* pKey, int keyLen, IppsHMACState_rmf* pCtx, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACInit_rmf( pKey, keyLen, pCtx, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00231.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00231.c deleted file mode 100644 index 773172050..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00231.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, l9_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, k1_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) -IPPAPI(IppStatus, h9_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACPack_rmf,(const IppsHMACState_rmf* pCtx, Ipp8u* pBuffer, int bufSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACPack_rmf( pCtx, pBuffer, bufSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00232.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00232.c deleted file mode 100644 index 99f4bdf58..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00232.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, l9_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, k1_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACUnpack_rmf( pBuffer, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACUnpack_rmf( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACUnpack_rmf( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, h9_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACUnpack_rmf,(const Ipp8u* pBuffer, IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACUnpack_rmf( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACUnpack_rmf( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00233.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00233.c deleted file mode 100644 index e92ab7717..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00233.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) -IPPAPI(IppStatus, l9_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) -IPPAPI(IppStatus, k1_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) -IPPAPI(IppStatus, h9_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACDuplicate_rmf,(const IppsHMACState_rmf* pSrcCtx, IppsHMACState_rmf* pDstCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACDuplicate_rmf( pSrcCtx, pDstCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00234.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00234.c deleted file mode 100644 index 056668a90..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00234.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, l9_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, k1_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACUpdate_rmf( pSrc, len, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACUpdate_rmf( pSrc, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACUpdate_rmf( pSrc, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, h9_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACUpdate_rmf,(const Ipp8u* pSrc, int len, IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACUpdate_rmf( pSrc, len, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACUpdate_rmf( pSrc, len, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00235.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00235.c deleted file mode 100644 index e035b2885..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00235.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, l9_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, k1_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, h9_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACFinal_rmf,(Ipp8u* pMD, int mdLen, IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACFinal_rmf( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00236.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00236.c deleted file mode 100644 index 118fb4ca6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00236.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, l9_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, k1_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) -IPPAPI(IppStatus, h9_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACGetTag_rmf,(Ipp8u* pMD, int mdLen, const IppsHMACState_rmf* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACGetTag_rmf( pMD, mdLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00237.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00237.c deleted file mode 100644 index 41accb773..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00237.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsHMACMessage_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pKey, int keyLen, Ipp8u* pMD, int mdLen, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsHMACMessage_rmf( pMsg, msgLen, pKey, keyLen, pMD, mdLen, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00238.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00238.c deleted file mode 100644 index 4debdfeab..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00238.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsBigNumGetSize,(int length, int* pSize)) -IPPAPI(IppStatus, l9_ippsBigNumGetSize,(int length, int* pSize)) -IPPAPI(IppStatus, k1_ippsBigNumGetSize,(int length, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsBigNumGetSize,(int length, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsBigNumGetSize( length, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsBigNumGetSize( length, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsBigNumGetSize( length, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsBigNumGetSize,(int length, int* pSize)) -IPPAPI(IppStatus, h9_ippsBigNumGetSize,(int length, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsBigNumGetSize,(int length, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsBigNumGetSize( length, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsBigNumGetSize( length, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00239.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00239.c deleted file mode 100644 index f0316b20a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00239.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsBigNumInit,(int length, IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsBigNumInit,(int length, IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsBigNumInit,(int length, IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsBigNumInit,(int length, IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsBigNumInit( length, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsBigNumInit( length, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsBigNumInit( length, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsBigNumInit,(int length, IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsBigNumInit,(int length, IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsBigNumInit,(int length, IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsBigNumInit( length, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsBigNumInit( length, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00240.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00240.c deleted file mode 100644 index 45ce49b1f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00240.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) -IPPAPI(IppStatus, l9_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) -IPPAPI(IppStatus, k1_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) - -IPPFUN(IppStatus,sgx_disp_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsCmpZero_BN( pBN, pResult ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsCmpZero_BN( pBN, pResult ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsCmpZero_BN( pBN, pResult ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) -IPPAPI(IppStatus, h9_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) - -IPPFUN(IppStatus,sgx_disp_ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsCmpZero_BN( pBN, pResult ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsCmpZero_BN( pBN, pResult ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00241.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00241.c deleted file mode 100644 index 66774d955..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00241.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) -IPPAPI(IppStatus, l9_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) -IPPAPI(IppStatus, k1_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) - -IPPFUN(IppStatus,sgx_disp_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsCmp_BN( pA, pB, pResult ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsCmp_BN( pA, pB, pResult ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsCmp_BN( pA, pB, pResult ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) -IPPAPI(IppStatus, h9_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) - -IPPFUN(IppStatus,sgx_disp_ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsCmp_BN( pA, pB, pResult ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsCmp_BN( pA, pB, pResult ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00242.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00242.c deleted file mode 100644 index e2b152494..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00242.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) -IPPAPI(IppStatus, l9_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) -IPPAPI(IppStatus, k1_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGetSize_BN( pBN, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGetSize_BN( pBN, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGetSize_BN( pBN, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) -IPPAPI(IppStatus, h9_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGetSize_BN,(const IppsBigNumState* pBN, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGetSize_BN( pBN, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGetSize_BN( pBN, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00243.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00243.c deleted file mode 100644 index c1658c7d1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00243.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSet_BN( sgn, length, pData, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSet_BN( sgn, length, pData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSet_BN( sgn, length, pData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsSet_BN,(IppsBigNumSGN sgn, int length, const Ipp32u* pData, IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSet_BN( sgn, length, pData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSet_BN( sgn, length, pData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00244.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00244.c deleted file mode 100644 index fef8739a7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00244.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGet_BN( pSgn, pLength, pData, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGet_BN( pSgn, pLength, pData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGet_BN( pSgn, pLength, pData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsGet_BN,(IppsBigNumSGN* pSgn, int* pLength, Ipp32u* pData, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGet_BN( pSgn, pLength, pData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGet_BN( pSgn, pLength, pData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00245.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00245.c deleted file mode 100644 index c1ca34670..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00245.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRef_BN( pSgn, bitSize, ppData, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRef_BN( pSgn, bitSize, ppData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRef_BN( pSgn, bitSize, ppData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRef_BN( pSgn, bitSize, ppData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRef_BN( pSgn, bitSize, ppData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00246.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00246.c deleted file mode 100644 index 967bfcf3b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00246.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsExtGet_BN,(IppsBigNumSGN* pSgn, int* pBitSize, Ipp32u* pData, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsExtGet_BN( pSgn, pBitSize, pData, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00247.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00247.c deleted file mode 100644 index a13d92f30..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00247.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsAdd_BN( pA, pB, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsAdd_BN( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsAdd_BN( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsAdd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsAdd_BN( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsAdd_BN( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00248.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00248.c deleted file mode 100644 index d8fd33f25..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00248.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSub_BN( pA, pB, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSub_BN( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSub_BN( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsSub_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSub_BN( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSub_BN( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00249.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00249.c deleted file mode 100644 index 07fbbc723..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00249.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMul_BN( pA, pB, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMul_BN( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMul_BN( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMul_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMul_BN( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMul_BN( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00250.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00250.c deleted file mode 100644 index da5035c29..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00250.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMAC_BN_I( pA, pB, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMAC_BN_I( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMAC_BN_I( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMAC_BN_I, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMAC_BN_I( pA, pB, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMAC_BN_I( pA, pB, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00251.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00251.c deleted file mode 100644 index 7108956b2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00251.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDiv_BN( pA, pB, pQ, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDiv_BN( pA, pB, pQ, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDiv_BN( pA, pB, pQ, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsDiv_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDiv_BN( pA, pB, pQ, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDiv_BN( pA, pB, pQ, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00252.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00252.c deleted file mode 100644 index 9da0c39b9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00252.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMod_BN( pA, pM, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMod_BN( pA, pM, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMod_BN( pA, pM, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMod_BN, (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMod_BN( pA, pM, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMod_BN( pA, pM, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00253.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00253.c deleted file mode 100644 index 5fc14e768..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00253.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) -IPPAPI(IppStatus, l9_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) -IPPAPI(IppStatus, k1_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) - -IPPFUN(IppStatus,sgx_disp_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGcd_BN( pA, pB, pGCD ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGcd_BN( pA, pB, pGCD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGcd_BN( pA, pB, pGCD ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) -IPPAPI(IppStatus, h9_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) - -IPPFUN(IppStatus,sgx_disp_ippsGcd_BN, (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGcd_BN( pA, pB, pGCD ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGcd_BN( pA, pB, pGCD ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00254.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00254.c deleted file mode 100644 index 46bd61fc9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00254.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) -IPPAPI(IppStatus, l9_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) -IPPAPI(IppStatus, k1_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) - -IPPFUN(IppStatus,sgx_disp_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsModInv_BN( pA, pM, pInv ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsModInv_BN( pA, pM, pInv ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsModInv_BN( pA, pM, pInv ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) -IPPAPI(IppStatus, h9_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) - -IPPFUN(IppStatus,sgx_disp_ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsModInv_BN( pA, pM, pInv ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsModInv_BN( pA, pM, pInv ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00255.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00255.c deleted file mode 100644 index 0b7218a71..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00255.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsSetOctString_BN( pStr, strLen, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsSetOctString_BN( pStr, strLen, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsSetOctString_BN( pStr, strLen, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsSetOctString_BN( pStr, strLen, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsSetOctString_BN( pStr, strLen, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00256.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00256.c deleted file mode 100644 index b08b283c7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00256.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, l9_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, k1_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGetOctString_BN( pStr, strLen, pBN ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGetOctString_BN( pStr, strLen, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGetOctString_BN( pStr, strLen, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) -IPPAPI(IppStatus, h9_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) - -IPPFUN(IppStatus,sgx_disp_ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGetOctString_BN( pStr, strLen, pBN ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGetOctString_BN( pStr, strLen, pBN ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00257.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00257.c deleted file mode 100644 index a32e11495..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00257.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) -IPPAPI(IppStatus, l9_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) -IPPAPI(IppStatus, k1_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontGetSize( method, length, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontGetSize( method, length, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontGetSize( method, length, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) -IPPAPI(IppStatus, h9_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsMontGetSize,(IppsExpMethod method, int length, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontGetSize( method, length, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontGetSize( method, length, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00258.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00258.c deleted file mode 100644 index 90227e3eb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00258.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) -IPPAPI(IppStatus, l9_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) -IPPAPI(IppStatus, k1_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontInit( method, length, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontInit( method, length, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontInit( method, length, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) -IPPAPI(IppStatus, h9_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontInit( method, length, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontInit( method, length, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00259.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00259.c deleted file mode 100644 index 6f8ba97bd..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00259.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) -IPPAPI(IppStatus, l9_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) -IPPAPI(IppStatus, k1_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontSet( pModulo, size, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontSet( pModulo, size, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontSet( pModulo, size, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) -IPPAPI(IppStatus, h9_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontSet( pModulo, size, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontSet( pModulo, size, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00260.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00260.c deleted file mode 100644 index 03eee0737..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00260.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) -IPPAPI(IppStatus, l9_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) -IPPAPI(IppStatus, k1_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontGet( pModulo, pSize, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontGet( pModulo, pSize, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontGet( pModulo, pSize, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) -IPPAPI(IppStatus, h9_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsMontGet,(Ipp32u* pModulo, int* pSize, const IppsMontState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontGet( pModulo, pSize, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontGet( pModulo, pSize, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00261.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00261.c deleted file mode 100644 index 09eea04d0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00261.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontForm( pA, pCtx, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontForm( pA, pCtx, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontForm( pA, pCtx, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMontForm,(const IppsBigNumState* pA, IppsMontState* pCtx, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontForm( pA, pCtx, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontForm( pA, pCtx, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00262.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00262.c deleted file mode 100644 index 553da8b43..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00262.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontMul( pA, pB, m, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontMul( pA, pB, m, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontMul( pA, pB, m, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontMul( pA, pB, m, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontMul( pA, pB, m, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00263.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00263.c deleted file mode 100644 index 90aa90bb4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00263.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) -IPPAPI(IppStatus, l9_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) -IPPAPI(IppStatus, k1_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsMontExp( pA, pE, m, pR ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsMontExp( pA, pE, m, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsMontExp( pA, pE, m, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) -IPPAPI(IppStatus, h9_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) - -IPPFUN(IppStatus,sgx_disp_ippsMontExp, (const IppsBigNumState* pA, const IppsBigNumState* pE, IppsMontState* m, IppsBigNumState* pR)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsMontExp( pA, pE, m, pR ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsMontExp( pA, pE, m, pR ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00264.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00264.c deleted file mode 100644 index 1140ecaec..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00264.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGGetSize,(int* pSize)) -IPPAPI(IppStatus, l9_ippsPRNGGetSize,(int* pSize)) -IPPAPI(IppStatus, k1_ippsPRNGGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGGetSize( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGGetSize,(int* pSize)) -IPPAPI(IppStatus, h9_ippsPRNGGetSize,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGGetSize,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGGetSize( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGGetSize( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00265.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00265.c deleted file mode 100644 index aa5655ed7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00265.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGInit( seedBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGInit( seedBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGInit( seedBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGInit, (int seedBits, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGInit( seedBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGInit( seedBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00266.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00266.c deleted file mode 100644 index 4f12eb6be..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00266.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGSetModulus( pMod, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGSetModulus( pMod, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGSetModulus( pMod, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetModulus,(const IppsBigNumState* pMod, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGSetModulus( pMod, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGSetModulus( pMod, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00267.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00267.c deleted file mode 100644 index abced3471..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00267.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGSetH0( pH0, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGSetH0( pH0, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGSetH0( pH0, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetH0, (const IppsBigNumState* pH0, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGSetH0( pH0, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGSetH0( pH0, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00268.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00268.c deleted file mode 100644 index 71d164055..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00268.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGSetAugment( pAug, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGSetAugment( pAug, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGSetAugment( pAug, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetAugment,(const IppsBigNumState* pAug, IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGSetAugment( pAug, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGSetAugment( pAug, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00269.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00269.c deleted file mode 100644 index 7a43b5dec..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00269.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGSetSeed( pSeed, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGSetSeed( pSeed, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGSetSeed( pSeed, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGSetSeed, (const IppsBigNumState* pSeed,IppsPRNGState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGSetSeed( pSeed, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGSetSeed( pSeed, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00270.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00270.c deleted file mode 100644 index 8d4977886..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00270.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) -IPPAPI(IppStatus, l9_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) -IPPAPI(IppStatus, k1_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGGetSeed( pCtx, pSeed ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGGetSeed( pCtx, pSeed ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGGetSeed( pCtx, pSeed ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) -IPPAPI(IppStatus, h9_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGGetSeed, (const IppsPRNGState* pCtx,IppsBigNumState* pSeed)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGGetSeed( pCtx, pSeed ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGGetSeed( pCtx, pSeed ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00271.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00271.c deleted file mode 100644 index a85bfe213..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00271.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGen( pRand, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGen( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGen( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGen, (Ipp32u* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGen( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGen( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00272.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00272.c deleted file mode 100644 index bc58ec184..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00272.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGen_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGen_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGen_BN( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGen_BN, (IppsBigNumState* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGen_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGen_BN( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00273.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00273.c deleted file mode 100644 index df270e2a5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00273.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGenRDRAND( pRand, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGenRDRAND( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGenRDRAND( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGenRDRAND, (Ipp32u* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGenRDRAND( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGenRDRAND( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00274.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00274.c deleted file mode 100644 index 026213aa3..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00274.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, l9_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, k1_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, h9_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPRNGenRDRAND_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPRNGenRDRAND_BN( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00275.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00275.c deleted file mode 100644 index 71d178303..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00275.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, l9_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, k1_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTRNGenRDSEED( pRand, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTRNGenRDSEED( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTRNGenRDSEED( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, h9_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsTRNGenRDSEED, (Ipp32u* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTRNGenRDSEED( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTRNGenRDSEED( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00276.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00276.c deleted file mode 100644 index da7f6d792..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00276.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, l9_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, k1_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -IPPAPI(IppStatus, h9_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsTRNGenRDSEED_BN,(IppsBigNumState* pRand, int nBits, void* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsTRNGenRDSEED_BN( pRand, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00277.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00277.c deleted file mode 100644 index 1e4f43426..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00277.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeGetSize,(int nMaxBits, int* pSize)) -IPPAPI(IppStatus, l9_ippsPrimeGetSize,(int nMaxBits, int* pSize)) -IPPAPI(IppStatus, k1_ippsPrimeGetSize,(int nMaxBits, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGetSize,(int nMaxBits, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeGetSize( nMaxBits, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeGetSize( nMaxBits, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeGetSize( nMaxBits, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeGetSize,(int nMaxBits, int* pSize)) -IPPAPI(IppStatus, h9_ippsPrimeGetSize,(int nMaxBits, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGetSize,(int nMaxBits, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeGetSize( nMaxBits, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeGetSize( nMaxBits, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00278.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00278.c deleted file mode 100644 index 8f6103e9a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00278.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, l9_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, k1_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeInit( nMaxBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeInit( nMaxBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeInit( nMaxBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, h9_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeInit, (int nMaxBits, IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeInit( nMaxBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeInit( nMaxBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00279.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00279.c deleted file mode 100644 index fecdfb0d6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00279.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGen, (int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeGen( nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00280.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00280.c deleted file mode 100644 index d12adc0e9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00280.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeTest,(int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeTest( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00281.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00281.c deleted file mode 100644 index 9151e2e6d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00281.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGen_BN,(IppsBigNumState* pPrime, int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeGen_BN( pPrime, nBits, nTrials, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00282.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00282.c deleted file mode 100644 index 65770fe3b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00282.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeTest_BN,(const IppsBigNumState* pPrime, int nTrials, Ipp32u* pResult, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeTest_BN( pPrime, nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00283.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00283.c deleted file mode 100644 index 263f2e9df..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00283.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) -IPPAPI(IppStatus, l9_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) -IPPAPI(IppStatus, k1_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeGet( pPrime, pLen, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeGet( pPrime, pLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeGet( pPrime, pLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) -IPPAPI(IppStatus, h9_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGet, (Ipp32u* pPrime, int* pLen, const IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeGet( pPrime, pLen, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeGet( pPrime, pLen, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00284.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00284.c deleted file mode 100644 index 12fcdb41c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00284.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) -IPPAPI(IppStatus, l9_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) -IPPAPI(IppStatus, k1_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeGet_BN( pPrime, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeGet_BN( pPrime, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeGet_BN( pPrime, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) -IPPAPI(IppStatus, h9_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeGet_BN,(IppsBigNumState* pPrime, const IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeGet_BN( pPrime, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeGet_BN( pPrime, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00285.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00285.c deleted file mode 100644 index 7a0357e27..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00285.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, l9_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, k1_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeSet( pPrime, nBits, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeSet( pPrime, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeSet( pPrime, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, h9_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeSet, (const Ipp32u* pPrime, int nBits, IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeSet( pPrime, nBits, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeSet( pPrime, nBits, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00286.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00286.c deleted file mode 100644 index ef1f3e3d0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00286.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, l9_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, k1_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsPrimeSet_BN( pPrime, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsPrimeSet_BN( pPrime, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsPrimeSet_BN( pPrime, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) -IPPAPI(IppStatus, h9_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsPrimeSet_BN,(const IppsBigNumState* pPrime, IppsPrimeState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsPrimeSet_BN( pPrime, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsPrimeSet_BN( pPrime, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00287.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00287.c deleted file mode 100644 index 13870c71d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00287.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) -IPPAPI(IppStatus, l9_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) -IPPAPI(IppStatus, k1_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) -IPPAPI(IppStatus, h9_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetSizePublicKey( rsaModulusBitSize, pubicExpBitSize, pKeySize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00288.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00288.c deleted file mode 100644 index d8929fa9c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00288.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, l9_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, k1_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, h9_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize, IppsRSAPublicKeyState* pKey, int keyCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_InitPublicKey( rsaModulusBitSize, publicExpBitSize, pKey, keyCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00289.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00289.c deleted file mode 100644 index 64684aa63..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00289.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus, const IppsBigNumState* pPublicExp, IppsRSAPublicKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_SetPublicKey( pModulus, pPublicExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00290.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00290.c deleted file mode 100644 index 0662188a9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00290.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetPublicKey,(IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, const IppsRSAPublicKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetPublicKey( pModulus, pPublicExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00291.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00291.c deleted file mode 100644 index 859d99d5e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00291.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) -IPPAPI(IppStatus, l9_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) -IPPAPI(IppStatus, k1_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) -IPPAPI(IppStatus, h9_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetSizePrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKeySize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00292.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00292.c deleted file mode 100644 index 0cb3e600e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00292.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, l9_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, k1_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, h9_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_InitPrivateKeyType1( rsaModulusBitSize, privateExpBitSize, pKey, keyCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00293.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00293.c deleted file mode 100644 index b1caf4b74..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00293.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus, const IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_SetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00294.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00294.c deleted file mode 100644 index 3ff7b963e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00294.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetPrivateKeyType1,(IppsBigNumState* pModulus, IppsBigNumState* pPrivateExp, const IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetPrivateKeyType1( pModulus, pPrivateExp, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00295.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00295.c deleted file mode 100644 index 569e852df..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00295.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) -IPPAPI(IppStatus, l9_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) -IPPAPI(IppStatus, k1_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) -IPPAPI(IppStatus, h9_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetSizePrivateKeyType2( factorPbitSize, factorQbitSize, pKeySize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00296.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00296.c deleted file mode 100644 index 465859a09..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00296.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, l9_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, k1_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -IPPAPI(IppStatus, h9_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize, IppsRSAPrivateKeyState* pKey, int keyCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_InitPrivateKeyType2( factorPbitSize, factorQbitSize, pKey, keyCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00297.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00297.c deleted file mode 100644 index e837efcd2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00297.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP, const IppsBigNumState* pFactorQ, const IppsBigNumState* pCrtExpP, const IppsBigNumState* pCrtExpQ, const IppsBigNumState* pInverseQ, IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_SetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00298.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00298.c deleted file mode 100644 index 3d5f89a21..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00298.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetPrivateKeyType2,(IppsBigNumState* pFactorP, IppsBigNumState* pFactorQ, IppsBigNumState* pCrtExpP, IppsBigNumState* pCrtExpQ, IppsBigNumState* pInverseQ, const IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetPrivateKeyType2( pFactorP, pFactorQ, pCrtExpP, pCrtExpQ, pInverseQ, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00299.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00299.c deleted file mode 100644 index ac3f9c3d2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00299.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetBufferSizePublicKey( pBufferSize, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00300.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00300.c deleted file mode 100644 index c395387fd..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00300.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, l9_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, k1_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) -IPPAPI(IppStatus, h9_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GetBufferSizePrivateKey( pBufferSize, pKey ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00301.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00301.c deleted file mode 100644 index 573e554b2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00301.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_Encrypt,(const IppsBigNumState* pPtxt, IppsBigNumState* pCtxt, const IppsRSAPublicKeyState* pKey, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_Encrypt( pPtxt, pCtxt, pKey, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00302.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00302.c deleted file mode 100644 index caac0a97c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00302.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_Decrypt,(const IppsBigNumState* pCtxt, IppsBigNumState* pPtxt, const IppsRSAPrivateKeyState* pKey, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_Decrypt( pCtxt, pPtxt, pKey, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00303.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00303.c deleted file mode 100644 index f3b39d4ea..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00303.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_GenerateKeys,(const IppsBigNumState* pSrcPublicExp, IppsBigNumState* pModulus, IppsBigNumState* pPublicExp, IppsBigNumState* pPrivateExp, IppsRSAPrivateKeyState* pPrivateKeyType2, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_GenerateKeys( pSrcPublicExp, pModulus, pPublicExp, pPrivateExp, pPrivateKeyType2, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00304.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00304.c deleted file mode 100644 index fca61cf62..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00304.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsRSA_ValidateKeys,(int* pResult, const IppsRSAPublicKeyState* pPublicKey, const IppsRSAPrivateKeyState* pPrivateKeyType2, const IppsRSAPrivateKeyState* pPrivateKeyType1, Ipp8u* pScratchBuffer, int nTrials, IppsPrimeState* pPrimeGen, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSA_ValidateKeys( pResult, pPublicKey, pPrivateKeyType2, pPrivateKeyType1, pScratchBuffer, nTrials, pPrimeGen, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00305.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00305.c deleted file mode 100644 index 026621731..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00305.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAEncrypt_OAEP( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00306.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00306.c deleted file mode 100644 index 26f6e0336..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00306.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSADecrypt_OAEP,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSADecrypt_OAEP( pSrc, pLab, labLen, pDst, pDstLen, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00307.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00307.c deleted file mode 100644 index 689b19a17..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00307.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAEncrypt_OAEP_rmf,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pLabel, int labLen, const Ipp8u* pSeed, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAEncrypt_OAEP_rmf( pSrc, srcLen, pLabel, labLen, pSeed, pDst, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00308.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00308.c deleted file mode 100644 index 96f0a8c8b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00308.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSADecrypt_OAEP_rmf,(const Ipp8u* pSrc, const Ipp8u* pLab, int labLen, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSADecrypt_OAEP_rmf( pSrc, pLab, labLen, pDst, pDstLen, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00309.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00309.c deleted file mode 100644 index c397fa50a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00309.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAEncrypt_PKCSv15,(const Ipp8u* pSrc, int srcLen, const Ipp8u* pRndPS, Ipp8u* pDst, const IppsRSAPublicKeyState* pKey, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAEncrypt_PKCSv15( pSrc, srcLen, pRndPS, pDst, pKey, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00310.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00310.c deleted file mode 100644 index 196e93060..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00310.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSADecrypt_PKCSv15,(const Ipp8u* pSrc, Ipp8u* pDst, int* pDstLen, const IppsRSAPrivateKeyState* pKey, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSADecrypt_PKCSv15( pSrc, pDst, pDstLen, pKey, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00311.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00311.c deleted file mode 100644 index 4824e1ce4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00311.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSASign_PSS( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00312.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00312.c deleted file mode 100644 index bcb69ceaa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00312.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PSS,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAVerify_PSS( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00313.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00313.c deleted file mode 100644 index 0e1e009cf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00313.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSalt, int saltLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSASign_PSS_rmf( pMsg, msgLen, pSalt, saltLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00314.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00314.c deleted file mode 100644 index e0df2c779..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00314.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PSS_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAVerify_PSS_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00315.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00315.c deleted file mode 100644 index ca38ff789..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00315.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSASign_PKCS1v15( pMsg, msgLen, pSign, pPrvKey, pPubKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00316.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00316.c deleted file mode 100644 index cad90c3a6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00316.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, IppHashAlgId hashAlg, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAVerify_PKCS1v15( pMsg, msgLen, pSign, pIsValid, pKey, hashAlg, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00317.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00317.c deleted file mode 100644 index d71e41533..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00317.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSASign_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, Ipp8u* pSign, const IppsRSAPrivateKeyState* pPrvKey, const IppsRSAPublicKeyState* pPubKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSASign_PKCS1v15_rmf( pMsg, msgLen, pSign, pPrvKey, pPubKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00318.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00318.c deleted file mode 100644 index 33405ba8e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00318.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsRSAVerify_PKCS1v15_rmf,(const Ipp8u* pMsg, int msgLen, const Ipp8u* pSign, int* pIsValid, const IppsRSAPublicKeyState* pKey, const IppsHashMethod* pMethod, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsRSAVerify_PKCS1v15_rmf( pMsg, msgLen, pSign, pIsValid, pKey, pMethod, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00319.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00319.c deleted file mode 100644 index da081db12..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00319.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const char*, y8_ippsDLGetResultString, (IppDLResult code)) -IPPAPI( const char*, l9_ippsDLGetResultString, (IppDLResult code)) -IPPAPI( const char*, k1_ippsDLGetResultString, (IppDLResult code)) - -IPPFUN( const char*,sgx_disp_ippsDLGetResultString, (IppDLResult code)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLGetResultString( code ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLGetResultString( code ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLGetResultString( code ); - } else - return NULL; -} -#else - - -IPPAPI( const char*, p8_ippsDLGetResultString, (IppDLResult code)) -IPPAPI( const char*, h9_ippsDLGetResultString, (IppDLResult code)) - -IPPFUN( const char*,sgx_disp_ippsDLGetResultString, (IppDLResult code)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLGetResultString( code ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLGetResultString( code ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00320.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00320.c deleted file mode 100644 index 8ba6b2592..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00320.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) -IPPAPI(IppStatus, l9_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) -IPPAPI(IppStatus, k1_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) -IPPAPI(IppStatus, h9_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGetSize,(int bitSizeP, int bitSizeR, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPGetSize( bitSizeP, bitSizeR, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00321.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00321.c deleted file mode 100644 index 5681c8643..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00321.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPInit, (int bitSizeP, int bitSizeR, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPInit( bitSizeP, bitSizeR, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00322.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00322.c deleted file mode 100644 index 29a849be9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00322.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, l9_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, k1_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPPack( pCtx, pBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPPack( pCtx, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPPack( pCtx, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) -IPPAPI(IppStatus, h9_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPPack,(const IppsDLPState* pCtx, Ipp8u* pBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPPack( pCtx, pBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPPack( pCtx, pBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00323.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00323.c deleted file mode 100644 index 8bb6a8c97..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00323.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPUnpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPUnpack,(const Ipp8u* pBuffer, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPUnpack( pBuffer, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPUnpack( pBuffer, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00324.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00324.c deleted file mode 100644 index 169c892b5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00324.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPSet( pP, pR, pG, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPSet( pP, pR, pG, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPSet( pP, pR, pG, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSet,(const IppsBigNumState* pP, const IppsBigNumState* pR, const IppsBigNumState* pG, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPSet( pP, pR, pG, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPSet( pP, pR, pG, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00325.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00325.c deleted file mode 100644 index b0da9c899..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00325.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPGet( pP, pR, pG, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPGet( pP, pR, pG, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPGet( pP, pR, pG, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGet,(IppsBigNumState* pP, IppsBigNumState* pR, IppsBigNumState* pG, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPGet( pP, pR, pG, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPGet( pP, pR, pG, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00326.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00326.c deleted file mode 100644 index 1b4b7a540..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00326.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPSetDP( pDP, tag, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPSetDP( pDP, tag, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPSetDP( pDP, tag, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSetDP,(const IppsBigNumState* pDP, IppDLPKeyTag tag, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPSetDP( pDP, tag, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPSetDP( pDP, tag, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00327.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00327.c deleted file mode 100644 index ce3b9d6b2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00327.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPGetDP( pDP, tag, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPGetDP( pDP, tag, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPGetDP( pDP, tag, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGetDP,(IppsBigNumState* pDP, IppDLPKeyTag tag, const IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPGetDP( pDP, tag, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPGetDP( pDP, tag, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00328.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00328.c deleted file mode 100644 index 05d22d3fc..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00328.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGenKeyPair,(IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPGenKeyPair( pPrvKey, pPubKey, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00329.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00329.c deleted file mode 100644 index c54b51830..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00329.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPPublicKey, (const IppsBigNumState* pPrvKey, IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPPublicKey( pPrvKey, pPubKey, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00330.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00330.c deleted file mode 100644 index bb0d4547c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00330.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPValidateKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppDLResult* pResult, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPValidateKeyPair( pPrvKey, pPubKey, pResult, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00331.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00331.c deleted file mode 100644 index 092906f6c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00331.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSetKeyPair,(const IppsBigNumState* pPrvKey, const IppsBigNumState* pPubKey, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPSetKeyPair( pPrvKey, pPubKey, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00332.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00332.c deleted file mode 100644 index d31b80875..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00332.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSignDSA, (const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrvKey, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPSignDSA( pMsgDigest, pPrvKey, pSignR, pSignS, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00333.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00333.c deleted file mode 100644 index 8df0f483d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00333.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppDLResult* pResult, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPVerifyDSA( pMsgDigest, pSignR, pSignS, pResult, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00334.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00334.c deleted file mode 100644 index fd2d42abf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00334.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) -IPPAPI(IppStatus, l9_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) -IPPAPI(IppStatus, k1_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) -IPPAPI(IppStatus, h9_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPSharedSecretDH,(const IppsBigNumState* pPrvKeyA, const IppsBigNumState* pPubKeyB, IppsBigNumState* pShare, IppsDLPState* pCtx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPSharedSecretDH( pPrvKeyA, pPubKeyB, pShare, pCtx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00335.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00335.c deleted file mode 100644 index f92ab6891..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00335.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGenerateDSA,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPGenerateDSA( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00336.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00336.c deleted file mode 100644 index c9914ac42..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00336.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPValidateDSA,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPValidateDSA( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00337.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00337.c deleted file mode 100644 index 800d7b9ca..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00337.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPGenerateDH,(const IppsBigNumState* pSeedIn, int nTrials, IppsDLPState* pCtx, IppsBigNumState* pSeedOut, int* pCounter, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPGenerateDH( pSeedIn, nTrials, pCtx, pSeedOut, pCounter, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00338.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00338.c deleted file mode 100644 index 3b58c4313..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00338.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsDLPValidateDH,(int nTrials, IppDLResult* pResult, IppsDLPState* pCtx, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsDLPValidateDH( nTrials, pResult, pCtx, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00339.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00339.c deleted file mode 100644 index 0c3fa4464..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00339.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const char*, y8_ippsECCGetResultString, (IppECResult code)) -IPPAPI( const char*, l9_ippsECCGetResultString, (IppECResult code)) -IPPAPI( const char*, k1_ippsECCGetResultString, (IppECResult code)) - -IPPFUN( const char*,sgx_disp_ippsECCGetResultString, (IppECResult code)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCGetResultString( code ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCGetResultString( code ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCGetResultString( code ); - } else - return NULL; -} -#else - - -IPPAPI( const char*, p8_ippsECCGetResultString, (IppECResult code)) -IPPAPI( const char*, h9_ippsECCGetResultString, (IppECResult code)) - -IPPFUN( const char*,sgx_disp_ippsECCGetResultString, (IppECResult code)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCGetResultString( code ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCGetResultString( code ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00340.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00340.c deleted file mode 100644 index 4fb028285..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00340.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSize,(int feBitSize, int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSize,(int feBitSize, int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSize,(int feBitSize, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSize,(int feBitSize, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSize( feBitSize, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSize( feBitSize, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSize( feBitSize, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSize,(int feBitSize, int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSize,(int feBitSize, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSize,(int feBitSize, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSize( feBitSize, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSize( feBitSize, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00341.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00341.c deleted file mode 100644 index 727a0c104..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00341.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd128r1,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd128r1,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd128r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd128r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd128r1( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd128r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd128r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd128r1,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd128r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd128r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd128r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd128r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00342.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00342.c deleted file mode 100644 index 49eecd6b5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00342.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd128r2,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd128r2,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd128r2,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd128r2,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd128r2( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd128r2( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd128r2( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd128r2,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd128r2,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd128r2,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd128r2( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd128r2( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00343.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00343.c deleted file mode 100644 index 84df48b7f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00343.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd192r1,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd192r1,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd192r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd192r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd192r1( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd192r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd192r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd192r1,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd192r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd192r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd192r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd192r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00344.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00344.c deleted file mode 100644 index 0190ceb38..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00344.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd224r1,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd224r1,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd224r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd224r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd224r1( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd224r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd224r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd224r1,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd224r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd224r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd224r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd224r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00345.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00345.c deleted file mode 100644 index 3a2a1dd4d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00345.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd256r1,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd256r1,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd256r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd256r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd256r1( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd256r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd256r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd256r1,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd256r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd256r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd256r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd256r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00346.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00346.c deleted file mode 100644 index 6517501f8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00346.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd384r1,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd384r1,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd384r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd384r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd384r1( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd384r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd384r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd384r1,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd384r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd384r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd384r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd384r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00347.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00347.c deleted file mode 100644 index 9898b1764..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00347.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStd521r1,(int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStd521r1,(int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStd521r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd521r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStd521r1( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStd521r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStd521r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStd521r1,(int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStd521r1,(int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStd521r1,(int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStd521r1( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStd521r1( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00348.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00348.c deleted file mode 100644 index a296affa1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00348.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetSizeStdSM2, (int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPGetSizeStdSM2, (int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPGetSizeStdSM2, (int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStdSM2, (int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetSizeStdSM2( pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetSizeStdSM2( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetSizeStdSM2( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetSizeStdSM2, (int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPGetSizeStdSM2, (int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetSizeStdSM2, (int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetSizeStdSM2( pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetSizeStdSM2( pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00349.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00349.c deleted file mode 100644 index 548bdde79..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00349.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInit( feBitSize, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInit( feBitSize, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInit( feBitSize, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInit,(int feBitSize, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInit( feBitSize, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInit( feBitSize, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00350.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00350.c deleted file mode 100644 index 7cb83651b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00350.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd128r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd128r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd128r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd128r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd128r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd128r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd128r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd128r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd128r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd128r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd128r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd128r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00351.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00351.c deleted file mode 100644 index 22ce5dc9c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00351.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd128r2,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd128r2,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd128r2,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd128r2,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd128r2( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd128r2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd128r2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd128r2,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd128r2,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd128r2,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd128r2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd128r2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00352.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00352.c deleted file mode 100644 index a5f36efab..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00352.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd192r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd192r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd192r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd192r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd192r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00353.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00353.c deleted file mode 100644 index ed9bbfb32..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00353.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd224r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd224r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd224r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd224r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd224r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00354.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00354.c deleted file mode 100644 index b1fc30857..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00354.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd256r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd256r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd256r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd256r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd256r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00355.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00355.c deleted file mode 100644 index 98838c17e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00355.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd384r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd384r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd384r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd384r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd384r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00356.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00356.c deleted file mode 100644 index de0ed78ab..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00356.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStd521r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd521r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStd521r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStd521r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStd521r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00357.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00357.c deleted file mode 100644 index 56d7d5452..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00357.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPInitStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPInitStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPInitStdSM2, (IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStdSM2, (IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPInitStdSM2( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPInitStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPInitStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPInitStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPInitStdSM2, (IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPInitStdSM2, (IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPInitStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPInitStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00358.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00358.c deleted file mode 100644 index 7bd05a531..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00358.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSet,(const IppsBigNumState* pPrime, const IppsBigNumState* pA, const IppsBigNumState* pB, const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder, int cofactor, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00359.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00359.c deleted file mode 100644 index 8df6e279c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00359.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd( flag, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd( flag, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd( flag, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd,(IppECCType flag, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd( flag, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd( flag, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00360.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00360.c deleted file mode 100644 index 1fe36fe41..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00360.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd128r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd128r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd128r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd128r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd128r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd128r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd128r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd128r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd128r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd128r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd128r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd128r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00361.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00361.c deleted file mode 100644 index 30337bc3d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00361.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd128r2,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd128r2,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd128r2,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd128r2,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd128r2( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd128r2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd128r2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd128r2,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd128r2,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd128r2,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd128r2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd128r2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00362.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00362.c deleted file mode 100644 index 012d8479f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00362.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd192r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd192r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd192r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd192r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd192r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00363.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00363.c deleted file mode 100644 index a218a820a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00363.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd224r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd224r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd224r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd224r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd224r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00364.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00364.c deleted file mode 100644 index d52c657c8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00364.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd256r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd256r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd256r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd256r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd256r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00365.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00365.c deleted file mode 100644 index ab650c853..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00365.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd384r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd384r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd384r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd384r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd384r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00366.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00366.c deleted file mode 100644 index 27336eb20..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00366.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStd521r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd521r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStd521r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStd521r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStd521r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00367.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00367.c deleted file mode 100644 index 0a55b7714..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00367.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetStdSM2, (IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStdSM2, (IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetStdSM2( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetStdSM2, (IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetStdSM2, (IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00368.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00368.c deleted file mode 100644 index 9eed10d44..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00368.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPBindGxyTblStd192r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPBindGxyTblStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPBindGxyTblStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd192r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPBindGxyTblStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPBindGxyTblStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00369.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00369.c deleted file mode 100644 index 59a348ee2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00369.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPBindGxyTblStd224r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPBindGxyTblStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPBindGxyTblStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd224r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPBindGxyTblStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPBindGxyTblStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00370.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00370.c deleted file mode 100644 index fc37553ac..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00370.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPBindGxyTblStd256r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPBindGxyTblStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPBindGxyTblStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd256r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPBindGxyTblStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPBindGxyTblStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00371.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00371.c deleted file mode 100644 index 0dd7d0ff4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00371.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPBindGxyTblStd384r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPBindGxyTblStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPBindGxyTblStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd384r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPBindGxyTblStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPBindGxyTblStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00372.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00372.c deleted file mode 100644 index bfbf0c7ad..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00372.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPBindGxyTblStd521r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPBindGxyTblStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPBindGxyTblStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStd521r1,(IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPBindGxyTblStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPBindGxyTblStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00373.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00373.c deleted file mode 100644 index 19afabf8a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00373.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPBindGxyTblStdSM2( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPBindGxyTblStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPBindGxyTblStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPBindGxyTblStdSM2, (IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPBindGxyTblStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPBindGxyTblStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00374.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00374.c deleted file mode 100644 index 257b83fc4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00374.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGet,(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGet( pPrime, pA, pB, pGX, pGY, pOrder, cofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00375.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00375.c deleted file mode 100644 index 935e46cdb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00375.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetOrderBitSize( pBitSize, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetOrderBitSize( pBitSize, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetOrderBitSize( pBitSize, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetOrderBitSize,(int* pBitSize, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetOrderBitSize( pBitSize, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetOrderBitSize( pBitSize, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00376.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00376.c deleted file mode 100644 index bd5701f73..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00376.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPValidate,(int nTrials, IppECResult* pResult, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPValidate( nTrials, pResult, pEC, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00377.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00377.c deleted file mode 100644 index f98591adb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00377.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPPointGetSize,(int feBitSize, int* pSize)) -IPPAPI(IppStatus, l9_ippsECCPPointGetSize,(int feBitSize, int* pSize)) -IPPAPI(IppStatus, k1_ippsECCPPointGetSize,(int feBitSize, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPPointGetSize,(int feBitSize, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPPointGetSize( feBitSize, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPPointGetSize( feBitSize, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPPointGetSize( feBitSize, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPPointGetSize,(int feBitSize, int* pSize)) -IPPAPI(IppStatus, h9_ippsECCPPointGetSize,(int feBitSize, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPPointGetSize,(int feBitSize, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPPointGetSize( feBitSize, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPPointGetSize( feBitSize, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00378.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00378.c deleted file mode 100644 index 32c907176..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00378.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) -IPPAPI(IppStatus, l9_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) -IPPAPI(IppStatus, k1_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPPointInit( feBitSize, pPoint ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPPointInit( feBitSize, pPoint ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPPointInit( feBitSize, pPoint ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) -IPPAPI(IppStatus, h9_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPPointInit( feBitSize, pPoint ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPPointInit( feBitSize, pPoint ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00379.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00379.c deleted file mode 100644 index 227530c96..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00379.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetPoint( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsECCPPointState* pPoint, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetPoint( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00380.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00380.c deleted file mode 100644 index 3e19a5083..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00380.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetPointAtInfinity( pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetPointAtInfinity( pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetPointAtInfinity( pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetPointAtInfinity( pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetPointAtInfinity( pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00381.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00381.c deleted file mode 100644 index a871f361a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00381.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGetPoint( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY, const IppsECCPPointState* pPoint, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGetPoint( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00382.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00382.c deleted file mode 100644 index 648ba3c4a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00382.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPCheckPoint( pP, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPCheckPoint( pP, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPCheckPoint( pP, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPCheckPoint,(const IppsECCPPointState* pP, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPCheckPoint( pP, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPCheckPoint( pP, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00383.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00383.c deleted file mode 100644 index d6b63c4b7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00383.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPComparePoint( pP, pQ, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPComparePoint( pP, pQ, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPComparePoint( pP, pQ, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPComparePoint( pP, pQ, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPComparePoint( pP, pQ, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00384.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00384.c deleted file mode 100644 index 25cb0c1a4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00384.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPNegativePoint( pP, pR, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPNegativePoint( pP, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPNegativePoint( pP, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPNegativePoint,(const IppsECCPPointState* pP, IppsECCPPointState* pR, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPNegativePoint( pP, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPNegativePoint( pP, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00385.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00385.c deleted file mode 100644 index 88bac81ed..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00385.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPAddPoint( pP, pQ, pR, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPAddPoint( pP, pQ, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPAddPoint( pP, pQ, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ, IppsECCPPointState* pR, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPAddPoint( pP, pQ, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPAddPoint( pP, pQ, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00386.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00386.c deleted file mode 100644 index 3f35060d0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00386.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPMulPointScalar( pP, pK, pR, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPMulPointScalar( pP, pK, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPMulPointScalar( pP, pK, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK, IppsECCPPointState* pR, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPMulPointScalar( pP, pK, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPMulPointScalar( pP, pK, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00387.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00387.c deleted file mode 100644 index e5ee2a631..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00387.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPGenKeyPair( pPrivate, pPublic, pEC, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00388.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00388.c deleted file mode 100644 index d7c98ff3f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00388.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPPublicKey( pPrivate, pPublic, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPPublicKey( pPrivate, pPublic, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPPublicKey( pPrivate, pPublic, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPPublicKey,(const IppsBigNumState* pPrivate, IppsECCPPointState* pPublic, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPPublicKey( pPrivate, pPublic, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPPublicKey( pPrivate, pPublic, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00389.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00389.c deleted file mode 100644 index 25d963a95..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00389.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPValidateKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPValidateKeyPair( pPrivate, pPublic, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00390.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00390.c deleted file mode 100644 index abed86072..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00390.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic, IppBool regular, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSetKeyPair( pPrivate, pPublic, regular, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00391.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00391.c deleted file mode 100644 index 67f79b632..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00391.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSharedSecretDH( pPrivateA, pPublicB, pShare, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00392.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00392.c deleted file mode 100644 index a449e0e17..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00392.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsECCPPointState* pPublicB, IppsBigNumState* pShare, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00393.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00393.c deleted file mode 100644 index 6d535ba46..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00393.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSignDSA( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00394.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00394.c deleted file mode 100644 index ad62521fb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00394.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPVerifyDSA( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00395.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00395.c deleted file mode 100644 index 22d49da7c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00395.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pPrivate, IppsBigNumState* pSignX, IppsBigNumState* pSignY, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSignNR( pMsgDigest, pPrivate, pSignX, pSignY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00396.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00396.c deleted file mode 100644 index d3ac7f44d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00396.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pSignX, const IppsBigNumState* pSignY, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPVerifyNR( pMsgDigest, pSignX, pSignY, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00397.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00397.c deleted file mode 100644 index e3359b307..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00397.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00398.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00398.c deleted file mode 100644 index 456054c4c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00398.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, l9_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, k1_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) -IPPAPI(IppStatus, h9_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsECCPVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsECCPPointState* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsECCPState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsECCPVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00399.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00399.c deleted file mode 100644 index c06b06223..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00399.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpGetSize, (int feBitSize, int* pSize)) -IPPAPI(IppStatus, l9_ippsGFpGetSize, (int feBitSize, int* pSize)) -IPPAPI(IppStatus, k1_ippsGFpGetSize, (int feBitSize, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetSize, (int feBitSize, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpGetSize( feBitSize, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpGetSize( feBitSize, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpGetSize( feBitSize, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpGetSize, (int feBitSize, int* pSize)) -IPPAPI(IppStatus, h9_ippsGFpGetSize, (int feBitSize, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetSize, (int feBitSize, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpGetSize( feBitSize, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpGetSize( feBitSize, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00400.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00400.c deleted file mode 100644 index 1a6e33a3f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00400.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInitArbitrary,(const IppsBigNumState* pPrime, int primeBitSize, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpInitArbitrary( pPrime, primeBitSize, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00401.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00401.c deleted file mode 100644 index 1a775bc54..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00401.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInitFixed,(int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpInitFixed( primeBitSize, pGFpMethod, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00402.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00402.c deleted file mode 100644 index 129e0292a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00402.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInit, (const IppsBigNumState* pPrime, int primeBitSize, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpInit( pPrime, primeBitSize, pGFpMethod, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00403.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00403.c deleted file mode 100644 index 93b0a8d1d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00403.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p192r1, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p192r1, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p192r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p192r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p192r1( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p192r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p192r1( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p192r1, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p192r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p192r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p192r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p192r1( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00404.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00404.c deleted file mode 100644 index 97ecfc9aa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00404.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p224r1, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p224r1, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p224r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p224r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p224r1( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p224r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p224r1( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p224r1, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p224r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p224r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p224r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p224r1( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00405.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00405.c deleted file mode 100644 index dbb53b434..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00405.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256r1, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256r1, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p256r1( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p256r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p256r1( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p256r1, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p256r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p256r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p256r1( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00406.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00406.c deleted file mode 100644 index 3171bfe48..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00406.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p384r1, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p384r1, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p384r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p384r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p384r1( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p384r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p384r1( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p384r1, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p384r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p384r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p384r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p384r1( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00407.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00407.c deleted file mode 100644 index 4faccbf07..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00407.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p521r1, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p521r1, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p521r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p521r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p521r1( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p521r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p521r1( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p521r1, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p521r1, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p521r1, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p521r1( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p521r1( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00408.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00408.c deleted file mode 100644 index fa4567e31..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00408.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256sm2,(void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256sm2,(void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256sm2,(void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256sm2,(void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p256sm2( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p256sm2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p256sm2( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p256sm2,(void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p256sm2,(void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256sm2,(void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p256sm2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p256sm2( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00409.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00409.c deleted file mode 100644 index 259e5ed06..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00409.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256bn, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256bn, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256bn, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256bn, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p256bn( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p256bn( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p256bn( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p256bn, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p256bn, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256bn, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p256bn( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p256bn( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00410.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00410.c deleted file mode 100644 index 5ce757540..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00410.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_p256, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_p256, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_p256, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_p256( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_p256( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_p256( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_p256, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_p256, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_p256, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_p256( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_p256( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00411.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00411.c deleted file mode 100644 index 0ef1a1b6c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00411.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpMethod_pArb, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpMethod_pArb, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpMethod_pArb, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_pArb, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMethod_pArb( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMethod_pArb( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMethod_pArb( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpMethod_pArb, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpMethod_pArb, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpMethod_pArb, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMethod_pArb( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMethod_pArb( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00412.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00412.c deleted file mode 100644 index e3f53292f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00412.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) -IPPAPI(IppStatus, l9_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) -IPPAPI(IppStatus, k1_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxGetSize( pGroundGF, degree, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxGetSize( pGroundGF, degree, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxGetSize( pGroundGF, degree, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) -IPPAPI(IppStatus, h9_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxGetSize( pGroundGF, degree, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxGetSize( pGroundGF, degree, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00413.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00413.c deleted file mode 100644 index 08315ec24..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00413.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -IPPAPI(IppStatus, l9_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -IPPAPI(IppStatus, k1_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -IPPAPI(IppStatus, h9_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpxInit, (const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* const ppGroundElm[], int nElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxInit( pGroundGF, extDeg, ppGroundElm, nElm, pGFpMethod, pGFpx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00414.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00414.c deleted file mode 100644 index cc5b4ec4a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00414.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -IPPAPI(IppStatus, l9_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -IPPAPI(IppStatus, k1_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -IPPAPI(IppStatus, h9_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, int extDeg, const IppsGFpElement* pGroundElm, const IppsGFpMethod* pGFpMethod, IppsGFpState* pGFpx)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxInitBinomial( pGroundGF, extDeg, pGroundElm, pGFpMethod, pGFpx ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00415.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00415.c deleted file mode 100644 index 96cb69028..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00415.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom2_epid2,(void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom2_epid2,(void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom2_epid2,(void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom2_epid2,(void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxMethod_binom2_epid2( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxMethod_binom2_epid2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxMethod_binom2_epid2( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_binom2_epid2,(void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_binom2_epid2,(void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom2_epid2,(void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxMethod_binom2_epid2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxMethod_binom2_epid2( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00416.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00416.c deleted file mode 100644 index c4782e75a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00416.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom3_epid2,(void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom3_epid2,(void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom3_epid2,(void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom3_epid2,(void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxMethod_binom3_epid2( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxMethod_binom3_epid2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxMethod_binom3_epid2( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_binom3_epid2,(void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_binom3_epid2,(void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom3_epid2,(void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxMethod_binom3_epid2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxMethod_binom3_epid2( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00417.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00417.c deleted file mode 100644 index d1bba7724..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00417.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom2, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom2, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom2, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom2, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxMethod_binom2( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxMethod_binom2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxMethod_binom2( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_binom2, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_binom2, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom2, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxMethod_binom2( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxMethod_binom2( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00418.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00418.c deleted file mode 100644 index 3ce759c8e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00418.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom3, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom3, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom3, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom3, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxMethod_binom3( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxMethod_binom3( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxMethod_binom3( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_binom3, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_binom3, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom3, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxMethod_binom3( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxMethod_binom3( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00419.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00419.c deleted file mode 100644 index d5ea80e1d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00419.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_binom, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_binom, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_binom, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxMethod_binom( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxMethod_binom( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxMethod_binom( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_binom, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_binom, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_binom, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxMethod_binom( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxMethod_binom( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00420.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00420.c deleted file mode 100644 index a450768b6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00420.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI( const IppsGFpMethod*, y8_ippsGFpxMethod_com, (void) ) -IPPAPI( const IppsGFpMethod*, l9_ippsGFpxMethod_com, (void) ) -IPPAPI( const IppsGFpMethod*, k1_ippsGFpxMethod_com, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_com, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpxMethod_com( ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpxMethod_com( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpxMethod_com( ); - } else - return NULL; -} -#else - - -IPPAPI( const IppsGFpMethod*, p8_ippsGFpxMethod_com, (void) ) -IPPAPI( const IppsGFpMethod*, h9_ippsGFpxMethod_com, (void) ) - -IPPFUN( const IppsGFpMethod*,sgx_disp_ippsGFpxMethod_com, (void) ) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpxMethod_com( ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpxMethod_com( ); - } else - return NULL; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00421.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00421.c deleted file mode 100644 index f399a3a55..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00421.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) -IPPAPI(IppStatus, l9_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) -IPPAPI(IppStatus, k1_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) -IPPAPI(IppStatus, h9_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGFp, int* pBufferSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpScratchBufferSize( nExponents, ExpBitSize, pGFp, pBufferSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00422.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00422.c deleted file mode 100644 index ab9e50d17..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00422.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) -IPPAPI(IppStatus, l9_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) -IPPAPI(IppStatus, k1_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpElementGetSize( pGFp, pElementSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpElementGetSize( pGFp, pElementSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpElementGetSize( pGFp, pElementSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) -IPPAPI(IppStatus, h9_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpElementGetSize( pGFp, pElementSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpElementGetSize( pGFp, pElementSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00423.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00423.c deleted file mode 100644 index ff948a1e4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00423.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpElementInit( pA, lenA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpElementInit( pA, lenA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpElementInit( pA, lenA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpElementInit( pA, lenA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpElementInit( pA, lenA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00424.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00424.c deleted file mode 100644 index 2964fafe4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00424.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSetElement( pA, lenA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSetElement( pA, lenA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSetElement( pA, lenA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElement, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSetElement( pA, lenA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSetElement( pA, lenA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00425.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00425.c deleted file mode 100644 index 1deff464f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00425.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSetElementRegular( pBN, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSetElementRegular( pBN, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSetElementRegular( pBN, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementRegular,(const IppsBigNumState* pBN, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSetElementRegular( pBN, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSetElementRegular( pBN, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00426.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00426.c deleted file mode 100644 index 58b75786b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00426.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSetElementOctString( pStr, strSize, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00427.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00427.c deleted file mode 100644 index ab24f3abe..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00427.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementRandom,(IppsGFpElement* pR, IppsGFpState* pGFp, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSetElementRandom( pR, pGFp, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00428.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00428.c deleted file mode 100644 index e6ee8a16f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00428.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) -IPPAPI(IppStatus, l9_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) -IPPAPI(IppStatus, k1_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) -IPPAPI(IppStatus, h9_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, IppHashAlgId hashID)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSetElementHash( pMsg, msgLen, pElm, pGFp, hashID ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00429.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00429.c deleted file mode 100644 index b35f07435..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00429.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, l9_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, k1_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) -IPPAPI(IppStatus, h9_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSetElementHash_rmf,(const Ipp8u* pMsg, int msgLen, IppsGFpElement* pElm, IppsGFpState* pGFp, const IppsHashMethod* pMethod)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSetElementHash_rmf( pMsg, msgLen, pElm, pGFp, pMethod ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00430.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00430.c deleted file mode 100644 index eded3fb53..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00430.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpCpyElement( pA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpCpyElement( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpCpyElement( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpCpyElement( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpCpyElement( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00431.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00431.c deleted file mode 100644 index 78cbf94c8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00431.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int lenA, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpGetElement( pA, pDataA, lenA, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00432.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00432.c deleted file mode 100644 index 9f2b1a17d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00432.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpGetElementOctString( pA, pStr, strSize, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00433.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00433.c deleted file mode 100644 index 00a6c7e40..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00433.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpCmpElement( pA, pB, pResult, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpCmpElement( pA, pB, pResult, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpCmpElement( pA, pB, pResult, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpCmpElement( pA, pB, pResult, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpCmpElement( pA, pB, pResult, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00434.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00434.c deleted file mode 100644 index b242896af..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00434.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpIsZeroElement( pA, pResult, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpIsZeroElement( pA, pResult, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpIsZeroElement( pA, pResult, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpIsZeroElement( pA, pResult, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpIsZeroElement( pA, pResult, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00435.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00435.c deleted file mode 100644 index 6c83019b9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00435.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpIsUnityElement( pA, pResult, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpIsUnityElement( pA, pResult, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpIsUnityElement( pA, pResult, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpIsUnityElement( pA, pResult, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpIsUnityElement( pA, pResult, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00436.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00436.c deleted file mode 100644 index af340af93..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00436.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpConj( pA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpConj( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpConj( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpConj( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpConj( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00437.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00437.c deleted file mode 100644 index fb75555b0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00437.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpNeg( pA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpNeg( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpNeg( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpNeg( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpNeg( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00438.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00438.c deleted file mode 100644 index e94d60521..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00438.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpInv( pA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpInv( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpInv( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpInv( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpInv( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00439.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00439.c deleted file mode 100644 index 812dfecdb..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00439.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSqrt( pA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSqrt( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSqrt( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSqrt( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSqrt( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00440.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00440.c deleted file mode 100644 index 1c596b1b4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00440.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSqr( pA, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSqr( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSqr( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSqr( pA, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSqr( pA, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00441.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00441.c deleted file mode 100644 index 76a8a76d3..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00441.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpAdd( pA, pB, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpAdd( pA, pB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpAdd( pA, pB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpAdd( pA, pB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpAdd( pA, pB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00442.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00442.c deleted file mode 100644 index 95eb94c35..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00442.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSub( pA, pB, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSub( pA, pB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSub( pA, pB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSub( pA, pB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSub( pA, pB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00443.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00443.c deleted file mode 100644 index 809d22557..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00443.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMul( pA, pB, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMul( pA, pB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMul( pA, pB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMul( pA, pB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMul( pA, pB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00444.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00444.c deleted file mode 100644 index 17c412837..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00444.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpExp( pA, pE, pR, pGFp, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00445.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00445.c deleted file mode 100644 index c57c0964b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00445.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMultiExp( ppElmA, ppE, nItems, pR, pGFp, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00446.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00446.c deleted file mode 100644 index 62df5a1c4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00446.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpAdd_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpAdd_PE( pA, pParentB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00447.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00447.c deleted file mode 100644 index 4d53d862f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00447.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpSub_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpSub_PE( pA, pParentB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00448.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00448.c deleted file mode 100644 index 09023668c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00448.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpMul_PE,(const IppsGFpElement* pA, const IppsGFpElement* pParentB, IppsGFpElement* pR, IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpMul_PE( pA, pParentB, pR, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00449.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00449.c deleted file mode 100644 index 559e7855b..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00449.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, l9_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, k1_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpGetInfo( pInfo, pGFp ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpGetInfo( pInfo, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpGetInfo( pInfo, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) -IPPAPI(IppStatus, h9_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpGetInfo, (IppsGFpInfo* pInfo, const IppsGFpState* pGFp)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpGetInfo( pInfo, pGFp ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpGetInfo( pInfo, pGFp ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00450.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00450.c deleted file mode 100644 index 9852c43f4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00450.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) -IPPAPI(IppStatus, l9_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) -IPPAPI(IppStatus, k1_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGetSize( pGFp, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGetSize( pGFp, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGetSize( pGFp, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) -IPPAPI(IppStatus, h9_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetSize,(const IppsGFpState* pGFp, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGetSize( pGFp, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGetSize( pGFp, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00451.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00451.c deleted file mode 100644 index 003465970..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00451.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInit( pGFp, pA, pB, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInit( pGFp, pA, pB, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInit( pGFp, pA, pB, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInit, (const IppsGFpState* pGFp, const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInit( pGFp, pA, pB, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInit( pGFp, pA, pB, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00452.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00452.c deleted file mode 100644 index 3be6b5a14..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00452.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSet( pA, pB, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSet( pA, pB, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSet( pA, pB, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSet( pA, pB, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSet( pA, pB, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00453.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00453.c deleted file mode 100644 index 770cac9b9..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00453.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetSubgroup,(const IppsGFpElement* pX, const IppsGFpElement* pY, const IppsBigNumState* pOrder, const IppsBigNumState* pCofactor, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetSubgroup( pX, pY, pOrder, pCofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00454.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00454.c deleted file mode 100644 index 7cf228e3f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00454.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd128r1( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd128r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd128r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd128r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd128r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd128r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00455.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00455.c deleted file mode 100644 index dbac72f62..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00455.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd128r2( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd128r2( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd128r2( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd128r2,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd128r2( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd128r2( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00456.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00456.c deleted file mode 100644 index 0c2c01d70..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00456.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd192r1( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd192r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd192r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd192r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd192r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd192r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00457.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00457.c deleted file mode 100644 index e08a9a2f3..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00457.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd224r1( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd224r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd224r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd224r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd224r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd224r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00458.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00458.c deleted file mode 100644 index 9ba571045..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00458.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd256r1( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd256r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd256r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd256r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd256r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd256r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00459.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00459.c deleted file mode 100644 index ad0f2f89f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00459.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd384r1( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd384r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd384r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd384r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd384r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd384r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00460.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00460.c deleted file mode 100644 index 98da42912..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00460.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStd521r1( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStd521r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStd521r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStd521r1,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStd521r1( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStd521r1( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00461.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00461.c deleted file mode 100644 index 0bf42c534..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00461.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStdSM2( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStdSM2( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStdSM2( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStdSM2, (const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStdSM2( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStdSM2( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00462.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00462.c deleted file mode 100644 index 0960b220e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00462.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECInitStdBN256( pGFp, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECInitStdBN256( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECInitStdBN256( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECInitStdBN256,(const IppsGFpState* pGFp, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECInitStdBN256( pGFp, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECInitStdBN256( pGFp, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00463.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00463.c deleted file mode 100644 index 622dfb6ca..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00463.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECBindGxyTblStd192r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECBindGxyTblStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECBindGxyTblStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd192r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECBindGxyTblStd192r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECBindGxyTblStd192r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00464.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00464.c deleted file mode 100644 index 73a08ad9e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00464.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECBindGxyTblStd224r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECBindGxyTblStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECBindGxyTblStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd224r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECBindGxyTblStd224r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECBindGxyTblStd224r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00465.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00465.c deleted file mode 100644 index 69f0d30c7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00465.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECBindGxyTblStd256r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECBindGxyTblStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECBindGxyTblStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd256r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECBindGxyTblStd256r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECBindGxyTblStd256r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00466.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00466.c deleted file mode 100644 index ee3f98c8f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00466.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECBindGxyTblStd384r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECBindGxyTblStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECBindGxyTblStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd384r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECBindGxyTblStd384r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECBindGxyTblStd384r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00467.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00467.c deleted file mode 100644 index 9a4cf9089..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00467.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECBindGxyTblStd521r1( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECBindGxyTblStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECBindGxyTblStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStd521r1,(IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECBindGxyTblStd521r1( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECBindGxyTblStd521r1( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00468.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00468.c deleted file mode 100644 index adeb6404f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00468.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECBindGxyTblStdSM2( pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECBindGxyTblStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECBindGxyTblStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECBindGxyTblStdSM2, (IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECBindGxyTblStdSM2( pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECBindGxyTblStdSM2( pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00469.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00469.c deleted file mode 100644 index e506a1d47..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00469.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGet( ppGFp, pA, pB, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGet( ppGFp, pA, pB, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGet( ppGFp, pA, pB, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGet,(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGet( ppGFp, pA, pB, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGet( ppGFp, pA, pB, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00470.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00470.c deleted file mode 100644 index 595895ea8..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00470.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetSubgroup,(IppsGFpState** const ppGFp, IppsGFpElement* pX, IppsGFpElement* pY, IppsBigNumState* pOrder,IppsBigNumState* pCofactor, const IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGetSubgroup( ppGFp, pX, pY, pOrder, pCofactor, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00471.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00471.c deleted file mode 100644 index af64a48f5..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00471.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) -IPPAPI(IppStatus, l9_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) -IPPAPI(IppStatus, k1_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) -IPPAPI(IppStatus, h9_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECScratchBufferSize( nScalars, pEC, pBufferSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00472.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00472.c deleted file mode 100644 index c441f18bf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00472.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECVerify( pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00473.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00473.c deleted file mode 100644 index 56e5c0eba..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00473.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) -IPPAPI(IppStatus, l9_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) -IPPAPI(IppStatus, k1_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECPointGetSize( pEC, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECPointGetSize( pEC, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECPointGetSize( pEC, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) -IPPAPI(IppStatus, h9_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECPointGetSize( pEC, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECPointGetSize( pEC, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00474.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00474.c deleted file mode 100644 index 53d7b0f53..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00474.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECPointInit( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECPointInit( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECPointInit( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECPointInit( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECPointInit( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00475.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00475.c deleted file mode 100644 index 4f46f4926..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00475.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointAtInfinity( pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointAtInfinity( pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointAtInfinity( pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointAtInfinity( pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointAtInfinity( pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00476.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00476.c deleted file mode 100644 index 5afda40bc..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00476.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPoint( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00477.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00477.c deleted file mode 100644 index 7d55b17f7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00477.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointRegular,(const IppsBigNumState* pX, const IppsBigNumState* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointRegular( pX, pY, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00478.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00478.c deleted file mode 100644 index 6bcdb99bf..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00478.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointRandom,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointRandom( pPoint, pEC, rndFunc, pRndParam, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00479.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00479.c deleted file mode 100644 index 89ead03d7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00479.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECMakePoint( pX, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECMakePoint( pX, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECMakePoint( pX, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECMakePoint( pX, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECMakePoint( pX, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00480.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00480.c deleted file mode 100644 index 97e6a93c6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00480.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointHash( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00481.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00481.c deleted file mode 100644 index 8041e2564..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00481.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHashBackCompatible,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, IppHashAlgId hashID, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointHashBackCompatible( hdr, pMsg, msgLen, pPoint, pEC, hashID, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00482.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00482.c deleted file mode 100644 index 596f91203..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00482.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHash_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointHash_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00483.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00483.c deleted file mode 100644 index ea1c754e4..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00483.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointHashBackCompatible_rmf,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, const IppsHashMethod* pMethod, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointHashBackCompatible_rmf( hdr, pMsg, msgLen, pPoint, pEC, pMethod, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00484.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00484.c deleted file mode 100644 index 5e8ce3cee..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00484.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGetPoint( pPoint, pX, pY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00485.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00485.c deleted file mode 100644 index fe88faea6..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00485.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetPointRegular,(const IppsGFpECPoint* pPoint, IppsBigNumState* pX, IppsBigNumState* pY, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGetPointRegular( pPoint, pX, pY, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00486.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00486.c deleted file mode 100644 index 264f5f537..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00486.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSetPointOctString,(const Ipp8u* pStr, int strLen, IppsGFpECPoint* pPoint, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSetPointOctString( pStr, strLen, pPoint, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00487.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00487.c deleted file mode 100644 index 9c4b010aa..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00487.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetPointOctString,(const IppsGFpECPoint* pPoint, Ipp8u* pStr, int strLen, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGetPointOctString( pPoint, pStr, strLen, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00488.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00488.c deleted file mode 100644 index 524a4f02e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00488.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECTstPoint( pP, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECTstPoint( pP, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECTstPoint( pP, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECTstPoint( pP, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECTstPoint( pP, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00489.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00489.c deleted file mode 100644 index 95dd530de..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00489.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECTstPointInSubgroup,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECTstPointInSubgroup( pP, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00490.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00490.c deleted file mode 100644 index 8def8247d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00490.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECCpyPoint( pA, pR, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECCpyPoint( pA, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECCpyPoint( pA, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECCpyPoint( pA, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECCpyPoint( pA, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00491.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00491.c deleted file mode 100644 index 13da6cb02..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00491.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECCmpPoint( pP, pQ, pResult, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00492.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00492.c deleted file mode 100644 index dcd972e53..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00492.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECNegPoint( pP, pR, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECNegPoint( pP, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECNegPoint( pP, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECNegPoint( pP, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECNegPoint( pP, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00493.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00493.c deleted file mode 100644 index 570c5113e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00493.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECAddPoint( pP, pQ, pR, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECAddPoint( pP, pQ, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECAddPoint( pP, pQ, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECAddPoint( pP, pQ, pR, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECAddPoint( pP, pQ, pR, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00494.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00494.c deleted file mode 100644 index aaf601c8f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00494.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECMulPoint( pP, pN, pR, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00495.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00495.c deleted file mode 100644 index e94f9c75a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00495.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, l9_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, k1_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -IPPAPI(IppStatus, h9_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPrivateKey,(IppsBigNumState* pPrivate, IppsGFpECState* pEC, IppBitSupplier rndFunc, void* pRndParam)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECPrivateKey( pPrivate, pEC, rndFunc, pRndParam ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00496.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00496.c deleted file mode 100644 index 92a59fc24..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00496.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECPublicKey,(const IppsBigNumState* pPrivate, IppsGFpECPoint* pPublic, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECPublicKey( pPrivate, pPublic, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00497.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00497.c deleted file mode 100644 index 8b671aa1e..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00497.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECTstKeyPair,(const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECTstKeyPair( pPrivate, pPublic, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00498.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00498.c deleted file mode 100644 index f1f184c2d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00498.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSharedSecretDH,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSharedSecretDH( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00499.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00499.c deleted file mode 100644 index e33ee2597..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00499.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSharedSecretDHC,(const IppsBigNumState* pPrivateA, const IppsGFpECPoint* pPublicB, IppsBigNumState* pShare, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSharedSecretDHC( pPrivateA, pPublicB, pShare, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00500.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00500.c deleted file mode 100644 index 55c44f562..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00500.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSignDSA,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSignDSA( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00501.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00501.c deleted file mode 100644 index 04deb9d3a..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00501.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerifyDSA,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECVerifyDSA( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00502.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00502.c deleted file mode 100644 index 4e2d6bfa0..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00502.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSignNR,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSignNR( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00503.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00503.c deleted file mode 100644 index baa383f20..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00503.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerifyNR,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECVerifyNR( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00504.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00504.c deleted file mode 100644 index dd215f6d2..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00504.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECSignSM2,(const IppsBigNumState* pMsgDigest, const IppsBigNumState* pRegPrivate, IppsBigNumState* pEphPrivate, IppsBigNumState* pSignR, IppsBigNumState* pSignS, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECSignSM2( pMsgDigest, pRegPrivate, pEphPrivate, pSignR, pSignS, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00505.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00505.c deleted file mode 100644 index 36d08f915..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00505.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECVerifySM2,(const IppsBigNumState* pMsgDigest, const IppsGFpECPoint* pRegPublic, const IppsBigNumState* pSignR, const IppsBigNumState* pSignS, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECVerifySM2( pMsgDigest, pRegPublic, pSignR, pSignS, pResult, pEC, pScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00506.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00506.c deleted file mode 100644 index 64fd3414d..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00506.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, l9_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, k1_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECGetInfo_GF( pInfo, pEC ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECGetInfo_GF( pInfo, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECGetInfo_GF( pInfo, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) -IPPAPI(IppStatus, h9_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECGetInfo_GF,(IppsGFpInfo* pInfo, const IppsGFpECState* pEC)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECGetInfo_GF( pInfo, pEC ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECGetInfo_GF( pInfo, pEC ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00507.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00507.c deleted file mode 100644 index 1b9922ced..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00507.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) -IPPAPI(IppStatus, l9_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) -IPPAPI(IppStatus, k1_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESGetSize_SM2( pEC, pSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESGetSize_SM2( pEC, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESGetSize_SM2( pEC, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) -IPPAPI(IppStatus, h9_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESGetSize_SM2, (const IppsGFpECState* pEC, int* pSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESGetSize_SM2( pEC, pSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESGetSize_SM2( pEC, pSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00508.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00508.c deleted file mode 100644 index 8ea7b4636..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00508.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) -IPPAPI(IppStatus, l9_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) -IPPAPI(IppStatus, k1_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) -IPPAPI(IppStatus, h9_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESInit_SM2, (IppsGFpECState* pEC, IppsECESState_SM2* pState, int avaliableCtxSize)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESInit_SM2( pEC, pState, avaliableCtxSize ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00509.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00509.c deleted file mode 100644 index de901594c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00509.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) -IPPAPI(IppStatus, l9_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) -IPPAPI(IppStatus, k1_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) -IPPAPI(IppStatus, h9_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESSetKey_SM2, (const IppsBigNumState* pPrivate, const IppsGFpECPoint* pPublic, IppsECESState_SM2* pState, IppsGFpECState* pEC, Ipp8u* pEcScratchBuffer)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESSetKey_SM2( pPrivate, pPublic, pState, pEC, pEcScratchBuffer ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00510.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00510.c deleted file mode 100644 index 502dd6a9c..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00510.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) -IPPAPI(IppStatus, l9_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) -IPPAPI(IppStatus, k1_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESStart_SM2( pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESStart_SM2( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESStart_SM2( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) -IPPAPI(IppStatus, h9_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESStart_SM2, (IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESStart_SM2( pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESStart_SM2( pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00511.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00511.c deleted file mode 100644 index 675e2b0c7..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00511.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, l9_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, k1_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, h9_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESEncrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESEncrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00512.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00512.c deleted file mode 100644 index c2f020f6f..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00512.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, l9_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, k1_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, h9_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESDecrypt_SM2, (const Ipp8u* pInput, Ipp8u* pOutput, int dataLen, IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESDecrypt_SM2( pInput, pOutput, dataLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00513.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00513.c deleted file mode 100644 index afa1f8581..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00513.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, l9_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, k1_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) -IPPAPI(IppStatus, h9_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESFinal_SM2, (Ipp8u* pTag, int tagLen, IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESFinal_SM2( pTag, tagLen, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00514.c b/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00514.c deleted file mode 100644 index fd43139f1..000000000 --- a/sdk/tlibcrypto/ipp/ipp_disp/ippcpsgx_disp00514.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "ippcp.h" - -#define IPPFUN(type,name,arg) extern type IPP_STDCALL name arg - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - -#if defined (_M_AMD64) || defined (__x86_64__) - - -#define AVX3I_FEATURES ( ippCPUID_SHA|ippCPUID_AVX512VBMI|ippCPUID_AVX512VBMI2|ippCPUID_AVX512IFMA|ippCPUID_AVX512GFNI|ippCPUID_AVX512VAES|ippCPUID_AVX512VCLMUL ) -#define AVX3X_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512VL|ippCPUID_AVX512BW|ippCPUID_AVX512DQ ) -#define AVX3M_FEATURES ( ippCPUID_AVX512F|ippCPUID_AVX512CD|ippCPUID_AVX512PF|ippCPUID_AVX512ER ) - - -IPPAPI(IppStatus, y8_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) -IPPAPI(IppStatus, l9_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) -IPPAPI(IppStatus, k1_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( AVX3I_FEATURES == ( features & AVX3I_FEATURES )) { - return k1_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); - } else - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return l9_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return y8_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#else - - -IPPAPI(IppStatus, p8_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) -IPPAPI(IppStatus, h9_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) - -IPPFUN(IppStatus,sgx_disp_ippsGFpECESGetBuffersSize_SM2, (int* pPublicKeySize, int* pMaximumTagSize, const IppsECESState_SM2* pState)) -{ - Ipp64u features; - ippcpGetCpuFeatures( &features ); - - if( ippCPUID_AVX2 == ( features & ippCPUID_AVX2 )) { - return h9_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); - } else - if( ippCPUID_SSE42 == ( features & ippCPUID_SSE42 )) { - return p8_ippsGFpECESGetBuffersSize_SM2( pPublicKeySize, pMaximumTagSize, pState ); - } else - return ippStsCpuNotSupportedErr; -} -#endif diff --git a/sdk/tlibcxx/include/__hash_table b/sdk/tlibcxx/include/__hash_table index 521ebbf2c..8c926ad8f 100644 --- a/sdk/tlibcxx/include/__hash_table +++ b/sdk/tlibcxx/include/__hash_table @@ -2073,7 +2073,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& size_type __bc = bucket_count(); bool __inserted = false; __next_pointer __nd; - size_t __chash; + size_t __chash = 0; if (__bc != 0) { __chash = __constrain_hash(__hash, __bc); diff --git a/sdk/tlibcxx/include/memory b/sdk/tlibcxx/include/memory index 3989ceae4..185e3cf0f 100644 --- a/sdk/tlibcxx/include/memory +++ b/sdk/tlibcxx/include/memory @@ -701,7 +701,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template inline _LIBCPP_INLINE_VISIBILITY _ValueType __libcpp_relaxed_load(_ValueType const* __value) { -#if defined(_LIBCPP_SGX_HAS_CXX_ATOMIC) && \ +#if (!defined(_LIBCPP_HAS_NO_THREADS) || defined(_LIBCPP_SGX_HAS_CXX_ATOMIC)) && \ defined(__ATOMIC_RELAXED) && \ (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) return __atomic_load_n(__value, __ATOMIC_RELAXED); @@ -713,7 +713,7 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) { template inline _LIBCPP_INLINE_VISIBILITY _ValueType __libcpp_acquire_load(_ValueType const* __value) { -#if defined(_LIBCPP_SGX_HAS_CXX_ATOMIC) && \ +#if (!defined(_LIBCPP_HAS_NO_THREADS) || defined(_LIBCPP_SGX_HAS_CXX_ATOMIC)) && \ defined(__ATOMIC_ACQUIRE) && \ (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) return __atomic_load_n(__value, __ATOMIC_ACQUIRE); @@ -2452,7 +2452,8 @@ template inline _LIBCPP_INLINE_VISIBILITY _Tp __libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT { -#if defined(_LIBCPP_SGX_HAS_CXX_ATOMIC) +#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && \ + (!defined(_LIBCPP_HAS_NO_THREADS) || defined(_LIBCPP_SGX_HAS_CXX_ATOMIC)) return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED); #else return __t += 1; @@ -2463,7 +2464,8 @@ template inline _LIBCPP_INLINE_VISIBILITY _Tp __libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT { -#if defined(_LIBCPP_SGX_HAS_CXX_ATOMIC) +#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && \ + (!defined(_LIBCPP_HAS_NO_THREADS) || defined(_LIBCPP_SGX_HAS_CXX_ATOMIC)) return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL); #else return __t -= 1; diff --git a/sdk/tlibcxx/include/type_traits b/sdk/tlibcxx/include/type_traits index 59dfd1e9b..e4f66aa47 100644 --- a/sdk/tlibcxx/include/type_traits +++ b/sdk/tlibcxx/include/type_traits @@ -1682,12 +1682,12 @@ struct __is_core_convertible<_Tp, _Up, decltype( // is_convertible -#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) +#if __has_builtin(__is_convertible) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) template struct _LIBCPP_TEMPLATE_VIS is_convertible - : public integral_constant {}; + : public integral_constant {}; -#else // __has_feature(is_convertible_to) +#else // __has_builtin(__is_convertible) namespace __is_convertible_imp { @@ -1754,7 +1754,7 @@ template struct _LIBCPP_TEMPLATE_VIS is_convertible static const size_t __complete_check2 = __is_convertible_check<_T2>::__v; }; -#endif // __has_feature(is_convertible_to) +#endif // __has_builtin(__is_convertible) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template diff --git a/sdk/tlibcxx/src/include/atomic_support.h b/sdk/tlibcxx/src/include/atomic_support.h index ee546337d..749726e75 100644 --- a/sdk/tlibcxx/src/include/atomic_support.h +++ b/sdk/tlibcxx/src/include/atomic_support.h @@ -28,7 +28,8 @@ # define _LIBCPP_HAS_ATOMIC_BUILTINS #endif -#if !defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && !defined(_LIBCPP_HAS_NO_THREADS) +#if !defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && \ + (!defined(_LIBCPP_HAS_NO_THREADS) || defined(_LIBCPP_SGX_HAS_CXX_ATOMIC)) # if defined(_LIBCPP_WARNING) _LIBCPP_WARNING("Building libc++ without __atomic builtins is unsupported") # else @@ -40,7 +41,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD namespace { -#if defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && defined(_LIBCPP_SGX_HAS_CXX_ATOMIC) +#if defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && \ + (!defined(_LIBCPP_HAS_NO_THREADS) || defined(_LIBCPP_SGX_HAS_CXX_ATOMIC)) enum __libcpp_atomic_order { _AO_Relaxed = __ATOMIC_RELAXED, diff --git a/sdk/trts/init_enclave.cpp b/sdk/trts/init_enclave.cpp index 4297e858f..dbdf7ecf5 100644 --- a/sdk/trts/init_enclave.cpp +++ b/sdk/trts/init_enclave.cpp @@ -58,10 +58,12 @@ int EDMM_supported __attribute__((section(RELRO_SECTION_NAME))) = 0; sdk_version_t g_sdk_version __attribute__((section(RELRO_SECTION_NAME))) = SDK_VERSION_1_5; uint64_t g_enclave_base __attribute__((section(RELRO_SECTION_NAME))) = 0; uint64_t g_enclave_size __attribute__((section(RELRO_SECTION_NAME))) = 0; +int g_aexnotify_supported __attribute__((section(RELRO_SECTION_NAME))) = 0; const volatile global_data_t g_global_data __attribute__((section(".niprod"))) = {VERSION_UINT, 1, 2, 3, 4, 5, 6, 0, 0, 0, - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0}, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, {{{0, 0, 0, 0, 0, 0, 0}}}, 0, 0, 0}; + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, + {{{0, 0, 0, 0, 0, 0, 0}}}, 0, 0, 0, 0}; // Make sure to access this with atomics or the {get,set}_enclave_state assembly wrappers. uint32_t g_enclave_state __attribute__((section(".nipd"))) = ENCLAVE_INIT_NOT_STARTED; @@ -82,6 +84,7 @@ extern "C" int rsrv_mem_init(void *_rsrv_mem_base, size_t _rsrv_mem_size, size_t #ifndef SE_SIM extern "C" int init_rts_emas(size_t rts_base, layout_t *start, layout_t *end); extern "C" int sgx_mm_init(size_t, size_t); +extern "C" int emalloc_init_with_reserved_mem(size_t); #endif // init_enclave() // Initialize enclave. @@ -174,6 +177,8 @@ extern "C" int init_enclave(void *enclave_base, void *ms) { return -1; } + + g_aexnotify_supported = feature_supported((const uint64_t *)sys_features.system_feature_set, AEXNOTIFY_BIT); if (heap_init(get_heap_base(), get_heap_size(), get_heap_min_size(), EDMM_supported) != SGX_SUCCESS) return -1; @@ -301,6 +306,9 @@ sgx_status_t do_init_enclave(void *ms, void *tcs) if (sgx_mm_init(user_base, user_end)) return SGX_ERROR_UNEXPECTED; + if (emalloc_init_with_reserved_mem(g_global_data.edmm_bk_overhead)) + return SGX_ERROR_UNEXPECTED; + int ret = init_rts_emas(rts_base, layout_start, layout); if (ret != SGX_SUCCESS) { return SGX_ERROR_UNEXPECTED; diff --git a/sdk/trts/linux/Makefile b/sdk/trts/linux/Makefile index 9424be04c..374007bee 100644 --- a/sdk/trts/linux/Makefile +++ b/sdk/trts/linux/Makefile @@ -46,6 +46,14 @@ CXXFLAGS += -Werror $(ENCLAVE_CXXFLAGS) \ TCFLAGS += -nostdinc \ -I$(COMMON_DIR)/inc/tlibc/ +ifneq ($(MITIGATION-CVE-2020-0551), LOAD) +ifneq ($(MITIGATION-CVE-2020-0551), CF) +# Enable below flag to treat warning as error for assembly code +# It doesn't work for mitigation mode. + TCFLAGS += -Wa,--fatal-warnings +endif +endif + LDCFLAGS := -shared -nostdlib -nodefaultlibs -nostartfiles CPP_SRCS := $(filter-out ../trts_emm_sim.cpp, $(wildcard ../*.cpp)) diff --git a/sdk/trts/linux/trts_mitigation.S b/sdk/trts/linux/trts_mitigation.S new file mode 100644 index 000000000..3b6166139 --- /dev/null +++ b/sdk/trts/linux/trts_mitigation.S @@ -0,0 +1,388 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +// Generates code that consumes `n` cycles by repeatedly moving from register +// `r` to itself. +.macro CYCLE_DELAY n r + lea (\r), \r +.if \n-1 +CYCLE_DELAY "(\n-1)" \r +.endif +.endm + + .data + .align 0x1000 /* 4KB */ +.globl aex_notify_c3_cache +aex_notify_c3_cache: + .space 0x1000 /* 4KB */ + +/* + * Description: + * The file provides mitigations for SGX-Step + */ + + .file "trts_mitigation.S" + +#include "trts_pic.h" +#include "../trts_mitigation.h" + + /* .text */ + .section .nipx,"ax",@progbits + +/* + * ------------------------------------------------------------------------- + * extern "C" + * void constant_time_apply_sgxstep_mitigation_and_continue_execution( + * sgx_exception_info_t *info, + * uintptr_t ssa_aexnotify_addr, + * uintptr_t stack_tickle_pages, + * uintptr_t code_tickle_page, + * uintptr_t data_tickle_page, + * uintptr_t c3_byte_address); + * + * Function: constant_time_apply_sgxstep_mitigation_and_continue_execution + * Mitigate SGX-Step and return to the point at which the most recent + * interrupt/exception occurred. + * Parameters: + * - info: pointer to the SGX exception info for the most recent + * interrupt/exception + * - ssa_aexnotify_addr: address of the SSA[0].GPRSGX.AEXNOTIFY byte + * - stack_tickle_pages: Base address of stack page(s) to tickle + * - code_tickle_page: Base address of code page to tickle + * - data_tickle_page: Base address of data page to tickle + * - c3_byte_address: Address of a c3 byte in code_tickle_page + * There are three additional "implicit" parameters to this function: + * 1. The low-order bit of `stack_tickle_pages` is 1 if a second stack + * page should be tickled (specifically, the stack page immediately + * below the page specified in the upper bits) + * 2. The low-order bit of `code_tickle_page` is 1 if the cycle delay + * should be added to the mitigation + * 3. The low-order bit of `data_tickle_page` is 1 if `data_tickle_page` + * is writable, and therefore should be tested for write permissions + * by the mitigation + * + * Stack: + * bottom of stack -> --------------------------- + * | Lower frame(s) | + * --------------------------- + * rsp of main flow ---+ | Stack frame of the "main | + * == | | flow" function that was | + * rsp @mitigation_begin -> | interrupted |<--+-(irq mitigation) + * --------------------------- | + * | ... |<--+-(irq c3) + * | red zone (128 bytes) | | + * | ... | | + * +- --------------------------- | + * +-|-| rsvd main-flow RIP |-1 | + * | | | rsvd main-flow RAX |-2 | + * | | | rsvd main-flow RCX |-3 | + * (main-flow regs that | | | rsvd main-flow RDX |-4 | + * will be reset in | | | rsvd main-flow RBX |-5 | + * ct_restore_state) | | | rsvd main-flow RBP |-6 | + * | | | rsvd main-flow RSI |-7 | + * | | | rsvd main-flow RDI |-8 | + * | | | rsvd main-flow FLAGS |-9 | + * +-|-| rsvd main-flow -8(rsp) |-10| + * +-|-| &SSA[0].AEXNOTIFY (rsi) |-11| + * (copy of parameters | | | ptr stack tickle (rdx) |-12| + * passed @entry) | | | ptr code tickle (rcx) |-13| + * | | | ptr data tickle (r8) |-14| + * +-|-| ptr c3 byte (r9) |-15| + * (this whole rsvd area | --------------------------- | + * is persistent and will | | ... | | + * not be touched by | | padding for alignment | | + * stage-1/2 handlers) +-| ... | | + * +-- --------------------------- | + * | | exception_type | | + * | | exception_vec | | + * | | pre-irq RIP |17 | + * | | pre-irq RFLAGS |16 | + * | | pre-irq R15 |15 | + * (pre-irq CPU state | | pre-irq R14 |14 | + * prepared by stage-1 | | pre-irq R13 |13 | + * handler in | | pre-irq R12 |12 | + * trts_handle_exception)| | pre-irq R11 |11 | + * | | pre-irq R10 |10 | + * | | pre-irq R9 |9 | + * | | pre-irq R8 |8 | + * | | pre-irq RDI |7 | + * | | pre-irq RSI |6 | + * | | pre-irq RBP |5 | + * | | pre-irq RSP |4--+ + * | | pre-irq RBX |3 + * | | pre-irq RDX |2 + * | | pre-irq RCX |1 + * rdi @entry -> | pre-irq RAX |0 + * +-- ---------------------------| + * rsp @second_phase -> | pre-irq RIP (for dbg) | + * ---------------------------| + * | Stack frame of stage-2 | + * | internal_handle_exception | + * rsp @entry -> | ... | + * --------------------------- + * ------------------------------------------------------------------------- + */ + +#define RSVD_BOTTOM (-RED_ZONE_SIZE-0*SE_WORDSIZE) +#define RSVD_RIP_OFFSET (-RED_ZONE_SIZE-1*SE_WORDSIZE) +#define RSVD_RAX_OFFSET (-RED_ZONE_SIZE-2*SE_WORDSIZE) +#define RSVD_RCX_OFFSET (-RED_ZONE_SIZE-3*SE_WORDSIZE) +#define RSVD_RDX_OFFSET (-RED_ZONE_SIZE-4*SE_WORDSIZE) +#define RSVD_RBX_OFFSET (-RED_ZONE_SIZE-5*SE_WORDSIZE) +#define RSVD_RBP_OFFSET (-RED_ZONE_SIZE-6*SE_WORDSIZE) +#define RSVD_RSI_OFFSET (-RED_ZONE_SIZE-7*SE_WORDSIZE) +#define RSVD_RDI_OFFSET (-RED_ZONE_SIZE-8*SE_WORDSIZE) +#define RSVD_FLAGS_OFFSET (-RED_ZONE_SIZE-9*SE_WORDSIZE) +#define RSVD_REDZONE_WORD_OFFSET (-RED_ZONE_SIZE-10*SE_WORDSIZE) +#define RSVD_AEXNOTIFY_ADDRESS_OFFSET (-RED_ZONE_SIZE-11*SE_WORDSIZE) +#define RSVD_STACK_TICKLE_OFFSET (-RED_ZONE_SIZE-12*SE_WORDSIZE) +#define RSVD_CODE_TICKLE_OFFSET (-RED_ZONE_SIZE-13*SE_WORDSIZE) +#define RSVD_DATA_TICKLE_OFFSET (-RED_ZONE_SIZE-14*SE_WORDSIZE) +#define RSVD_C3_ADDRESS_OFFSET (-RED_ZONE_SIZE-15*SE_WORDSIZE) +#define RSVD_TOP (-RED_ZONE_SIZE-15*SE_WORDSIZE) + +#if RSVD_SIZE_OF_MITIGATION_STACK_AREA != (RSVD_BOTTOM-RSVD_TOP) +#error "Malformed reserved mitigation stack area" +#endif + +#define INFO_RAX_OFFSET (0*SE_WORDSIZE) +#define INFO_RCX_OFFSET (1*SE_WORDSIZE) +#define INFO_RDX_OFFSET (2*SE_WORDSIZE) +#define INFO_RBX_OFFSET (3*SE_WORDSIZE) +#define INFO_RSP_OFFSET (4*SE_WORDSIZE) +#define INFO_RBP_OFFSET (5*SE_WORDSIZE) +#define INFO_RSI_OFFSET (6*SE_WORDSIZE) +#define INFO_RDI_OFFSET (7*SE_WORDSIZE) +#define INFO_R8_OFFSET (8*SE_WORDSIZE) +#define INFO_R9_OFFSET (9*SE_WORDSIZE) +#define INFO_R10_OFFSET (10*SE_WORDSIZE) +#define INFO_R11_OFFSET (11*SE_WORDSIZE) +#define INFO_R12_OFFSET (12*SE_WORDSIZE) +#define INFO_R13_OFFSET (13*SE_WORDSIZE) +#define INFO_R14_OFFSET (14*SE_WORDSIZE) +#define INFO_R15_OFFSET (15*SE_WORDSIZE) +#define INFO_FLAGS_OFFSET (16*SE_WORDSIZE) +#define INFO_RIP_OFFSET (17*SE_WORDSIZE) + +DECLARE_LOCAL_FUNC constant_time_apply_sgxstep_mitigation_and_continue_execution +/* Note: moving rsp upwards as a scratchpad register discards any data at lower + * addresses (i.e., these may be overwritten by nested exception handlers, but + * the stage-1 handler will always safeguard a red zone + rsvd area under the + * interrupted stack pointer). */ + mov INFO_RSP_OFFSET(%rdi), %rsp /* rsp: pre-irq rsp */ + mov INFO_RIP_OFFSET(%rdi), %rax /* rax: pre-irq rip */ + mov %rax, %r10 + +/* Check whether the last AEX occurred during the mitigation */ + cmpb $0xc3, (%rax) # ZF=1 if interrupted c3 (ret) + cmovz (%rsp), %rax # rax: irq c3? caller rip : pre-irq rip + mov %rsp, %rbp + lea SE_WORDSIZE(%rsp), %rbx + cmovz %rbx, %rbp # rbp: irq c3? post-ret rsp : pre-irq rsp + + lea_pic __ct_mitigation_end, %rbx + sub %rax, %rbx + cmp $(__ct_mitigation_end - __ct_mitigation_begin + 1), %rbx +// CMP will set CF=1 (B) if the mitigation was interrupted, CF=0 (NB) otherwise + cmovb %rbp, %rsp # rsp: original main flow rsp + mov %rsp, INFO_RSP_OFFSET(%rdi) + +// If the mitigation was interrupted, restore the interrupted IP from the +// reserved area + cmovb RSVD_RIP_OFFSET(%rsp), %r10 + mov %r10, RSVD_RIP_OFFSET(%rsp) + +// Copy RFLAGS onto the reserved stack area + mov INFO_FLAGS_OFFSET(%rdi), %rax + mov %rax, RSVD_FLAGS_OFFSET(%rsp) + +// If the mitigation was interrupted, restore the first q/dword of the red +// zone from the reserved area; otherwise save it to the reserved area + mov -SE_WORDSIZE(%rsp), %rax + cmovb RSVD_REDZONE_WORD_OFFSET(%rsp), %rax + mov %rax, RSVD_REDZONE_WORD_OFFSET(%rsp) + +// Save &SSA[0].GPRSGX.AEXNOTIFY to the reserved area + mov %rsi, RSVD_AEXNOTIFY_ADDRESS_OFFSET(%rsp) + +// If the mitigation was interrupted, restore tickle parameters from the +// reserved area. + cmovb RSVD_STACK_TICKLE_OFFSET(%rsp), %rdx + cmovb RSVD_CODE_TICKLE_OFFSET(%rsp), %rcx + cmovb RSVD_DATA_TICKLE_OFFSET(%rsp), %r8 + cmovb RSVD_C3_ADDRESS_OFFSET(%rsp), %r9 + mov %rdx, RSVD_STACK_TICKLE_OFFSET(%rsp) + mov %rcx, RSVD_CODE_TICKLE_OFFSET(%rsp) + mov %r8, RSVD_DATA_TICKLE_OFFSET(%rsp) + mov %r9, RSVD_C3_ADDRESS_OFFSET(%rsp) + +// If the mitigation was not interrupted (the interrupt occured in the main flow) +// then restore the registers from *info + mov INFO_R8_OFFSET(%rdi), %r8 + mov INFO_R9_OFFSET(%rdi), %r9 + mov INFO_R10_OFFSET(%rdi), %r10 + mov INFO_R11_OFFSET(%rdi), %r11 + mov INFO_R12_OFFSET(%rdi), %r12 + mov INFO_R13_OFFSET(%rdi), %r13 + mov INFO_R14_OFFSET(%rdi), %r14 + mov INFO_R15_OFFSET(%rdi), %r15 + mov INFO_RAX_OFFSET(%rdi), %rax + mov INFO_RCX_OFFSET(%rdi), %rcx + mov INFO_RDX_OFFSET(%rdi), %rdx + mov INFO_RBX_OFFSET(%rdi), %rbx + mov INFO_RBP_OFFSET(%rdi), %rbp + mov INFO_RSI_OFFSET(%rdi), %rsi + mov INFO_RDI_OFFSET(%rdi), %rdi + +// If the mitigation was interrupted, restore registers from the reserved area +// on the stack. + cmovb RSVD_RAX_OFFSET(%rsp), %rax + cmovb RSVD_RCX_OFFSET(%rsp), %rcx + cmovb RSVD_RDX_OFFSET(%rsp), %rdx + cmovb RSVD_RBX_OFFSET(%rsp), %rbx + cmovb RSVD_RBP_OFFSET(%rsp), %rbp + cmovb RSVD_RSI_OFFSET(%rsp), %rsi + cmovb RSVD_RDI_OFFSET(%rsp), %rdi + + mov %rax, RSVD_RAX_OFFSET(%rsp) + mov %rcx, RSVD_RCX_OFFSET(%rsp) + mov %rdx, RSVD_RDX_OFFSET(%rsp) + mov %rbx, RSVD_RBX_OFFSET(%rsp) + mov %rbp, RSVD_RBP_OFFSET(%rsp) + mov %rsi, RSVD_RSI_OFFSET(%rsp) + mov %rdi, RSVD_RDI_OFFSET(%rsp) + +# Restore tickle addresses + mov RSVD_STACK_TICKLE_OFFSET(%rsp), %rbp + mov RSVD_CODE_TICKLE_OFFSET(%rsp), %rsi + mov RSVD_DATA_TICKLE_OFFSET(%rsp), %rdx + mov RSVD_C3_ADDRESS_OFFSET(%rsp), %rdi + +# Restore flags + lea RSVD_FLAGS_OFFSET(%rsp), %rax + xchg %rax, %rsp + popf + xchg %rax, %rsp + +# NOTHING AFTER THIS POINT CAN MODIFY EFLAGS/RFLAGS + +################################################################################ +# BEGIN MITIGATION CODE +################################################################################ + +#define MITIGATION_CODE_ALIGNMENT 0x200 +.align MITIGATION_CODE_ALIGNMENT + +# Enable AEX Notify +.ct_enable_aexnotify: + mov RSVD_AEXNOTIFY_ADDRESS_OFFSET(%rsp), %rax + movb $1, (%rax) + + .global __ct_mitigation_begin +__ct_mitigation_begin: +# Step 1: Inject random cycle noise + movzx %sil, %rcx # The lowest byte in %xsi indicates whether cycles should be added + mov $0, %sil + lfence + jrcxz .ct_set_up_tickles + CYCLE_DELAY 20, %rax + +.ct_set_up_tickles: + lfence + movzx %bpl, %rcx # The lowest byte in %rbp indicates whether a second stack page can be tickled + jrcxz .ct_set_up_tickles_with_one_stack_page + mov $0x00, %bpl + lea -0x1000(%rbp), %rbx + jmp .ct_warm_caches_and_tlbs +.ct_set_up_tickles_with_one_stack_page: + lea 0x08(%rbp), %rbx + +# Load all working set cache lines and warm the TLB entries +.ct_warm_caches_and_tlbs: + movzx %dl, %rcx # The lowest byte in %rdx indicates whether data_tickle_page can be written to + mov $0x10, %dl # avoid sequencing uops, in case rbp and rdx alias + jrcxz .ct_warm_caches_and_tlbs_data_read_pre + +.ct_warm_caches_and_tlbs_data_write_pre: + mov $0x1000, %ecx +.align 0x10 +.ct_warm_caches_and_tlbs_data_write: + lea -0x40(%ecx), %ecx + call *%rdi + mov (%rsi, %rcx), %eax + mov (%rbp, %rcx), %eax + mov %eax, (%rbp, %rcx) + mov (%rbx, %rcx), %eax + mov %eax, (%rbx, %rcx) + mov (%rdx, %rcx), %eax + mov %eax, (%rdx, %rcx) + jrcxz .ct_restore_state + jmp .ct_warm_caches_and_tlbs_data_write # loops 64 times + +// This block is identical to the previous one, except that it doesn't write +// to data_tickle_page. +.ct_warm_caches_and_tlbs_data_read_pre: + mov $0x1000, %ecx +.align 0x10 +.ct_warm_caches_and_tlbs_data_read: + lea -0x40(%ecx), %ecx + call *%rdi + mov (%rsi, %rcx), %eax + mov (%rbp, %rcx), %eax + mov %eax, (%rbp, %rcx) + mov (%rbx, %rcx), %eax + mov %eax, (%rbx, %rcx) + mov (%rdx, %rcx), %eax + jrcxz .ct_restore_state + jmp .ct_warm_caches_and_tlbs_data_read # loops 64 times + +.ct_restore_state: + mov RSVD_REDZONE_WORD_OFFSET(%rsp), %rdi + mov %rdi, -SE_WORDSIZE(%rsp) # restore the first q/dword of the red zone + mov RSVD_RDI_OFFSET(%rsp), %rdi + mov RSVD_RSI_OFFSET(%rsp), %rsi + mov RSVD_RBP_OFFSET(%rsp), %rbp + mov RSVD_RBX_OFFSET(%rsp), %rbx + mov RSVD_RDX_OFFSET(%rsp), %rdx + mov RSVD_RCX_OFFSET(%rsp), %rcx + mov RSVD_RAX_OFFSET(%rsp), %rax +__ct_mitigation_end: + jmp *RSVD_RIP_OFFSET(%rsp) + +.global __ct_mitigation_ret +__ct_mitigation_ret: + ret + +.ct_aexnotify_end: + +.sect _to_be_discarded, "e", @nobits +.space MITIGATION_CODE_ALIGNMENT - (.ct_aexnotify_end - .ct_enable_aexnotify) +.previous diff --git a/sdk/trts/linux/trts_pic.S b/sdk/trts/linux/trts_pic.S index d7ba3d88c..65fb96390 100644 --- a/sdk/trts/linux/trts_pic.S +++ b/sdk/trts/linux/trts_pic.S @@ -29,7 +29,6 @@ * */ - /* * Description: * The file provides `enclave_entry' function to switch code between @@ -191,6 +190,27 @@ DECLARE_GLOBAL_FUNC enclave_entry call restore_xregs lfence +#ifndef SE_SIM + mov -3*SE_WORDSIZE(%xbp), %xax /* cssa */ + cmp $0, %xax + jne .Lrestore_untrust_stack + + READ_TD_DATA self_addr /* xax: td */ + cmp $0, %xax /* check if td is initialized */ + je .Lrestore_untrust_stack + mov first_ssa_gpr(%xax), %xdx + movb aex_notify(%xdx), %cl + cmpb $0, %cl + je .Lrestore_untrust_stack + /* + * clear aexnotify bit to disable aexnotify temporarily and + * set td.aex_notify_flag to indicate aexnotify is enabled + * before EEXIT + */ + movb $0, aex_notify(%xdx) + movl $0x1, aex_notify_flag(%xax) +#endif +.Lrestore_untrust_stack: /* set xdi and xsi */ mov $OCMD_ERET, %xdi mov %xbx, %xsi @@ -376,9 +396,22 @@ DECLARE_LOCAL_FUNC do_ocall mov SE_WORDSIZE*12(%xsp), %xdi /* restore xdi */ mov SE_WORDSIZE*13(%xsp), %xsi /* restore xdi */ #endif - /* restore outside stack context */ mov first_ssa_gpr(%xbx), %xdx +#ifndef SE_SIM + movb aex_notify(%xdx), %cl + cmpb $0, %cl + je .Lrestore_outside_stack + + /* + * clear aexnotify to disable aexnotify temporarily and + * set td.aex_notify_flag to indicate aexnotify is enabled + * before EEXIT + */ + movb $0, aex_notify(%xdx) + movl $0x1, aex_notify_flag(%xbx) +#endif +.Lrestore_outside_stack: mov ssa_bp_u(%xdx), %xbp mov ssa_sp_u(%xdx), %xsp /* @@ -657,4 +690,18 @@ DECLARE_LOCAL_FUNC continue_execution pop %xcx /* restore xcx */ pop %xsp /* xsp: xax */ xchg %xax, %xsp + ret $(RED_ZONE_SIZE) /* pop xip and red zone (if any) */ + +/* + * ------------------------------------------------------------------------- + * extern "C" __attribute__((regparm(1))) void second_phase(sgx_exception_info_t *info, + * void *new_sp, void *second_phase_handler_addr); + * ------------------------------------------------------------------------- + */ +DECLARE_LOCAL_FUNC second_phase + movq %xsi, %xsp + mov $SE_EDECCSSA, %xax + enclu /* DECCSSA */ + jmp *%xdx + diff --git a/sdk/trts/linux/trts_pic.h b/sdk/trts/linux/trts_pic.h index 1f769bedc..0fbd69610 100644 --- a/sdk/trts/linux/trts_pic.h +++ b/sdk/trts/linux/trts_pic.h @@ -67,12 +67,14 @@ #define xsave_size (SE_WORDSIZE * 7) #define self_addr 0 #define stack_guard (SE_WORDSIZE * 5) +#define aex_notify_flag (SE_WORDSIZE * 10) /* SSA GPR */ #define ssa_sp_t 32 #define ssa_sp_u 144 #define ssa_bp_u 152 #define ssa_exit_info 160 +#define aex_notify 167 #endif #define EXIT_INFO_VALID 0x80000000 diff --git a/sdk/trts/trts.cpp b/sdk/trts/trts.cpp index 1ddd5f6eb..749a699c0 100644 --- a/sdk/trts/trts.cpp +++ b/sdk/trts/trts.cpp @@ -40,6 +40,8 @@ #include "trts_internal.h" #include "internal/rts.h" #include "trts_util.h" +#include "sgx_utils.h" +#include "sgx_report.h" #ifdef SE_SIM #include "t_instructions.h" /* for `g_global_data_sim' */ @@ -352,3 +354,4 @@ int SGXAPI sgx_wrpkru(uint32_t val) : "a" (val), "c"(c), "d"(d)); return 1; } + diff --git a/sdk/trts/trts_add_trim.cpp b/sdk/trts/trts_add_trim.cpp index 59e1e11a2..e44150705 100644 --- a/sdk/trts/trts_add_trim.cpp +++ b/sdk/trts/trts_add_trim.cpp @@ -261,7 +261,7 @@ sgx_status_t do_add_thread(void *ptcs) const volatile layout_t *layout = get_dynamic_layout_by_id(id); if (layout && (layout->entry.attributes & PAGE_ATTR_DYN_THREAD)) { - ret = mm_commit((void *)(enclave_base + layout->entry.rva + offset), layout->entry.page_count << SE_PAGE_SHIFT); + ret = mm_commit((void *)(enclave_base + layout->entry.rva + offset), (uint64_t)layout->entry.page_count << SE_PAGE_SHIFT); if (ret != 0) return SGX_ERROR_UNEXPECTED; } diff --git a/sdk/trts/trts_aex.cpp b/sdk/trts/trts_aex.cpp new file mode 100644 index 000000000..984c07f05 --- /dev/null +++ b/sdk/trts/trts_aex.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +/** + * File: trts_aex.cpp + * Description: + * This file implements the APIs for AEX notify support. + */ + +#include "sgx_trts_aex.h" +#include +#include "sgx_trts.h" +#include "arch.h" +#include "thread_data.h" +#include "trts_internal.h" +#include "trts_inst.h" +#include "util.h" +#include "trts_util.h" +#include "trts_shared_constants.h" +#include "se_cdefs.h" +#include "sgx_utils.h" + + +sgx_status_t SGXAPI sgx_set_ssa_aexnotify(int flag) +{ + thread_data_t *thread_data = get_thread_data(); + ssa_gpr_t *ssa_gpr = NULL; + + if(thread_data == NULL) + { + return SGX_ERROR_UNEXPECTED; + } + + auto *report = sgx_self_report(); + if(!(report->body.attributes.flags & SGX_FLAGS_AEX_NOTIFY)) + { + return SGX_ERROR_UNEXPECTED; + } + + // no need to check the result of ssa_gpr because thread_data is always trusted + ssa_gpr = reinterpret_cast(thread_data->first_ssa_gpr); + if (flag) + ssa_gpr->aex_notify|= SSA_AEXNOTIFY_MASK; + else + ssa_gpr->aex_notify &= (uint8_t)(~SSA_AEXNOTIFY_MASK); + return SGX_SUCCESS; +} + + +sgx_status_t SGXAPI sgx_register_aex_handler(sgx_aex_mitigation_node_t *aex_node, sgx_aex_mitigation_fn_t handler, const void *argv) +{ + if (aex_node == NULL || handler == NULL) + return SGX_ERROR_INVALID_PARAMETER; + thread_data_t *thread_data = get_thread_data(); + sgx_aex_mitigation_node_t *head = (sgx_aex_mitigation_node_t *)thread_data->aex_mitigation_list; + + aex_node->handler = handler; + aex_node->args = argv; + aex_node->next = head; + head = aex_node; + + thread_data->aex_mitigation_list = (sys_word_t) head; + + return SGX_SUCCESS; +} + +sgx_status_t SGXAPI sgx_unregister_aex_handler(sgx_aex_mitigation_fn_t handler) +{ + if(handler == NULL) + return SGX_ERROR_INVALID_PARAMETER; + + // Search and find out the aex_node corresponding to the handler + thread_data_t *thread_data = get_thread_data(); + sgx_aex_mitigation_node_t *node = (sgx_aex_mitigation_node_t *)thread_data->aex_mitigation_list; + sgx_aex_mitigation_node_t *prev_node = NULL; + if(node == NULL) + return SGX_ERROR_UNEXPECTED; + + while(node) + { + if(node->handler == handler) + break; + prev_node = node; + node = node->next; + } + // Remove the node from the list + if(node != NULL) + { + if(prev_node == NULL) + { + // It is the first node + thread_data->aex_mitigation_list = (sys_word_t)node->next; + } + else + { + prev_node->next = node->next; + } + } + else // node not found + { + return SGX_ERROR_INVALID_PARAMETER; + } + return SGX_SUCCESS; +} + + +extern "C" sgx_status_t sgx_apply_mitigations(const sgx_exception_info_t *info) +{ + thread_data_t *thread_data = get_thread_data(); + sgx_aex_mitigation_node_t *node = (sgx_aex_mitigation_node_t *)thread_data->aex_mitigation_list; + while(node) + { + // Call mitigation handlers + node->handler(info, node->args); + node = node->next; + } + return SGX_SUCCESS; +} + + diff --git a/sdk/trts/trts_ecall.cpp b/sdk/trts/trts_ecall.cpp index 6e5717905..a4ea8e2a6 100644 --- a/sdk/trts/trts_ecall.cpp +++ b/sdk/trts/trts_ecall.cpp @@ -37,6 +37,7 @@ #include "util.h" #include "xsave.h" #include "sgx_trts.h" +#include "sgx_trts_aex.h" #include "sgx_lfence.h" #include "sgx_spinlock.h" #include "global_init.h" @@ -337,6 +338,7 @@ sgx_status_t do_init_thread(void *tcs, bool enclave_init) thread_data->stack_limit_addr += (size_t)tcs; thread_data->stack_commit_addr = thread_data->stack_limit_addr; thread_data->first_ssa_gpr += (size_t)tcs; + thread_data->first_ssa_xsave += (size_t)tcs; thread_data->tls_array += (size_t)tcs; thread_data->tls_addr += (size_t)tcs; thread_data->last_sp -= (size_t)STATIC_STACK_SIZE; @@ -401,6 +403,15 @@ sgx_status_t do_ecall(int index, void *ms, void *tcs) } } thread_data = get_thread_data(); + // If aexnotify is enabled but we disable it temporarily before last EEXIT, + // we need to enable it again +#ifndef SE_SIM + if(thread_data->aex_notify_flag == 1) + { + thread_data->aex_notify_flag = 0; + sgx_set_ssa_aexnotify(1); + } +#endif if(thread_data->stack_base_addr == thread_data->last_sp) { //root ecall diff --git a/sdk/trts/trts_mitigation.h b/sdk/trts/trts_mitigation.h new file mode 100644 index 000000000..d6ef85d52 --- /dev/null +++ b/sdk/trts/trts_mitigation.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef TRTS_MIITGATION_H__ +#define TRTS_MIITGATION_H__ + +#define RSVD_SIZE_OF_MITIGATION_STACK_AREA (15 * 8) + +#endif diff --git a/sdk/trts/trts_nsp.cpp b/sdk/trts/trts_nsp.cpp index dfc614142..eff5ca82c 100644 --- a/sdk/trts/trts_nsp.cpp +++ b/sdk/trts/trts_nsp.cpp @@ -112,7 +112,7 @@ extern "C" int enter_enclave(int index, void *ms, void *tcs, int cssa) error = do_uninit_enclave(tcs); } } - else if((cssa == 1) && (index == ECMD_EXCEPT)) + else if(cssa == 1) { error = trts_handle_exception(tcs); if (check_static_stack_canary(tcs) != 0) diff --git a/sdk/trts/trts_ocall.cpp b/sdk/trts/trts_ocall.cpp index 8f6daeb7a..c63615409 100644 --- a/sdk/trts/trts_ocall.cpp +++ b/sdk/trts/trts_ocall.cpp @@ -37,6 +37,8 @@ #include "rts.h" #include "util.h" #include "trts_internal.h" +#include "sgx_trts.h" +#include "sgx_trts_aex.h" extern "C" sgx_status_t asm_oret(uintptr_t sp, void *ms); extern "C" sgx_status_t __morestack(const unsigned int index, void *ms); @@ -96,6 +98,15 @@ uintptr_t update_ocall_lastsp(ocall_context_t* context) sgx_status_t do_oret(void *ms) { thread_data_t *thread_data = get_thread_data(); +#ifndef SE_SIM + // If aexnotify is enabled but we disable it temporarily before EEXIT + // we need to enable it again after stack switch in oret + if(thread_data->aex_notify_flag == 1) + { + thread_data->aex_notify_flag = 0; + sgx_set_ssa_aexnotify(1); + } +#endif uintptr_t last_sp = thread_data->last_sp; ocall_context_t *context = reinterpret_cast(thread_data->last_sp); if(0 == last_sp || last_sp <= (uintptr_t)&context) diff --git a/sdk/trts/trts_util.cpp b/sdk/trts/trts_util.cpp index eca41cb60..70238c2e7 100644 --- a/sdk/trts/trts_util.cpp +++ b/sdk/trts/trts_util.cpp @@ -223,3 +223,20 @@ size_t get_xsave_size() { return (size_t)g_global_data.td_template.xsave_size; } + +int get_ssa_aexnotify() +{ + int flag = 0; + thread_data_t *thread_data = get_thread_data(); + ssa_gpr_t *ssa_gpr = NULL; + + if(thread_data == NULL) + { + return 0; + } + + ssa_gpr = reinterpret_cast(thread_data->first_ssa_gpr); + flag = ssa_gpr->aex_notify & SSA_AEXNOTIFY_MASK; + + return flag; +} diff --git a/sdk/trts/trts_util.h b/sdk/trts/trts_util.h index d1dd6b9dc..1fd11fea0 100644 --- a/sdk/trts/trts_util.h +++ b/sdk/trts/trts_util.h @@ -64,6 +64,9 @@ bool is_tcs_binding_mode(); size_t get_xsave_size(); +int get_ssa_aexnotify(); + + #ifdef __cplusplus } #endif diff --git a/sdk/trts/trts_veh.cpp b/sdk/trts/trts_veh.cpp index 2d860caa8..526fdfc70 100644 --- a/sdk/trts/trts_veh.cpp +++ b/sdk/trts/trts_veh.cpp @@ -38,6 +38,7 @@ #include "sgx_trts_exception.h" #include +#include #include "sgx_trts.h" #include "xsave.h" #include "arch.h" @@ -45,6 +46,7 @@ #include "thread_data.h" #include "global_data.h" #include "trts_internal.h" +#include "trts_mitigation.h" #include "trts_inst.h" #include "util.h" #include "trts_util.h" @@ -52,6 +54,9 @@ #include "se_cdefs.h" #include "emm_private.h" #include "sgx_mm_rt_abstraction.h" +#include "sgx_trts_aex.h" + +#include "se_memcpy.h" typedef struct _handler_node_t { uintptr_t callback; @@ -65,6 +70,11 @@ static uintptr_t g_veh_cookie = 0; sgx_mm_pfhandler_t g_mm_pfhandler = NULL; #define ENC_VEH_POINTER(x) (uintptr_t)(x) ^ g_veh_cookie #define DEC_VEH_POINTER(x) (sgx_exception_handler_t)((x) ^ g_veh_cookie) +extern int g_aexnotify_supported; +extern "C" sgx_status_t sgx_apply_mitigations(const sgx_exception_info_t *); + +extern uint16_t aex_notify_c3_cache[2048]; +extern uint8_t *__ct_mitigation_ret; // sgx_register_exception_handler() @@ -76,7 +86,6 @@ sgx_mm_pfhandler_t g_mm_pfhandler = NULL; // exception_handler - a pointer to the handler to be called. // Return Value // handler - success -// NULL - fail void *sgx_register_exception_handler(int is_first_handler, sgx_exception_handler_t exception_handler) { // initialize g_veh_cookie for the first time sgx_register_exception_handler is called. @@ -181,14 +190,99 @@ int sgx_unregister_exception_handler(void *handler) return status; } +extern "C" __attribute__((regparm(1))) void second_phase(sgx_exception_info_t *info, + void *new_sp, void *second_phase_handler_addr); + // continue_execution(sgx_exception_info_t *info): -// try to restore the thread context saved in info to current execution context. +// try to restore the thread context saved in info to current execution context. extern "C" __attribute__((regparm(1))) void continue_execution(sgx_exception_info_t *info); +extern "C" void restore_xregs(uint8_t *buf); + +extern "C" void constant_time_apply_sgxstep_mitigation_and_continue_execution(sgx_exception_info_t *info, + uintptr_t ssa_aexnotify_addr, uintptr_t stack_tickle_pages, uintptr_t code_tickle_page, uintptr_t data_tickle_page, uintptr_t c3_byte_address); + + +// apply the constant time mitigation handler +static void apply_constant_time_sgxstep_mitigation_and_continue_execution(sgx_exception_info_t *info) +{ + thread_data_t *thread_data = get_thread_data(); + uintptr_t code_tickle_page, c3_byte_address, stack_tickle_pages, data_tickle_page, + stack_base_page = ((thread_data->stack_base_addr & ~0xFFF) == 0) ? + (thread_data->stack_base_addr) - 0x1000 : + (thread_data->stack_base_addr & ~0xFFF), + stack_limit_page = thread_data->stack_limit_addr & ~0xFFF; + + // Determine which stack pages can be tickled + if (((uintptr_t)info & ~0xFFF) == stack_base_page) { + if (stack_base_page == stack_limit_page) { + // The stack is only a single page, so we tickle that page + stack_tickle_pages = stack_base_page; + } else { + // The current stack page is the base page, but there are more + // pages so we tickle the next one as well. + stack_tickle_pages = stack_base_page | 1; + } + } else { + // If the current stack page is not the base page, then it's generally + // better to also tickle the previous page. For example, the mitigation + // code and the interrupted code may have separate but adjacent stack + // pages (in this case, the interrupted code's stack frame must be on + // the page with a higher address). + stack_tickle_pages = (((uintptr_t)info & ~0xFFF) + 0x1000) | 1; + } + + // Determine which data page can be tickled. + // FIXME: This will eventually call the CTD to obtain the page. For + // now, we redundantly tickle a stack page. + data_tickle_page = stack_tickle_pages & ~1; + + // Look up the code page in the c3 cache + code_tickle_page = info->cpu_context.REG(ip) & ~0xFFF; + c3_byte_address = code_tickle_page + *(aex_notify_c3_cache + ((code_tickle_page >> 12) & 0x07FF)); + if (*(uint8_t *)c3_byte_address != 0xc3) { + uint8_t *i = (uint8_t *)code_tickle_page, *e = i + 4096; + for (; i != e && *i != 0xc3; ++i) {} + if (i == e) { // code_tickle_page does not contain a c3 byte + c3_byte_address = (uintptr_t)&__ct_mitigation_ret; + } else { + c3_byte_address = (uintptr_t)i; + *(aex_notify_c3_cache + ((code_tickle_page >> 12) & 0x07FF)) = + (uint16_t)(c3_byte_address & 0xFFF); + } + } + + // Pop an entropy byte from the entropy cache + if (--thread_data->aex_notify_entropy_remaining < 0) { + if (0 == do_rdrand(&thread_data->aex_notify_entropy_cache)) + { + thread_data->exception_flag = -1; + abort(); + } + thread_data->aex_notify_entropy_remaining = 31; + } + code_tickle_page |= thread_data->aex_notify_entropy_cache & 1; + thread_data->aex_notify_entropy_cache >>= 1; + + // There are three additional "implicit" parameters to this function: + // 1. The low-order bit of `stack_tickle_pages` is 1 if a second stack + // page should be tickled (specifically, the stack page immediately + // below the page specified in the upper bits) + // 2. The low-order bit of `code_tickle_page` is 1 if the cycle delay + // should be added to the mitigation + // 3. The low-order bit of `data_tickle_page` is 1 if `data_tickle_page` + // is writable, and therefore should be tested for write permissions + // by the mitigation + constant_time_apply_sgxstep_mitigation_and_continue_execution( + info, thread_data->first_ssa_gpr + offsetof(ssa_gpr_t, aex_notify), + stack_tickle_pages, code_tickle_page, + data_tickle_page, c3_byte_address); +} -// internal_handle_exception(sgx_exception_info_t *info): // the 2nd phrase exception handing, which traverse registered exception handlers. // if the exception can be handled, then continue execution // otherwise, throw abortion, go back to 1st phrase, and call the default handler. +// if the exception can be handled, then continue execution +// otherwise, throw abortion, go back to 1st phrase, and call the default handler. extern "C" __attribute__((regparm(1))) void internal_handle_exception(sgx_exception_info_t *info) { int status = EXCEPTION_CONTINUE_SEARCH; @@ -199,6 +293,14 @@ extern "C" __attribute__((regparm(1))) void internal_handle_exception(sgx_except uintptr_t *ntmp = NULL; uintptr_t xsp = 0; + // AEX Notify allows this handler to handle interrupts + if (info == NULL) { + goto failed_end; + } + else if (info->exception_valid == 0) { + goto exception_handling_end; + } + if (thread_data->exception_flag < 0) goto failed_end; thread_data->exception_flag++; @@ -211,7 +313,7 @@ extern "C" __attribute__((regparm(1))) void internal_handle_exception(sgx_except if(SGX_MM_EXCEPTION_CONTINUE_EXECUTION == g_mm_pfhandler(pfinfo)) { //instruction triggering the exception will be executed again. - continue_execution(info); + goto exception_handling_end; } //restore old flag, and fall thru thread_data->exception_flag++; @@ -234,8 +336,7 @@ extern "C" __attribute__((regparm(1))) void internal_handle_exception(sgx_except //exception cannot be handled thread_data->exception_flag = -1; - //instruction triggering the exception will be executed again. - continue_execution(info); + goto exception_handling_end; } // The customer handler may never return, use alloca instead of malloc if ((nhead = (uintptr_t *)alloca(size)) == NULL) @@ -288,9 +389,22 @@ extern "C" __attribute__((regparm(1))) void internal_handle_exception(sgx_except thread_data->exception_flag = -1; } +exception_handling_end: //instruction triggering the exception will be executed again. - continue_execution(info); - + if(info->do_aex_mitigation == 1) + { + // apply customized mitigation handlers + // Note that we don't enable AEX-notify for customized mitigation handler + sgx_apply_mitigations(info); + restore_xregs(info->xsave_area); + apply_constant_time_sgxstep_mitigation_and_continue_execution(info); + } + else + { + //instruction triggering the exception will be executed again. + restore_xregs(info->xsave_area); + continue_execution(info); + } failed_end: thread_data->exception_flag = -1; // mark the current exception cannot be handled abort(); // throw abortion @@ -316,7 +430,6 @@ extern "C" const char Leverifyreport2_inst; // the pointer of TCS // Return Value // none zero - success -// 0 - fail extern "C" sgx_status_t trts_handle_exception(void *tcs) { thread_data_t *thread_data = get_thread_data(); @@ -324,6 +437,8 @@ extern "C" sgx_status_t trts_handle_exception(void *tcs) sgx_exception_info_t *info = NULL; uintptr_t sp_u, sp, *new_sp = NULL; size_t size = 0; + uint8_t *ssa_xsave = NULL; + bool is_exception_handled = false; if ((thread_data == NULL) || (tcs == NULL)) goto default_handler; if (check_static_stack_canary(tcs) != 0) @@ -375,10 +490,17 @@ extern "C" sgx_status_t trts_handle_exception(void *tcs) // after the return addr and includes func's arguments size += RED_ZONE_SIZE; + // Add space for reserved slot for GPRs that will be used by mitigation + // assembly code RIP, RAX, RBX, RCX, RDX, RBP, RSI, RDI Saved flags, 1st + // D/QWORD of red zone, &SSA[0].GPRSGX.AEXNOTIFY, stack_tickle_pages, + // code_tickle_page, data_tickle_page, c3_byte_address + size += RSVD_SIZE_OF_MITIGATION_STACK_AREA; + // decrease the stack to give space for info size += sizeof(sgx_exception_info_t); + size += thread_data->xsave_size; sp -= size; - sp = sp & ~0xF; + sp = sp & ~0x3F; // check the decreased sp to make sure it is in the trusted stack range if(!is_stack_addr((void *)sp, size)) @@ -396,28 +518,32 @@ extern "C" sgx_status_t trts_handle_exception(void *tcs) set_enclave_state(ENCLAVE_CRASHED); return SGX_ERROR_STACK_OVERRUN; } - - // sp is within limit_addr and commit_addr, currently only SGX 2.0 under hardware mode will enter this branch. - if((size_t)sp < thread_data->stack_commit_addr) - { - int ret = -1; - size_t page_aligned_delta = 0; + + if(ssa_gpr->exit_info.valid == 1) + { /* try to allocate memory dynamically */ - page_aligned_delta = ROUND_TO(thread_data->stack_commit_addr - (size_t)sp, SE_PAGE_SIZE); - if ((thread_data->stack_commit_addr > page_aligned_delta) - && ((thread_data->stack_commit_addr - page_aligned_delta) >= thread_data->stack_limit_addr)) - { - ret = expand_stack_by_pages((void *)(thread_data->stack_commit_addr - page_aligned_delta), (page_aligned_delta >> SE_PAGE_SHIFT)); - } - if (ret == 0) - { - thread_data->stack_commit_addr -= page_aligned_delta; - return SGX_SUCCESS; - } - else - { - set_enclave_state(ENCLAVE_CRASHED); - return SGX_ERROR_STACK_OVERRUN; + if((size_t)sp < thread_data->stack_commit_addr) + { + int ret = -1; + size_t page_aligned_delta = 0; + /* try to allocate memory dynamically */ + page_aligned_delta = ROUND_TO(thread_data->stack_commit_addr - (size_t)sp, SE_PAGE_SIZE); + if ((thread_data->stack_commit_addr > page_aligned_delta) + && ((thread_data->stack_commit_addr - page_aligned_delta) >= thread_data->stack_limit_addr)) + { + ret = expand_stack_by_pages((void *)(thread_data->stack_commit_addr - page_aligned_delta), (page_aligned_delta >> SE_PAGE_SHIFT)); + } + if (ret == 0) + { + thread_data->stack_commit_addr -= page_aligned_delta; + is_exception_handled = true; // The exception has been handled in the 1st phase exception handler + goto handler_end; + } + else + { + set_enclave_state(ENCLAVE_CRASHED); + return SGX_ERROR_STACK_OVERRUN; + } } } if (size_t(&Lereport_inst) == ssa_gpr->REG(ip) && SE_EREPORT == ssa_gpr->REG(ax)) @@ -425,7 +551,8 @@ extern "C" sgx_status_t trts_handle_exception(void *tcs) // Handle the exception raised by EREPORT instruction ssa_gpr->REG(ip) += 3; // Skip ENCLU, which is always a 3-byte instruction ssa_gpr->REG(flags) |= 1; // Set CF to indicate error condition, see implementation of do_report() - return SGX_SUCCESS; + is_exception_handled = true; // The exception has been handled in the 1st phase exception handler. + goto handler_end; } if (size_t(&Leverifyreport2_inst) == ssa_gpr->REG(ip) && SE_EVERIFYREPORT2 == ssa_gpr->REG(ax)) { @@ -433,17 +560,24 @@ extern "C" sgx_status_t trts_handle_exception(void *tcs) ssa_gpr->REG(ip) += 3; // Skip ENCLU, which is always a 3-byte instruction ssa_gpr->REG(flags) |= 64; // Set ZF to indicate error condition, see implementation of do_everifyreport2() ssa_gpr->REG(ax) = EVERIFYREPORT2_INVALID_LEAF; - return SGX_SUCCESS; + is_exception_handled = true; // The exception has been handled in the 1st phase exception handler. + goto handler_end; } - if(ssa_gpr->exit_info.valid != 1) - { // exception handlers are not allowed to call in a non-exception state + if(g_aexnotify_supported == 0 && ssa_gpr->exit_info.valid != 1) + { + // exception handlers are not allowed to call in a non-exception state + // add aexnotify check here to skip the case of interrupts goto default_handler; } - +handler_end: // initialize the info with SSA[0] + info->exception_valid = is_exception_handled ? 0 : ssa_gpr->exit_info.valid; info->exception_vector = (sgx_exception_vector_t)ssa_gpr->exit_info.vector; info->exception_type = (sgx_exception_type_t)ssa_gpr->exit_info.exit_type; + info->xsave_size = thread_data->xsave_size; + ssa_xsave = (uint8_t*)ROUND_TO_PAGE(thread_data->first_ssa_gpr) - ROUND_TO_PAGE(get_xsave_size() + sizeof(ssa_gpr_t)); + memcpy_s(info->xsave_area, info->xsave_size, ssa_xsave, info->xsave_size); info->cpu_context.REG(ax) = ssa_gpr->REG(ax); info->cpu_context.REG(cx) = ssa_gpr->REG(cx); @@ -474,16 +608,41 @@ extern "C" sgx_status_t trts_handle_exception(void *tcs) info->exinfo.error_code = exinfo->errcd; } new_sp = (uintptr_t *)sp; - ssa_gpr->REG(ip) = (size_t)internal_handle_exception; // prepare the ip for 2nd phrase handling - ssa_gpr->REG(sp) = (size_t)new_sp; // new stack for internal_handle_exception - ssa_gpr->REG(ax) = (size_t)info; // 1st parameter (info) for LINUX32 - ssa_gpr->REG(di) = (size_t)info; // 1st parameter (info) for LINUX64, LINUX32 also uses it while restoring the context + if(!(g_aexnotify_supported || is_exception_handled == true)) + { + // Two cases that we don't need to run below code: + // 1. AEXNotify is enabled + // 2. stack expansion or EREPORT exception. We have handled it + // in the first phase and we should not change anything in the ssa_gpr + // + ssa_gpr->REG(ip) = (size_t)internal_handle_exception; // prepare the ip for 2nd phrase handling + ssa_gpr->REG(sp) = (size_t)new_sp; // new stack for internal_handle_exception + ssa_gpr->REG(ax) = (size_t)info; // 1st parameter (info) for LINUX32 + ssa_gpr->REG(di) = (size_t)info; // 1st parameter (info) for LINUX64, LINUX32 also uses it while restoring the context + } *new_sp = info->cpu_context.REG(ip); // for debugger to get call trace - - //mark valid to 0 to prevent eenter again - ssa_gpr->exit_info.valid = 0; - - return SGX_SUCCESS; +#ifndef SE_SIM + if(g_aexnotify_supported) + { + info->do_aex_mitigation = get_ssa_aexnotify(); + void *first_ssa_xsave = reinterpret_cast(thread_data->first_ssa_xsave); + restore_xregs((uint8_t*)first_ssa_xsave); + // With AEX Notify, we don't need to do a return here (phase-1 handler). + // Instead, we jump to internal_handle_exception (phase-2 handler). + // We should not make a function call either, because ideally the return at + // the end of phase-2 handler should directly return to the interrupted enclave code. + // Disable aexnotify before EDCSSA + if(info->do_aex_mitigation == 1) + { + sgx_set_ssa_aexnotify(0); + } + second_phase(info, new_sp, (void *)internal_handle_exception); + } + else +#endif + { + return SGX_SUCCESS; + } default_handler: set_enclave_state(ENCLAVE_CRASHED); diff --git a/sdk/ttls/Makefile b/sdk/ttls/Makefile index 8b5d9ac4b..3b41a05df 100644 --- a/sdk/ttls/Makefile +++ b/sdk/ttls/Makefile @@ -57,6 +57,7 @@ INCLUDE += -I$(COMMON_DIR)/inc/tlibc \ -I$(SGX_QV_PATH)/dcap_tvl \ -include./tsgxsslio.h \ -I$(PREBUILT_OPENSSL_PATH)/inc +INCLUDE_TDX := $(filter-out -I$(PREBUILT_OPENSSL_PATH)/inc,$(INCLUDE)) CXXFLAGS_TDX := $(CXXFLAGS) $(COMMON_FLAGS) $(COMMON_LDFLAGS) -fPIC -Werror -Wno-unused-parameter -g CXXFLAGS += $(COMMON_FLAGS) $(ENCLAVE_CXXFLAGS) @@ -93,7 +94,7 @@ $(OBJ): $(TLSNAME)_t.h $(OBJ): %.o :%.cpp $(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@ $(OBJ_TDX): tdx_%.o :%.cpp - $(CXX) $(CXXFLAGS_TDX) $(INCLUDE) -DTDX_ENV -c $< -o $@ + $(CXX) $(CXXFLAGS_TDX) $(INCLUDE_TDX) -DTDX_ENV -c $< -o $@ .PHONY: clean clean: diff --git a/sdk/ttls/ttls.cpp b/sdk/ttls/ttls.cpp index a48d58c82..cf345725e 100644 --- a/sdk/ttls/ttls.cpp +++ b/sdk/ttls/ttls.cpp @@ -81,7 +81,6 @@ extern "C" quote3_error_t tee_get_certificate_with_evidence( #else tdx_attest_error_t tdx_ret = TDX_ATTEST_ERROR_UNEXPECTED; tdx_uuid_t selected_att_key_id = { 0 }; - SHA256_CTX sha_handle; tdx_report_data_t report_data = { 0 }; #endif sgx_status_t ret = SGX_ERROR_UNEXPECTED; @@ -163,17 +162,7 @@ extern "C" quote3_error_t tee_get_certificate_with_evidence( if (func_ret != SGX_QL_SUCCESS) break; #else - if (!SHA256_Init(&sha_handle)) { - func_ret = SGX_QL_ERROR_UNEXPECTED; - break; - } - - if (!SHA256_Update(&sha_handle, p_pub_key, public_key_size)) { - func_ret = SGX_QL_ERROR_UNEXPECTED; - break; - } - - if (!SHA256_Final(reinterpret_cast(&report_data), &sha_handle)) { + if (!SHA256(p_pub_key, public_key_size, reinterpret_cast(&report_data))) { func_ret = SGX_QL_ERROR_UNEXPECTED; break; }