@@ -281,6 +281,11 @@ class algorithm
281281 INLINE static void iterate_vector (state_t & state,
282282 iblocks_t & blocks) NOEXCEPT;
283283
284+ template <size_t Size>
285+ INLINE static void iterate_native (state_t & state,
286+ const ablocks_t <Size>& blocks) NOEXCEPT;
287+ INLINE static void iterate_native (state_t & state, iblocks_t & blocks) NOEXCEPT;
288+
284289 template <size_t Size>
285290 INLINE static constexpr void iterate_ (state_t & state,
286291 const ablocks_t <Size>& blocks) NOEXCEPT;
@@ -317,7 +322,8 @@ class algorithm
317322 const xstate_t <xWord>& xstate) NOEXCEPT;
318323
319324 template <typename xWord, if_extended<xWord> = true >
320- INLINE static void merkle_hash_vector (idigests_t & digests, iblocks_t & blocks) NOEXCEPT;
325+ INLINE static void merkle_hash_vector (idigests_t & digests,
326+ iblocks_t & blocks) NOEXCEPT;
321327 INLINE static void merkle_hash_vector (digests_t & digests) NOEXCEPT;
322328 VCONSTEXPR static void merkle_hash_ (digests_t & digests,
323329 size_t offset=zero) NOEXCEPT;
@@ -330,10 +336,10 @@ class algorithm
330336 auto x6, auto x7, auto x8) NOEXCEPT;
331337
332338 template <size_t Round, size_t Offset>
333- INLINE static void prepare1 (buffer_t & buffer, const auto & xsigma0) NOEXCEPT;
339+ INLINE static void prepare_1 (buffer_t & buffer, const auto & xsigma0) NOEXCEPT;
334340
335341 template <size_t Round>
336- INLINE static void prepare8 (buffer_t & buffer) NOEXCEPT;
342+ INLINE static void prepare_8 (buffer_t & buffer) NOEXCEPT;
337343
338344 template <typename xWord>
339345 INLINE static void schedule_sigma (xbuffer_t <xWord>& xbuffer) NOEXCEPT;
@@ -357,45 +363,24 @@ class algorithm
357363 // / Native SHA optimizations (single blocks).
358364 // / -----------------------------------------------------------------------
359365
360- template <size_t Round>
361- INLINE static void prepare_native (wbuffer_t <xint128_t >& wbuffer) NOEXCEPT;
362- static void schedule_native (wbuffer_t <xint128_t >& wbuffer) NOEXCEPT;
363-
364- template <typename xWord>
365- INLINE static void schedule_native (xbuffer_t <xWord>& xbuffer) NOEXCEPT;
366- INLINE static void schedule_native (buffer_t & buffer) NOEXCEPT;
367-
368- template <size_t Round, size_t Lane>
369- INLINE static void round_native (wstate_t <xint128_t >& state,
370- const wbuffer_t <xint128_t >& wk) NOEXCEPT;
371-
372- INLINE static void shuffle (wstate_t <xint128_t >& wstate) NOEXCEPT;
373- INLINE static void unshuffle (wstate_t <xint128_t >& wstate) NOEXCEPT;
374- INLINE static void summarize_native (wstate_t <xint128_t >& out,
375- const wstate_t <xint128_t >& in) NOEXCEPT;
366+ INLINE static void shuffle (xint128_t & state0, xint128_t & state1) NOEXCEPT;
367+ INLINE static void unshuffle (xint128_t & state0, xint128_t & state1) NOEXCEPT;
368+ INLINE static void prepare (xint128_t & message0, xint128_t message1) NOEXCEPT;
369+ INLINE static void prepare (xint128_t & message0, xint128_t message1,
370+ xint128_t & message2) NOEXCEPT;
376371
377- template <size_t Lane>
378- static void compress_native (wstate_t <xint128_t >& state,
379- const wbuffer_t <xint128_t >& wbuffer) NOEXCEPT;
380-
381- template <typename xWord, size_t Lane>
382- INLINE static void compress_native (xstate_t <xWord>& xstate,
383- const xbuffer_t <xWord>& xbuffer) NOEXCEPT;
384-
385- template <typename xWord, size_t Lane>
386- INLINE static void compress_native (state_t & state,
387- const xbuffer_t <xWord>& xbuffer) NOEXCEPT;
372+ template <size_t Round>
373+ INLINE static void round_4 (xint128_t & state0, xint128_t & state1,
374+ xint128_t message) NOEXCEPT;
388375
389- template <size_t Lane>
390- INLINE static void compress_native (state_t & state,
391- const buffer_t & buffer) NOEXCEPT;
376+ static void native_rounds (state_t & state, iblocks_t & blocks) NOEXCEPT;
392377
393378public:
394379 // / Summary public values.
395380 // / -----------------------------------------------------------------------
396381 static constexpr auto caching = Cached;
397- static constexpr auto native = (use_shani || use_neon) &&
398- !is_same_size< word_t , uint64_t > ;
382+ static constexpr auto native = (use_shani || use_neon)
383+ && (SHA::strength == 256 || SHA::strength == 160 ) ;
399384 static constexpr auto vector = (use_x128 || use_x256 || use_x512)
400385 && !(build_x32 && is_same_size<word_t , uint64_t >);
401386};
0 commit comments