| 1 | /******************************************************************************* |
| 2 | Copyright (c) 2022-2024, Intel Corporation |
| 3 | |
| 4 | Redistribution and use in source and binary forms, with or without |
| 5 | modification, are permitted provided that the following conditions are met: |
| 6 | |
| 7 | * Redistributions of source code must retain the above copyright notice, |
| 8 | this list of conditions and the following disclaimer. |
| 9 | * Redistributions in binary form must reproduce the above copyright |
| 10 | notice, this list of conditions and the following disclaimer in the |
| 11 | documentation and/or other materials provided with the distribution. |
| 12 | * Neither the name of Intel Corporation nor the names of its contributors |
| 13 | may be used to endorse or promote products derived from this software |
| 14 | without specific prior written permission. |
| 15 | |
| 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | *******************************************************************************/ |
| 27 | |
| 28 | #include "include/sha_mb_mgr.h"cxx . . $ `<file>/lib/include/sha_mb_mgr.h`/ |
| 29 | #include "include/arch_sse_type2.h"cxx . . $ `<file>/lib/include/arch_sse_type2.h`/ |
| 30 | |
| 31 | /* ========================================================================== */ |
| 32 | /* |
| 33 | * SHA1-NI MB API |
| 34 | */ |
| 35 | |
| 36 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! |
| 37 | IMB_JOBcxx . . $ IMB_JOB# * |
| 38 | submit_job_sha1_ni_ssecxx . . $ submit_job_sha1_ni_sse(33cbba0f3776db3e).(MB_MGR_SHA_1_OOOcxx . . $ MB_MGR_SHA_1_OOO# *state, IMB_JOBcxx . . $ IMB_JOB# *job) |
| 39 | { |
| 40 | return submit_flush_job_sha_1cxx . . $ submit_flush_job_sha_1(6a6318e00859b8bc).(state, job, 2, 1, 1, IMB_SHA1_BLOCK_SIZEcxx . . $ `lib/intel-ipsec-mb.h:139:9`!, SHA1_PAD_SIZEcxx . . $ `lib/include/constants.h:37:9`!, |
| 41 | call_sha1_ni_x2_sse_from_ccxx . . $ call_sha1_ni_x2_sse_from_c(3dff6a17f05ca043)., 1); |
| 42 | } |
| 43 | |
| 44 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! |
| 45 | IMB_JOBcxx . . $ IMB_JOB# * |
| 46 | flush_job_sha1_ni_ssecxx . . $ flush_job_sha1_ni_sse(33cbba0f3776db3e).(MB_MGR_SHA_1_OOOcxx . . $ MB_MGR_SHA_1_OOO# *state, IMB_JOBcxx . . $ IMB_JOB# *job) |
| 47 | { |
| 48 | return submit_flush_job_sha_1cxx . . $ submit_flush_job_sha_1(6a6318e00859b8bc).(state, job, 2, 0, 1, IMB_SHA1_BLOCK_SIZEcxx . . $ `lib/intel-ipsec-mb.h:139:9`!, SHA1_PAD_SIZEcxx . . $ `lib/include/constants.h:37:9`!, |
| 49 | call_sha1_ni_x2_sse_from_ccxx . . $ call_sha1_ni_x2_sse_from_c(3dff6a17f05ca043)., 1); |
| 50 | } |
| 51 | |
| 52 | /* ========================================================================== */ |
| 53 | /* |
| 54 | * SHA224-NI MB API |
| 55 | */ |
| 56 | |
| 57 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! |
| 58 | IMB_JOBcxx . . $ IMB_JOB# * |
| 59 | submit_job_sha224_ni_ssecxx . . $ submit_job_sha224_ni_sse(fc272b4cad21cbe3).(MB_MGR_SHA_256_OOOcxx . . $ MB_MGR_SHA_256_OOO# *state, IMB_JOBcxx . . $ IMB_JOB# *job) |
| 60 | { |
| 61 | return submit_flush_job_sha_256cxx . . $ submit_flush_job_sha_256(f2eb5aa91e4bac16).(state, job, 2, 1, 224, IMB_SHA_256_BLOCK_SIZEcxx . . $ `lib/intel-ipsec-mb.h:141:9`!, |
| 62 | SHA224_PAD_SIZEcxx . . $ `lib/include/constants.h:59:9`!, call_sha256_ni_x2_sse_from_ccxx . . $ call_sha256_ni_x2_sse_from_c(c4991ee9357ba514)., 1); |
| 63 | } |
| 64 | |
| 65 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! |
| 66 | IMB_JOBcxx . . $ IMB_JOB# * |
| 67 | flush_job_sha224_ni_ssecxx . . $ flush_job_sha224_ni_sse(fc272b4cad21cbe3).(MB_MGR_SHA_256_OOOcxx . . $ MB_MGR_SHA_256_OOO# *state, IMB_JOBcxx . . $ IMB_JOB# *job) |
| 68 | { |
| 69 | return submit_flush_job_sha_256cxx . . $ submit_flush_job_sha_256(f2eb5aa91e4bac16).(state, job, 2, 0, 224, IMB_SHA_256_BLOCK_SIZEcxx . . $ `lib/intel-ipsec-mb.h:141:9`!, |
| 70 | SHA224_PAD_SIZEcxx . . $ `lib/include/constants.h:59:9`!, call_sha256_ni_x2_sse_from_ccxx . . $ call_sha256_ni_x2_sse_from_c(c4991ee9357ba514)., 1); |
| 71 | } |
| 72 | |
| 73 | /* ========================================================================== */ |
| 74 | /* |
| 75 | * SHA256-NI MB API |
| 76 | */ |
| 77 | |
| 78 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! |
| 79 | IMB_JOBcxx . . $ IMB_JOB# * |
| 80 | submit_job_sha256_ni_ssecxx . . $ submit_job_sha256_ni_sse(fc272b4cad21cbe3).(MB_MGR_SHA_256_OOOcxx . . $ MB_MGR_SHA_256_OOO# *state, IMB_JOBcxx . . $ IMB_JOB# *job) |
| 81 | { |
| 82 | return submit_flush_job_sha_256cxx . . $ submit_flush_job_sha_256(f2eb5aa91e4bac16).(state, job, 2, 1, 256, IMB_SHA_256_BLOCK_SIZEcxx . . $ `lib/intel-ipsec-mb.h:141:9`!, |
| 83 | SHA256_PAD_SIZEcxx . . $ `lib/include/constants.h:48:9`!, call_sha256_ni_x2_sse_from_ccxx . . $ call_sha256_ni_x2_sse_from_c(c4991ee9357ba514)., 1); |
| 84 | } |
| 85 | |
| 86 | IMB_DLL_LOCALcxx . . $ `lib/intel-ipsec-mb.h:55:9`! |
| 87 | IMB_JOBcxx . . $ IMB_JOB# * |
| 88 | flush_job_sha256_ni_ssecxx . . $ flush_job_sha256_ni_sse(fc272b4cad21cbe3).(MB_MGR_SHA_256_OOOcxx . . $ MB_MGR_SHA_256_OOO# *state, IMB_JOBcxx . . $ IMB_JOB# *job) |
| 89 | { |
| 90 | return submit_flush_job_sha_256cxx . . $ submit_flush_job_sha_256(f2eb5aa91e4bac16).(state, job, 2, 0, 256, IMB_SHA_256_BLOCK_SIZEcxx . . $ `lib/intel-ipsec-mb.h:141:9`!, |
| 91 | SHA256_PAD_SIZEcxx . . $ `lib/include/constants.h:48:9`!, call_sha256_ni_x2_sse_from_ccxx . . $ call_sha256_ni_x2_sse_from_c(c4991ee9357ba514)., 1); |
| 92 | } |