1370b324cSopenharmony_ci/* Sha256Opt.c -- SHA-256 optimized code for SHA-256 hardware instructions 2370b324cSopenharmony_ci2023-04-02 : Igor Pavlov : Public domain */ 3370b324cSopenharmony_ci 4370b324cSopenharmony_ci#include "Precomp.h" 5370b324cSopenharmony_ci#include "Compiler.h" 6370b324cSopenharmony_ci#include "CpuArch.h" 7370b324cSopenharmony_ci 8370b324cSopenharmony_ci#ifndef _IS_TRY_USE_HW_SHA 9370b324cSopenharmony_ci#define _IS_TRY_USE_HW_SHA 1 10370b324cSopenharmony_ci#endif 11370b324cSopenharmony_ci 12370b324cSopenharmony_ci#if defined(_MSC_VER) 13370b324cSopenharmony_ci#if (_MSC_VER < 1900) && (_MSC_VER >= 1200) 14370b324cSopenharmony_ci// #define USE_MY_MM 15370b324cSopenharmony_ci#endif 16370b324cSopenharmony_ci#endif 17370b324cSopenharmony_ci 18370b324cSopenharmony_ci#if (_IS_TRY_USE_HW_SHA) && defined(MY_CPU_X86_OR_AMD64) 19370b324cSopenharmony_ci #if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1600) // fix that check 20370b324cSopenharmony_ci #define USE_HW_SHA 21370b324cSopenharmony_ci #elif defined(Z7_LLVM_CLANG_VERSION) && (Z7_LLVM_CLANG_VERSION >= 30800) \ 22370b324cSopenharmony_ci || defined(Z7_APPLE_CLANG_VERSION) && (Z7_APPLE_CLANG_VERSION >= 50100) \ 23370b324cSopenharmony_ci || defined(Z7_GCC_VERSION) && (Z7_GCC_VERSION >= 40900) 24370b324cSopenharmony_ci #define USE_HW_SHA 25370b324cSopenharmony_ci #if !defined(_INTEL_COMPILER) 26370b324cSopenharmony_ci // icc defines __GNUC__, but icc doesn't support __attribute__(__target__) 27370b324cSopenharmony_ci #if !defined(__SHA__) || !defined(__SSSE3__) 28370b324cSopenharmony_ci #define ATTRIB_SHA __attribute__((__target__("sha,ssse3"))) 29370b324cSopenharmony_ci #endif 30370b324cSopenharmony_ci #endif 31370b324cSopenharmony_ci #elif defined(_MSC_VER) 32370b324cSopenharmony_ci #ifdef USE_MY_MM 33370b324cSopenharmony_ci #define USE_VER_MIN 1300 34370b324cSopenharmony_ci #else 35370b324cSopenharmony_ci #define USE_VER_MIN 1900 36370b324cSopenharmony_ci #endif 37370b324cSopenharmony_ci #if (_MSC_VER >= USE_VER_MIN) 38370b324cSopenharmony_ci #define USE_HW_SHA 39370b324cSopenharmony_ci #endif 40370b324cSopenharmony_ci #endif 41370b324cSopenharmony_ci// #endif // MY_CPU_X86_OR_AMD64 42370b324cSopenharmony_ci 43370b324cSopenharmony_ci#ifdef USE_HW_SHA 44370b324cSopenharmony_ci 45370b324cSopenharmony_ci// #pragma message("Sha256 HW") 46370b324cSopenharmony_ci 47370b324cSopenharmony_ci// sse/sse2/ssse3: 48370b324cSopenharmony_ci#include <tmmintrin.h> 49370b324cSopenharmony_ci// sha*: 50370b324cSopenharmony_ci#include <immintrin.h> 51370b324cSopenharmony_ci 52370b324cSopenharmony_ci#if defined (__clang__) && defined(_MSC_VER) 53370b324cSopenharmony_ci // #if !defined(__SSSE3__) 54370b324cSopenharmony_ci // #endif 55370b324cSopenharmony_ci #if !defined(__SHA__) 56370b324cSopenharmony_ci #include <shaintrin.h> 57370b324cSopenharmony_ci #endif 58370b324cSopenharmony_ci#else 59370b324cSopenharmony_ci 60370b324cSopenharmony_ci#ifdef USE_MY_MM 61370b324cSopenharmony_ci#include "My_mm.h" 62370b324cSopenharmony_ci#endif 63370b324cSopenharmony_ci 64370b324cSopenharmony_ci#endif 65370b324cSopenharmony_ci 66370b324cSopenharmony_ci/* 67370b324cSopenharmony_ciSHA256 uses: 68370b324cSopenharmony_ciSSE2: 69370b324cSopenharmony_ci _mm_loadu_si128 70370b324cSopenharmony_ci _mm_storeu_si128 71370b324cSopenharmony_ci _mm_set_epi32 72370b324cSopenharmony_ci _mm_add_epi32 73370b324cSopenharmony_ci _mm_shuffle_epi32 / pshufd 74370b324cSopenharmony_ci 75370b324cSopenharmony_ci 76370b324cSopenharmony_ci 77370b324cSopenharmony_ciSSSE3: 78370b324cSopenharmony_ci _mm_shuffle_epi8 / pshufb 79370b324cSopenharmony_ci _mm_alignr_epi8 80370b324cSopenharmony_ciSHA: 81370b324cSopenharmony_ci _mm_sha256* 82370b324cSopenharmony_ci*/ 83370b324cSopenharmony_ci 84370b324cSopenharmony_ci// K array must be aligned for 16-bytes at least. 85370b324cSopenharmony_ci// The compiler can look align attribute and selects 86370b324cSopenharmony_ci// movdqu - for code without align attribute 87370b324cSopenharmony_ci// movdqa - for code with align attribute 88370b324cSopenharmony_ciextern 89370b324cSopenharmony_ciMY_ALIGN(64) 90370b324cSopenharmony_ciconst UInt32 SHA256_K_ARRAY[64]; 91370b324cSopenharmony_ci 92370b324cSopenharmony_ci#define K SHA256_K_ARRAY 93370b324cSopenharmony_ci 94370b324cSopenharmony_ci 95370b324cSopenharmony_ci#define ADD_EPI32(dest, src) dest = _mm_add_epi32(dest, src); 96370b324cSopenharmony_ci#define SHA256_MSG1(dest, src) dest = _mm_sha256msg1_epu32(dest, src); 97370b324cSopenharmony_ci#define SHA25G_MSG2(dest, src) dest = _mm_sha256msg2_epu32(dest, src); 98370b324cSopenharmony_ci 99370b324cSopenharmony_ci 100370b324cSopenharmony_ci#define LOAD_SHUFFLE(m, k) \ 101370b324cSopenharmony_ci m = _mm_loadu_si128((const __m128i *)(const void *)(data + (k) * 16)); \ 102370b324cSopenharmony_ci m = _mm_shuffle_epi8(m, mask); \ 103370b324cSopenharmony_ci 104370b324cSopenharmony_ci#define SM1(g0, g1, g2, g3) \ 105370b324cSopenharmony_ci SHA256_MSG1(g3, g0); \ 106370b324cSopenharmony_ci 107370b324cSopenharmony_ci#define SM2(g0, g1, g2, g3) \ 108370b324cSopenharmony_ci tmp = _mm_alignr_epi8(g1, g0, 4); \ 109370b324cSopenharmony_ci ADD_EPI32(g2, tmp) \ 110370b324cSopenharmony_ci SHA25G_MSG2(g2, g1); \ 111370b324cSopenharmony_ci 112370b324cSopenharmony_ci// #define LS0(k, g0, g1, g2, g3) LOAD_SHUFFLE(g0, k) 113370b324cSopenharmony_ci// #define LS1(k, g0, g1, g2, g3) LOAD_SHUFFLE(g1, k+1) 114370b324cSopenharmony_ci 115370b324cSopenharmony_ci 116370b324cSopenharmony_ci#define NNN(g0, g1, g2, g3) 117370b324cSopenharmony_ci 118370b324cSopenharmony_ci 119370b324cSopenharmony_ci#define RND2(t0, t1) \ 120370b324cSopenharmony_ci t0 = _mm_sha256rnds2_epu32(t0, t1, msg); 121370b324cSopenharmony_ci 122370b324cSopenharmony_ci#define RND2_0(m, k) \ 123370b324cSopenharmony_ci msg = _mm_add_epi32(m, *(const __m128i *) (const void *) &K[(k) * 4]); \ 124370b324cSopenharmony_ci RND2(state0, state1); \ 125370b324cSopenharmony_ci msg = _mm_shuffle_epi32(msg, 0x0E); \ 126370b324cSopenharmony_ci 127370b324cSopenharmony_ci 128370b324cSopenharmony_ci#define RND2_1 \ 129370b324cSopenharmony_ci RND2(state1, state0); \ 130370b324cSopenharmony_ci 131370b324cSopenharmony_ci 132370b324cSopenharmony_ci// We use scheme with 3 rounds ahead for SHA256_MSG1 / 2 rounds ahead for SHA256_MSG2 133370b324cSopenharmony_ci 134370b324cSopenharmony_ci#define R4(k, g0, g1, g2, g3, OP0, OP1) \ 135370b324cSopenharmony_ci RND2_0(g0, k) \ 136370b324cSopenharmony_ci OP0(g0, g1, g2, g3) \ 137370b324cSopenharmony_ci RND2_1 \ 138370b324cSopenharmony_ci OP1(g0, g1, g2, g3) \ 139370b324cSopenharmony_ci 140370b324cSopenharmony_ci#define R16(k, OP0, OP1, OP2, OP3, OP4, OP5, OP6, OP7) \ 141370b324cSopenharmony_ci R4 ( (k)*4+0, m0,m1,m2,m3, OP0, OP1 ) \ 142370b324cSopenharmony_ci R4 ( (k)*4+1, m1,m2,m3,m0, OP2, OP3 ) \ 143370b324cSopenharmony_ci R4 ( (k)*4+2, m2,m3,m0,m1, OP4, OP5 ) \ 144370b324cSopenharmony_ci R4 ( (k)*4+3, m3,m0,m1,m2, OP6, OP7 ) \ 145370b324cSopenharmony_ci 146370b324cSopenharmony_ci#define PREPARE_STATE \ 147370b324cSopenharmony_ci tmp = _mm_shuffle_epi32(state0, 0x1B); /* abcd */ \ 148370b324cSopenharmony_ci state0 = _mm_shuffle_epi32(state1, 0x1B); /* efgh */ \ 149370b324cSopenharmony_ci state1 = state0; \ 150370b324cSopenharmony_ci state0 = _mm_unpacklo_epi64(state0, tmp); /* cdgh */ \ 151370b324cSopenharmony_ci state1 = _mm_unpackhi_epi64(state1, tmp); /* abef */ \ 152370b324cSopenharmony_ci 153370b324cSopenharmony_ci 154370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_t numBlocks); 155370b324cSopenharmony_ci#ifdef ATTRIB_SHA 156370b324cSopenharmony_ciATTRIB_SHA 157370b324cSopenharmony_ci#endif 158370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_t numBlocks) 159370b324cSopenharmony_ci{ 160370b324cSopenharmony_ci const __m128i mask = _mm_set_epi32(0x0c0d0e0f, 0x08090a0b, 0x04050607, 0x00010203); 161370b324cSopenharmony_ci __m128i tmp; 162370b324cSopenharmony_ci __m128i state0, state1; 163370b324cSopenharmony_ci 164370b324cSopenharmony_ci if (numBlocks == 0) 165370b324cSopenharmony_ci return; 166370b324cSopenharmony_ci 167370b324cSopenharmony_ci state0 = _mm_loadu_si128((const __m128i *) (const void *) &state[0]); 168370b324cSopenharmony_ci state1 = _mm_loadu_si128((const __m128i *) (const void *) &state[4]); 169370b324cSopenharmony_ci 170370b324cSopenharmony_ci PREPARE_STATE 171370b324cSopenharmony_ci 172370b324cSopenharmony_ci do 173370b324cSopenharmony_ci { 174370b324cSopenharmony_ci __m128i state0_save, state1_save; 175370b324cSopenharmony_ci __m128i m0, m1, m2, m3; 176370b324cSopenharmony_ci __m128i msg; 177370b324cSopenharmony_ci // #define msg tmp 178370b324cSopenharmony_ci 179370b324cSopenharmony_ci state0_save = state0; 180370b324cSopenharmony_ci state1_save = state1; 181370b324cSopenharmony_ci 182370b324cSopenharmony_ci LOAD_SHUFFLE (m0, 0) 183370b324cSopenharmony_ci LOAD_SHUFFLE (m1, 1) 184370b324cSopenharmony_ci LOAD_SHUFFLE (m2, 2) 185370b324cSopenharmony_ci LOAD_SHUFFLE (m3, 3) 186370b324cSopenharmony_ci 187370b324cSopenharmony_ci 188370b324cSopenharmony_ci 189370b324cSopenharmony_ci R16 ( 0, NNN, NNN, SM1, NNN, SM1, SM2, SM1, SM2 ) 190370b324cSopenharmony_ci R16 ( 1, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ) 191370b324cSopenharmony_ci R16 ( 2, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ) 192370b324cSopenharmony_ci R16 ( 3, SM1, SM2, NNN, SM2, NNN, NNN, NNN, NNN ) 193370b324cSopenharmony_ci 194370b324cSopenharmony_ci ADD_EPI32(state0, state0_save) 195370b324cSopenharmony_ci ADD_EPI32(state1, state1_save) 196370b324cSopenharmony_ci 197370b324cSopenharmony_ci data += 64; 198370b324cSopenharmony_ci } 199370b324cSopenharmony_ci while (--numBlocks); 200370b324cSopenharmony_ci 201370b324cSopenharmony_ci PREPARE_STATE 202370b324cSopenharmony_ci 203370b324cSopenharmony_ci _mm_storeu_si128((__m128i *) (void *) &state[0], state0); 204370b324cSopenharmony_ci _mm_storeu_si128((__m128i *) (void *) &state[4], state1); 205370b324cSopenharmony_ci} 206370b324cSopenharmony_ci 207370b324cSopenharmony_ci#endif // USE_HW_SHA 208370b324cSopenharmony_ci 209370b324cSopenharmony_ci#elif (_IS_TRY_USE_HW_SHA) && defined(MY_CPU_ARM64) 210370b324cSopenharmony_ci 211370b324cSopenharmony_ci #if defined(__clang__) 212370b324cSopenharmony_ci #if (__clang_major__ >= 8) && (!defined(_MSC_VER)) // fix that check 213370b324cSopenharmony_ci #define USE_HW_SHA 214370b324cSopenharmony_ci #endif 215370b324cSopenharmony_ci #elif defined(__GNUC__) 216370b324cSopenharmony_ci #if (__GNUC__ >= 6) // fix that check 217370b324cSopenharmony_ci #define USE_HW_SHA 218370b324cSopenharmony_ci #endif 219370b324cSopenharmony_ci #elif defined(_MSC_VER) 220370b324cSopenharmony_ci #if _MSC_VER >= 1910 221370b324cSopenharmony_ci #define USE_HW_SHA 222370b324cSopenharmony_ci #endif 223370b324cSopenharmony_ci #endif 224370b324cSopenharmony_ci 225370b324cSopenharmony_ci#ifdef USE_HW_SHA 226370b324cSopenharmony_ci 227370b324cSopenharmony_ci// #pragma message("=== Sha256 HW === ") 228370b324cSopenharmony_ci 229370b324cSopenharmony_ci#if defined(__clang__) || defined(__GNUC__) 230370b324cSopenharmony_ci #ifdef MY_CPU_ARM64 231370b324cSopenharmony_ci #define ATTRIB_SHA __attribute__((__target__("+crypto"))) 232370b324cSopenharmony_ci #else 233370b324cSopenharmony_ci #define ATTRIB_SHA __attribute__((__target__("fpu=crypto-neon-fp-armv8"))) 234370b324cSopenharmony_ci #endif 235370b324cSopenharmony_ci#else 236370b324cSopenharmony_ci // _MSC_VER 237370b324cSopenharmony_ci // for arm32 238370b324cSopenharmony_ci #define _ARM_USE_NEW_NEON_INTRINSICS 239370b324cSopenharmony_ci#endif 240370b324cSopenharmony_ci 241370b324cSopenharmony_ci#if defined(_MSC_VER) && defined(MY_CPU_ARM64) 242370b324cSopenharmony_ci#include <arm64_neon.h> 243370b324cSopenharmony_ci#else 244370b324cSopenharmony_ci#include <arm_neon.h> 245370b324cSopenharmony_ci#endif 246370b324cSopenharmony_ci 247370b324cSopenharmony_citypedef uint32x4_t v128; 248370b324cSopenharmony_ci// typedef __n128 v128; // MSVC 249370b324cSopenharmony_ci 250370b324cSopenharmony_ci#ifdef MY_CPU_BE 251370b324cSopenharmony_ci #define MY_rev32_for_LE(x) 252370b324cSopenharmony_ci#else 253370b324cSopenharmony_ci #define MY_rev32_for_LE(x) x = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(x))) 254370b324cSopenharmony_ci#endif 255370b324cSopenharmony_ci 256370b324cSopenharmony_ci#define LOAD_128(_p) (*(const v128 *)(const void *)(_p)) 257370b324cSopenharmony_ci#define STORE_128(_p, _v) *(v128 *)(void *)(_p) = (_v) 258370b324cSopenharmony_ci 259370b324cSopenharmony_ci#define LOAD_SHUFFLE(m, k) \ 260370b324cSopenharmony_ci m = LOAD_128((data + (k) * 16)); \ 261370b324cSopenharmony_ci MY_rev32_for_LE(m); \ 262370b324cSopenharmony_ci 263370b324cSopenharmony_ci// K array must be aligned for 16-bytes at least. 264370b324cSopenharmony_ciextern 265370b324cSopenharmony_ciMY_ALIGN(64) 266370b324cSopenharmony_ciconst UInt32 SHA256_K_ARRAY[64]; 267370b324cSopenharmony_ci 268370b324cSopenharmony_ci#define K SHA256_K_ARRAY 269370b324cSopenharmony_ci 270370b324cSopenharmony_ci 271370b324cSopenharmony_ci#define SHA256_SU0(dest, src) dest = vsha256su0q_u32(dest, src); 272370b324cSopenharmony_ci#define SHA25G_SU1(dest, src2, src3) dest = vsha256su1q_u32(dest, src2, src3); 273370b324cSopenharmony_ci 274370b324cSopenharmony_ci#define SM1(g0, g1, g2, g3) SHA256_SU0(g3, g0) 275370b324cSopenharmony_ci#define SM2(g0, g1, g2, g3) SHA25G_SU1(g2, g0, g1) 276370b324cSopenharmony_ci#define NNN(g0, g1, g2, g3) 277370b324cSopenharmony_ci 278370b324cSopenharmony_ci 279370b324cSopenharmony_ci#define R4(k, g0, g1, g2, g3, OP0, OP1) \ 280370b324cSopenharmony_ci msg = vaddq_u32(g0, *(const v128 *) (const void *) &K[(k) * 4]); \ 281370b324cSopenharmony_ci tmp = state0; \ 282370b324cSopenharmony_ci state0 = vsha256hq_u32( state0, state1, msg ); \ 283370b324cSopenharmony_ci state1 = vsha256h2q_u32( state1, tmp, msg ); \ 284370b324cSopenharmony_ci OP0(g0, g1, g2, g3); \ 285370b324cSopenharmony_ci OP1(g0, g1, g2, g3); \ 286370b324cSopenharmony_ci 287370b324cSopenharmony_ci 288370b324cSopenharmony_ci#define R16(k, OP0, OP1, OP2, OP3, OP4, OP5, OP6, OP7) \ 289370b324cSopenharmony_ci R4 ( (k)*4+0, m0, m1, m2, m3, OP0, OP1 ) \ 290370b324cSopenharmony_ci R4 ( (k)*4+1, m1, m2, m3, m0, OP2, OP3 ) \ 291370b324cSopenharmony_ci R4 ( (k)*4+2, m2, m3, m0, m1, OP4, OP5 ) \ 292370b324cSopenharmony_ci R4 ( (k)*4+3, m3, m0, m1, m2, OP6, OP7 ) \ 293370b324cSopenharmony_ci 294370b324cSopenharmony_ci 295370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_t numBlocks); 296370b324cSopenharmony_ci#ifdef ATTRIB_SHA 297370b324cSopenharmony_ciATTRIB_SHA 298370b324cSopenharmony_ci#endif 299370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_t numBlocks) 300370b324cSopenharmony_ci{ 301370b324cSopenharmony_ci v128 state0, state1; 302370b324cSopenharmony_ci 303370b324cSopenharmony_ci if (numBlocks == 0) 304370b324cSopenharmony_ci return; 305370b324cSopenharmony_ci 306370b324cSopenharmony_ci state0 = LOAD_128(&state[0]); 307370b324cSopenharmony_ci state1 = LOAD_128(&state[4]); 308370b324cSopenharmony_ci 309370b324cSopenharmony_ci do 310370b324cSopenharmony_ci { 311370b324cSopenharmony_ci v128 state0_save, state1_save; 312370b324cSopenharmony_ci v128 m0, m1, m2, m3; 313370b324cSopenharmony_ci v128 msg, tmp; 314370b324cSopenharmony_ci 315370b324cSopenharmony_ci state0_save = state0; 316370b324cSopenharmony_ci state1_save = state1; 317370b324cSopenharmony_ci 318370b324cSopenharmony_ci LOAD_SHUFFLE (m0, 0) 319370b324cSopenharmony_ci LOAD_SHUFFLE (m1, 1) 320370b324cSopenharmony_ci LOAD_SHUFFLE (m2, 2) 321370b324cSopenharmony_ci LOAD_SHUFFLE (m3, 3) 322370b324cSopenharmony_ci 323370b324cSopenharmony_ci R16 ( 0, NNN, NNN, SM1, NNN, SM1, SM2, SM1, SM2 ); 324370b324cSopenharmony_ci R16 ( 1, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ); 325370b324cSopenharmony_ci R16 ( 2, SM1, SM2, SM1, SM2, SM1, SM2, SM1, SM2 ); 326370b324cSopenharmony_ci R16 ( 3, SM1, SM2, NNN, SM2, NNN, NNN, NNN, NNN ); 327370b324cSopenharmony_ci 328370b324cSopenharmony_ci state0 = vaddq_u32(state0, state0_save); 329370b324cSopenharmony_ci state1 = vaddq_u32(state1, state1_save); 330370b324cSopenharmony_ci 331370b324cSopenharmony_ci data += 64; 332370b324cSopenharmony_ci } 333370b324cSopenharmony_ci while (--numBlocks); 334370b324cSopenharmony_ci 335370b324cSopenharmony_ci STORE_128(&state[0], state0); 336370b324cSopenharmony_ci STORE_128(&state[4], state1); 337370b324cSopenharmony_ci} 338370b324cSopenharmony_ci 339370b324cSopenharmony_ci#endif // USE_HW_SHA 340370b324cSopenharmony_ci 341370b324cSopenharmony_ci#endif // MY_CPU_ARM_OR_ARM64 342370b324cSopenharmony_ci 343370b324cSopenharmony_ci 344370b324cSopenharmony_ci#ifndef USE_HW_SHA 345370b324cSopenharmony_ci 346370b324cSopenharmony_ci// #error Stop_Compiling_UNSUPPORTED_SHA 347370b324cSopenharmony_ci// #include <stdlib.h> 348370b324cSopenharmony_ci 349370b324cSopenharmony_ci// #include "Sha256.h" 350370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks(UInt32 state[8], const Byte *data, size_t numBlocks); 351370b324cSopenharmony_ci 352370b324cSopenharmony_ci#pragma message("Sha256 HW-SW stub was used") 353370b324cSopenharmony_ci 354370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_t numBlocks); 355370b324cSopenharmony_civoid Z7_FASTCALL Sha256_UpdateBlocks_HW(UInt32 state[8], const Byte *data, size_t numBlocks) 356370b324cSopenharmony_ci{ 357370b324cSopenharmony_ci Sha256_UpdateBlocks(state, data, numBlocks); 358370b324cSopenharmony_ci /* 359370b324cSopenharmony_ci UNUSED_VAR(state); 360370b324cSopenharmony_ci UNUSED_VAR(data); 361370b324cSopenharmony_ci UNUSED_VAR(numBlocks); 362370b324cSopenharmony_ci exit(1); 363370b324cSopenharmony_ci return; 364370b324cSopenharmony_ci */ 365370b324cSopenharmony_ci} 366370b324cSopenharmony_ci 367370b324cSopenharmony_ci#endif 368370b324cSopenharmony_ci 369370b324cSopenharmony_ci 370370b324cSopenharmony_ci 371370b324cSopenharmony_ci#undef K 372370b324cSopenharmony_ci#undef RND2 373370b324cSopenharmony_ci#undef RND2_0 374370b324cSopenharmony_ci#undef RND2_1 375370b324cSopenharmony_ci 376370b324cSopenharmony_ci#undef MY_rev32_for_LE 377370b324cSopenharmony_ci#undef NNN 378370b324cSopenharmony_ci#undef LOAD_128 379370b324cSopenharmony_ci#undef STORE_128 380370b324cSopenharmony_ci#undef LOAD_SHUFFLE 381370b324cSopenharmony_ci#undef SM1 382370b324cSopenharmony_ci#undef SM2 383370b324cSopenharmony_ci 384370b324cSopenharmony_ci#undef NNN 385370b324cSopenharmony_ci#undef R4 386370b324cSopenharmony_ci#undef R16 387370b324cSopenharmony_ci#undef PREPARE_STATE 388370b324cSopenharmony_ci#undef USE_HW_SHA 389370b324cSopenharmony_ci#undef ATTRIB_SHA 390370b324cSopenharmony_ci#undef USE_VER_MIN 391