From c3d9b40d45e29a6454515c358998cbad6d7993ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meusel?= Date: Mon, 5 Aug 2024 15:57:49 +0200 Subject: [PATCH] add span-based load/store methods for SIMD_4x32 --- src/lib/utils/simd/simd_32.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/utils/simd/simd_32.h b/src/lib/utils/simd/simd_32.h index 51ae3b934f6..e6f28b233b7 100644 --- a/src/lib/utils/simd/simd_32.h +++ b/src/lib/utils/simd/simd_32.h @@ -10,6 +10,8 @@ #include +#include + #if defined(BOTAN_TARGET_SUPPORTS_SSE2) #include #define BOTAN_SIMD_USE_SSE2 @@ -186,6 +188,10 @@ class SIMD_4x32 final { #endif } + static SIMD_4x32 load_le(std::span in) { return SIMD_4x32::load_le(in.data()); } + + static SIMD_4x32 load_be(std::span in) { return SIMD_4x32::load_be(in.data()); } + void store_le(uint32_t out[4]) const noexcept { this->store_le(reinterpret_cast(out)); } void store_be(uint32_t out[4]) const noexcept { this->store_be(reinterpret_cast(out)); } @@ -246,6 +252,10 @@ class SIMD_4x32 final { #endif } + void store_be(std::span out) const { this->store_be(out.data()); } + + void store_le(std::span out) const { this->store_le(out.data()); } + /* * This is used for SHA-2/SHACAL2 */