xref: /isa-l_crypto/include/sha256_mb.h (revision 38e16e11defa07d24d9d593354096a7ef33c75b7)
1 /**********************************************************************
2   Copyright(c) 2011-2016 Intel Corporation All rights reserved.
3 
4   Redistribution and use in source and binary forms, with or without
5   modification, are permitted provided that the following conditions
6   are met:
7     * Redistributions of source code must retain the above copyright
8       notice, 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
11       the documentation and/or other materials provided with the
12       distribution.
13     * Neither the name of Intel Corporation nor the names of its
14       contributors may be used to endorse or promote products derived
15       from this software without specific prior written permission.
16 
17   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 **********************************************************************/
29 
30 #ifndef _SHA256_MB_H_
31 #define _SHA256_MB_H_
32 
33 /**
34  *  @file sha256_mb.h
35  *  @brief Multi-buffer CTX API SHA256 function prototypes and structures
36  *
37  * Interface for multi-buffer SHA256 functions
38  *
39  * <b> Multi-buffer SHA256  Entire or First-Update..Update-Last </b>
40  *
41  * The interface to this multi-buffer hashing code is carried out through the
42  * context-level (CTX) init, submit and flush functions and the SHA256_HASH_CTX_MGR and
43  * SHA256_HASH_CTX objects. Numerous SHA256_HASH_CTX objects may be instantiated by the
44  * application for use with a single SHA256_HASH_CTX_MGR.
45  *
46  * The CTX interface functions carry out the initialization and padding of the jobs
47  * entered by the user and add them to the multi-buffer manager. The lower level "scheduler"
48  * layer then processes the jobs in an out-of-order manner. The scheduler layer functions
49  * are internal and are not intended to be invoked directly. Jobs can be submitted
50  * to a CTX as a complete buffer to be hashed, using the HASH_ENTIRE flag, or as partial
51  * jobs which can be started using the HASH_FIRST flag, and later resumed or finished
52  * using the HASH_UPDATE and HASH_LAST flags respectively.
53  *
54  * <b>Note:</b> The submit function does not require data buffers to be block sized.
55  *
56  * The SHA256 CTX interface functions are available for 4 architectures: SSE, AVX, AVX2 and
57  * AVX512. In addition, a multibinary interface is provided, which selects the appropriate
58  * architecture-specific function at runtime.
59  *
60  * <b>Usage:</b> The application creates a SHA256_HASH_CTX_MGR object and initializes it
61  * with a call to sha256_ctx_mgr_init*() function, where henceforth "*" stands for the
62  * relevant suffix for each architecture; _sse, _avx, _avx2, _avx512(or no suffix for the
63  * multibinary version). The SHA256_HASH_CTX_MGR object will be used to schedule processor
64  * resources, with up to 4 SHA256_HASH_CTX objects (or 8 in the AVX2 case, 16 in the AVX512)
65  * being processed at a time.
66  *
67  * Each SHA256_HASH_CTX must be initialized before first use by the hash_ctx_init macro
68  * defined in multi_buffer.h. After initialization, the application may begin computing
69  * a hash by giving the SHA256_HASH_CTX to a SHA256_HASH_CTX_MGR using the submit functions
70  * sha256_ctx_mgr_submit*() with the HASH_FIRST flag set. When the SHA256_HASH_CTX is
71  * returned to the application (via this or a later call to sha256_ctx_mgr_submit*() or
72  * sha256_ctx_mgr_flush*()), the application can then re-submit it with another call to
73  * sha256_ctx_mgr_submit*(), but without the HASH_FIRST flag set.
74  *
75  * Ideally, on the last buffer for that hash, sha256_ctx_mgr_submit_sse is called with
76  * HASH_LAST, although it is also possible to submit the hash with HASH_LAST and a zero
77  * length if necessary. When a SHA256_HASH_CTX is returned after having been submitted with
78  * HASH_LAST, it will contain a valid hash. The SHA256_HASH_CTX can be reused immediately
79  * by submitting with HASH_FIRST.
80  *
81  * For example, you would submit hashes with the following flags for the following numbers
82  * of buffers:
83  * <ul>
84  *  <li> one buffer: HASH_FIRST | HASH_LAST  (or, equivalently, HASH_ENTIRE)
85  *  <li> two buffers: HASH_FIRST, HASH_LAST
86  *  <li> three buffers: HASH_FIRST, HASH_UPDATE, HASH_LAST
87  * etc.
88  * </ul>
89  *
90  * The order in which SHA256_CTX objects are returned is in general different from the order
91  * in which they are submitted.
92  *
93  * A few possible error conditions exist:
94  * <ul>
95  *  <li> Submitting flags other than the allowed entire/first/update/last values
96  *  <li> Submitting a context that is currently being managed by a SHA256_HASH_CTX_MGR.
97  *  <li> Submitting a context after HASH_LAST is used but before HASH_FIRST is set.
98  * </ul>
99  *
100  *  These error conditions are reported by returning the SHA256_HASH_CTX immediately after
101  *  a submit with its error member set to a non-zero error code (defined in
102  *  multi_buffer.h). No changes are made to the SHA256_HASH_CTX_MGR in the case of an
103  *  error; no processing is done for other hashes.
104  *
105  */
106 
107 #include <stdint.h>
108 #include <string.h>
109 #include "multi_buffer.h"
110 #include "types.h"
111 
112 #ifndef _MSC_VER
113 #include <stdbool.h>
114 #endif
115 
116 #ifdef __cplusplus
117 extern "C" {
118 #endif
119 
120 // Hash Constants and Typedefs
121 #define SHA256_DIGEST_NWORDS       8
122 #define SHA256_MAX_LANES           16
123 #define SHA256_X8_LANES            8
124 #define SHA256_MIN_LANES           4
125 #define SHA256_BLOCK_SIZE          64
126 #define SHA256_LOG2_BLOCK_SIZE     6
127 #define SHA256_PADLENGTHFIELD_SIZE 8
128 #define SHA256_INITIAL_DIGEST                                                                      \
129         0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab,        \
130                 0x5be0cd19
131 
132 typedef uint32_t sha256_digest_array[SHA256_DIGEST_NWORDS][SHA256_MAX_LANES];
133 typedef uint32_t SHA256_WORD_T;
134 
135 /** @brief Scheduler layer - Holds info describing a single SHA256 job for the multi-buffer manager
136  */
137 
138 typedef struct {
139         uint8_t *buffer; //!< pointer to data buffer for this job
140         uint64_t len;    //!< length of buffer for this job in blocks.
141         DECLARE_ALIGNED(uint32_t result_digest[SHA256_DIGEST_NWORDS], 64);
142         JOB_STS status;  //!< output job status
143         void *user_data; //!< pointer for user's job-related data
144 } SHA256_JOB;
145 
146 /** @brief Scheduler layer -  Holds arguments for submitted SHA256 job */
147 
148 typedef struct {
149         sha256_digest_array digest;
150         uint8_t *data_ptr[SHA256_MAX_LANES];
151 } SHA256_MB_ARGS_X16;
152 
153 /** @brief Scheduler layer - Lane data */
154 
155 typedef struct {
156         SHA256_JOB *job_in_lane;
157 } SHA256_LANE_DATA;
158 
159 /** @brief Scheduler layer - Holds state for multi-buffer SHA256 jobs */
160 
161 typedef struct {
162         SHA256_MB_ARGS_X16 args;
163         DECLARE_ALIGNED(uint32_t lens[SHA256_MAX_LANES], 16);
164         uint64_t unused_lanes; //!< each nibble is index (0...3 or 0...7) of unused lanes, nibble 4
165                                //!< or 8 is set to F as a flag
166         SHA256_LANE_DATA ldata[SHA256_MAX_LANES];
167         uint32_t num_lanes_inuse;
168 } SHA256_MB_JOB_MGR;
169 
170 /** @brief Context layer - Holds state for multi-buffer SHA256 jobs */
171 
172 typedef struct {
173         SHA256_MB_JOB_MGR mgr;
174 } SHA256_HASH_CTX_MGR;
175 
176 /** @brief Context layer - Holds info describing a single SHA256 job for the multi-buffer CTX
177  * manager This structure must be allocated to 16-byte aligned memory */
178 
179 typedef struct {
180         SHA256_JOB job;                  // Must be at struct offset 0.
181         HASH_CTX_STS status;             //!< Context status flag
182         HASH_CTX_ERROR error;            //!< Context error flag
183         uint64_t total_length;           //!< Running counter of length processed for this CTX's job
184         const void *incoming_buffer;     //!< pointer to data input buffer for this CTX's job
185         uint32_t incoming_buffer_length; //!< length of buffer for this job in bytes.
186         uint8_t partial_block_buffer[SHA256_BLOCK_SIZE * 2]; //!< CTX partial blocks
187         uint32_t partial_block_buffer_length;
188         void *user_data; //!< pointer for user to keep any job-related data
189 } SHA256_HASH_CTX;
190 
191 /******************** multibinary function prototypes **********************/
192 
193 /**
194  * @brief Initialize the SHA256 multi-buffer manager structure.
195  * @requires SSE4.1 or AVX or AVX2
196  *
197  * @param mgr	Structure holding context level state info
198  * @returns void
199  */
200 void
201 sha256_ctx_mgr_init(SHA256_HASH_CTX_MGR *mgr);
202 
203 /**
204  * @brief  Submit a new SHA256 job to the multi-buffer manager.
205  * @requires SSE4.1 or AVX or AVX2
206  *
207  * @param  mgr Structure holding context level state info
208  * @param  ctx Structure holding ctx job info
209  * @param  buffer Pointer to buffer to be processed
210  * @param  len Length of buffer (in bytes) to be processed
211  * @param  flags Input flag specifying job type (first, update, last or entire)
212  * @returns NULL if no jobs complete or pointer to jobs structure.
213  */
214 SHA256_HASH_CTX *
215 sha256_ctx_mgr_submit(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
216                       uint32_t len, HASH_CTX_FLAG flags);
217 
218 /**
219  * @brief Finish all submitted SHA256 jobs and return when complete.
220  * @requires SSE4.1 or AVX or AVX2
221  *
222  * @param mgr	Structure holding context level state info
223  * @returns NULL if no jobs to complete or pointer to jobs structure.
224  */
225 SHA256_HASH_CTX *
226 sha256_ctx_mgr_flush(SHA256_HASH_CTX_MGR *mgr);
227 
228 /*******************************************************************
229  * CTX level API function prototypes
230  ******************************************************************/
231 
232 /**
233  * @brief Initialize the context level SHA256 multi-buffer manager structure.
234  * @requires SSE4.1
235  *
236  * @param mgr Structure holding context level state info
237  * @returns void
238  */
239 void
240 sha256_ctx_mgr_init_sse(SHA256_HASH_CTX_MGR *mgr);
241 
242 /**
243  * @brief  Submit a new SHA256 job to the context level multi-buffer manager.
244  * @requires SSE4.1
245  *
246  * @param  mgr Structure holding context level state info
247  * @param  ctx Structure holding ctx job info
248  * @param  buffer Pointer to buffer to be processed
249  * @param  len Length of buffer (in bytes) to be processed
250  * @param  flags Input flag specifying job type (first, update, last or entire)
251  * @returns NULL if no jobs complete or pointer to jobs structure.
252  */
253 SHA256_HASH_CTX *
254 sha256_ctx_mgr_submit_sse(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
255                           uint32_t len, HASH_CTX_FLAG flags);
256 
257 /**
258  * @brief Finish all submitted SHA256 jobs and return when complete.
259  * @requires SSE4.1
260  *
261  * @param mgr	Structure holding context level state info
262  * @returns NULL if no jobs to complete or pointer to jobs structure.
263  */
264 SHA256_HASH_CTX *
265 sha256_ctx_mgr_flush_sse(SHA256_HASH_CTX_MGR *mgr);
266 
267 /**
268  * @brief Initialize the context level SHA256 multi-buffer manager structure.
269  * @requires SSE4.1 and SHANI
270  *
271  * @param mgr Structure holding context level state info
272  * @returns void
273  */
274 void
275 sha256_ctx_mgr_init_sse_ni(SHA256_HASH_CTX_MGR *mgr);
276 
277 /**
278  * @brief  Submit a new SHA256 job to the context level multi-buffer manager.
279  * @requires SSE4.1 and SHANI
280  *
281  * @param  mgr Structure holding context level state info
282  * @param  ctx Structure holding ctx job info
283  * @param  buffer Pointer to buffer to be processed
284  * @param  len Length of buffer (in bytes) to be processed
285  * @param  flags Input flag specifying job type (first, update, last or entire)
286  * @returns NULL if no jobs complete or pointer to jobs structure.
287  */
288 SHA256_HASH_CTX *
289 sha256_ctx_mgr_submit_sse_ni(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
290                              uint32_t len, HASH_CTX_FLAG flags);
291 
292 /**
293  * @brief Finish all submitted SHA256 jobs and return when complete.
294  * @requires SSE4.1 and SHANI
295  *
296  * @param mgr	Structure holding context level state info
297  * @returns NULL if no jobs to complete or pointer to jobs structure.
298  */
299 SHA256_HASH_CTX *
300 sha256_ctx_mgr_flush_sse_ni(SHA256_HASH_CTX_MGR *mgr);
301 
302 /**
303  * @brief Initialize the SHA256 multi-buffer manager structure.
304  * @requires AVX
305  *
306  * @param mgr Structure holding context level state info
307  * @returns void
308  */
309 void
310 sha256_ctx_mgr_init_avx(SHA256_HASH_CTX_MGR *mgr);
311 
312 /**
313  * @brief  Submit a new SHA256 job to the multi-buffer manager.
314  * @requires AVX
315  *
316  * @param  mgr Structure holding context level state info
317  * @param  ctx Structure holding ctx job info
318  * @param  buffer Pointer to buffer to be processed
319  * @param  len Length of buffer (in bytes) to be processed
320  * @param  flags Input flag specifying job type (first, update, last or entire)
321  * @returns NULL if no jobs complete or pointer to jobs structure.
322  */
323 SHA256_HASH_CTX *
324 sha256_ctx_mgr_submit_avx(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
325                           uint32_t len, HASH_CTX_FLAG flags);
326 
327 /**
328  * @brief Finish all submitted SHA256 jobs and return when complete.
329  * @requires AVX
330  *
331  * @param mgr	Structure holding context level state info
332  * @returns NULL if no jobs to complete or pointer to jobs structure.
333  */
334 SHA256_HASH_CTX *
335 sha256_ctx_mgr_flush_avx(SHA256_HASH_CTX_MGR *mgr);
336 
337 /**
338  * @brief Initialize the SHA256 multi-buffer manager structure.
339  * @requires AVX2
340  *
341  * @param mgr	Structure holding context level state info
342  * @returns void
343  */
344 void
345 sha256_ctx_mgr_init_avx2(SHA256_HASH_CTX_MGR *mgr);
346 
347 /**
348  * @brief  Submit a new SHA256 job to the multi-buffer manager.
349  * @requires AVX2
350  *
351  * @param  mgr Structure holding context level state info
352  * @param  ctx Structure holding ctx job info
353  * @param  buffer Pointer to buffer to be processed
354  * @param  len Length of buffer (in bytes) to be processed
355  * @param  flags Input flag specifying job type (first, update, last or entire)
356  * @returns NULL if no jobs complete or pointer to jobs structure.
357  */
358 SHA256_HASH_CTX *
359 sha256_ctx_mgr_submit_avx2(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
360                            uint32_t len, HASH_CTX_FLAG flags);
361 
362 /**
363  * @brief Finish all submitted SHA256 jobs and return when complete.
364  * @requires AVX2
365  *
366  * @param mgr	Structure holding context level state info
367  * @returns NULL if no jobs to complete or pointer to jobs structure.
368  */
369 SHA256_HASH_CTX *
370 sha256_ctx_mgr_flush_avx2(SHA256_HASH_CTX_MGR *mgr);
371 
372 /**
373  * @brief Initialize the SHA256 multi-buffer manager structure.
374  * @requires AVX512
375  *
376  * @param mgr	Structure holding context level state info
377  * @returns void
378  */
379 void
380 sha256_ctx_mgr_init_avx512(SHA256_HASH_CTX_MGR *mgr);
381 
382 /**
383  * @brief  Submit a new SHA256 job to the multi-buffer manager.
384  * @requires AVX512
385  *
386  * @param  mgr Structure holding context level state info
387  * @param  ctx Structure holding ctx job info
388  * @param  buffer Pointer to buffer to be processed
389  * @param  len Length of buffer (in bytes) to be processed
390  * @param  flags Input flag specifying job type (first, update, last or entire)
391  * @returns NULL if no jobs complete or pointer to jobs structure.
392  */
393 SHA256_HASH_CTX *
394 sha256_ctx_mgr_submit_avx512(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
395                              uint32_t len, HASH_CTX_FLAG flags);
396 
397 /**
398  * @brief Finish all submitted SHA256 jobs and return when complete.
399  * @requires AVX512
400  *
401  * @param mgr	Structure holding context level state info
402  * @returns NULL if no jobs to complete or pointer to jobs structure.
403  */
404 SHA256_HASH_CTX *
405 sha256_ctx_mgr_flush_avx512(SHA256_HASH_CTX_MGR *mgr);
406 
407 /**
408  * @brief Initialize the SHA256 multi-buffer manager structure.
409  * @requires AVX512 and SHANI
410  *
411  * @param mgr	Structure holding context level state info
412  * @returns void
413  */
414 void
415 sha256_ctx_mgr_init_avx512_ni(SHA256_HASH_CTX_MGR *mgr);
416 
417 /**
418  * @brief  Submit a new SHA256 job to the multi-buffer manager.
419  * @requires AVX512 and SHANI
420  *
421  * @param  mgr Structure holding context level state info
422  * @param  ctx Structure holding ctx job info
423  * @param  buffer Pointer to buffer to be processed
424  * @param  len Length of buffer (in bytes) to be processed
425  * @param  flags Input flag specifying job type (first, update, last or entire)
426  * @returns NULL if no jobs complete or pointer to jobs structure.
427  */
428 SHA256_HASH_CTX *
429 sha256_ctx_mgr_submit_avx512_ni(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx, const void *buffer,
430                                 uint32_t len, HASH_CTX_FLAG flags);
431 
432 /**
433  * @brief Finish all submitted SHA256 jobs and return when complete.
434  * @requires AVX512 and SHANI
435  *
436  * @param mgr	Structure holding context level state info
437  * @returns NULL if no jobs to complete or pointer to jobs structure.
438  */
439 SHA256_HASH_CTX *
440 sha256_ctx_mgr_flush_avx512_ni(SHA256_HASH_CTX_MGR *mgr);
441 
442 /**
443  * @brief Initialize the SHA256 multi-buffer manager structure.
444  * @requires SSE4.1 for x86 or ASIMD for ARM
445  *
446  * @param[in] mgr Structure holding context level state info
447  * @return Operation status
448  * @retval 0 on success
449  * @retval Non-zero \a ISAL_CRYPTO_ERR on failure
450  */
451 int
452 isal_sha256_ctx_mgr_init(SHA256_HASH_CTX_MGR *mgr);
453 
454 /**
455  * @brief  Submit a new SHA256 job to the multi-buffer manager.
456  * @requires SSE4.1 for x86 or ASIMD for ARM
457  *
458  * @param[in] mgr Structure holding context level state info
459  * @param[in] ctx_in Structure holding ctx job info
460  * @param[out] ctx_out	Pointer address to output job ctx info.
461  *			Modified to point to completed job structure or
462  *			NULL if no jobs completed.
463  * @param[in] buffer Pointer to buffer to be processed
464  * @param[in] len Length of buffer (in bytes) to be processed
465  * @param[in] flags Input flag specifying job type (first, update, last or entire)
466  * @return Operation status
467  * @retval 0 on success
468  * @retval Non-zero \a ISAL_CRYPTO_ERR on failure
469  */
470 int
471 isal_sha256_ctx_mgr_submit(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX *ctx_in,
472                            SHA256_HASH_CTX **ctx_out, const void *buffer, const uint32_t len,
473                            const HASH_CTX_FLAG flags);
474 
475 /**
476  * @brief Finish all submitted SHA256 jobs and return when complete.
477  * @requires SSE4.1 for x86 or ASIMD for ARM
478  *
479  * @param[in] mgr Structure holding context level state info
480  * @return Operation status
481  * @retval 0 on success
482  * @retval Non-zero \a ISAL_CRYPTO_ERR on failure
483  */
484 int
485 isal_sha256_ctx_mgr_flush(SHA256_HASH_CTX_MGR *mgr, SHA256_HASH_CTX **ctx_out);
486 
487 /*******************************************************************
488  * Scheduler (internal) level out-of-order function prototypes
489  ******************************************************************/
490 
491 void
492 sha256_mb_mgr_init_sse(SHA256_MB_JOB_MGR *state);
493 SHA256_JOB *
494 sha256_mb_mgr_submit_sse(SHA256_MB_JOB_MGR *state, SHA256_JOB *job);
495 SHA256_JOB *
496 sha256_mb_mgr_flush_sse(SHA256_MB_JOB_MGR *state);
497 
498 #define sha256_mb_mgr_init_avx sha256_mb_mgr_init_sse
499 SHA256_JOB *
500 sha256_mb_mgr_submit_avx(SHA256_MB_JOB_MGR *state, SHA256_JOB *job);
501 SHA256_JOB *
502 sha256_mb_mgr_flush_avx(SHA256_MB_JOB_MGR *state);
503 
504 void
505 sha256_mb_mgr_init_avx2(SHA256_MB_JOB_MGR *state);
506 SHA256_JOB *
507 sha256_mb_mgr_submit_avx2(SHA256_MB_JOB_MGR *state, SHA256_JOB *job);
508 SHA256_JOB *
509 sha256_mb_mgr_flush_avx2(SHA256_MB_JOB_MGR *state);
510 
511 void
512 sha256_mb_mgr_init_avx512(SHA256_MB_JOB_MGR *state);
513 SHA256_JOB *
514 sha256_mb_mgr_submit_avx512(SHA256_MB_JOB_MGR *state, SHA256_JOB *job);
515 SHA256_JOB *
516 sha256_mb_mgr_flush_avx512(SHA256_MB_JOB_MGR *state);
517 
518 void
519 sha256_mb_mgr_init_sse_ni(SHA256_MB_JOB_MGR *state);
520 SHA256_JOB *
521 sha256_mb_mgr_submit_sse_ni(SHA256_MB_JOB_MGR *state, SHA256_JOB *job);
522 SHA256_JOB *
523 sha256_mb_mgr_flush_sse_ni(SHA256_MB_JOB_MGR *state);
524 
525 void
526 sha256_mb_mgr_init_avx512_ni(SHA256_MB_JOB_MGR *state);
527 SHA256_JOB *
528 sha256_mb_mgr_submit_avx512_ni(SHA256_MB_JOB_MGR *state, SHA256_JOB *job);
529 SHA256_JOB *
530 sha256_mb_mgr_flush_avx512_ni(SHA256_MB_JOB_MGR *state);
531 
532 #ifdef __cplusplus
533 }
534 #endif
535 
536 #endif // _SHA256_MB_H_
537