diff --git a/lib/Makefile b/lib/Makefile index ab8cc65ba56379fa1e860b4647c0d4b435464579..b54518d9afe882d41ad94e84cfb0844f8c02a51d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -368,7 +368,8 @@ c_lib_objs := \ mb_mgr_snow3g_submit_flush_aarch64_sve256.o \ snow3g_aarch64_sve256.o \ cipher_suite_id.o \ - ooo_mgr_reset.o + ooo_mgr_reset.o \ + hmac_ipad_opad_aarch64.o asm_generic_lib_objs := \ lookup_16x8bit_neon.o \ snow3g_impl_aarch64_neon.o \ diff --git a/lib/aarch64/hmac_ipad_opad_aarch64.c b/lib/aarch64/hmac_ipad_opad_aarch64.c new file mode 100644 index 0000000000000000000000000000000000000000..545526c6c5dd34ef5fe7a9536f5fb736cb3f175d --- /dev/null +++ b/lib/aarch64/hmac_ipad_opad_aarch64.c @@ -0,0 +1,48 @@ +/********************************************************************** + Copyright(c) 2024 Arm Corporation All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Arm Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING 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 + +IMB_DLL_EXPORT +__attribute((noreturn)) void +imb_hmac_ipad_opad(IMB_MGR *mb_mgr, const IMB_HASH_ALG sha_type, + const void *pkey, const size_t key_len, + void *ipad_hash, void *opad_hash) +{ + /* + * This method isn't supported on AArch64. However, it is stubbed to + * ensure ABI compatibility with the x86_64 ipsec-mb library. + * + * As this should never be called, it crashes. + */ + fprintf(stderr, "imb_hac_ipad_opad() is unimplemented for AArch64.\n"); + abort(); +}