xref: /isa-l_crypto/include/sha1_mb.h (revision a7fdaa3b5f310f7250e30cd3a0f9ab8910f12dcf)
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 _SHA1_MB_H_
31 #define _SHA1_MB_H_
32 
33 /**
34  *  @file sha1_mb.h
35  *  @brief Multi-buffer CTX API SHA1 function prototypes and structures
36  *  @warning: SHA1 is considered unsafe, so it is recommended to use SHA256 instead.
37  *
38  * Interface for multi-buffer SHA1 functions
39  *
40  * <b> Multi-buffer SHA1  Entire or First-Update..Update-Last </b>
41  *
42  * The interface to this multi-buffer hashing code is carried out through the
43  * context-level (CTX) init, submit and flush functions and the SHA1_HASH_CTX_MGR and
44  * SHA1_HASH_CTX objects. Numerous SHA1_HASH_CTX objects may be instantiated by the
45  * application for use with a single SHA1_HASH_CTX_MGR.
46  *
47  * The CTX interface functions carry out the initialization and padding of the jobs
48  * entered by the user and add them to the multi-buffer manager. The lower level "scheduler"
49  * layer then processes the jobs in an out-of-order manner. The scheduler layer functions
50  * are internal and are not intended to be invoked directly. Jobs can be submitted
51  * to a CTX as a complete buffer to be hashed, using the HASH_ENTIRE flag, or as partial
52  * jobs which can be started using the HASH_FIRST flag, and later resumed or finished
53  * using the HASH_UPDATE and HASH_LAST flags respectively.
54  *
55  * <b>Note:</b> The submit function does not require data buffers to be block sized.
56  *
57  * The SHA1 CTX interface functions are available for 4 architectures: SSE, AVX, AVX2 and
58  * AVX512. In addition, a multibinary interface is provided, which selects the appropriate
59  * architecture-specific function at runtime.
60  *
61  * <b>Usage:</b> The application creates a SHA1_HASH_CTX_MGR object and initializes it
62  * with a call to sha1_ctx_mgr_init*() function, where henceforth "*" stands for the
63  * relevant suffix for each architecture; _sse, _avx, _avx2, _avx512(or no suffix for the
64  * multibinary version). The SHA1_HASH_CTX_MGR object will be used to schedule processor
65  * resources, with up to 4 SHA1_HASH_CTX objects (or 8 in the AVX2 case, 16 in the AVX512)
66  * being processed at a time.
67  *
68  * Each SHA1_HASH_CTX must be initialized before first use by the hash_ctx_init macro
69  * defined in multi_buffer.h. After initialization, the application may begin computing
70  * a hash by giving the SHA1_HASH_CTX to a SHA1_HASH_CTX_MGR using the submit functions
71  * sha1_ctx_mgr_submit*() with the HASH_FIRST flag set. When the SHA1_HASH_CTX is
72  * returned to the application (via this or a later call to sha1_ctx_mgr_submit*() or
73  * sha1_ctx_mgr_flush*()), the application can then re-submit it with another call to
74  * sha1_ctx_mgr_submit*(), but without the HASH_FIRST flag set.
75  *
76  * Ideally, on the last buffer for that hash, sha1_ctx_mgr_submit_sse is called with
77  * HASH_LAST, although it is also possible to submit the hash with HASH_LAST and a zero
78  * length if necessary. When a SHA1_HASH_CTX is returned after having been submitted with
79  * HASH_LAST, it will contain a valid hash. The SHA1_HASH_CTX can be reused immediately
80  * by submitting with HASH_FIRST.
81  *
82  * For example, you would submit hashes with the following flags for the following numbers
83  * of buffers:
84  * <ul>
85  *  <li> one buffer: HASH_FIRST | HASH_LAST  (or, equivalently, HASH_ENTIRE)
86  *  <li> two buffers: HASH_FIRST, HASH_LAST
87  *  <li> three buffers: HASH_FIRST, HASH_UPDATE, HASH_LAST
88  * etc.
89  * </ul>
90  *
91  * The order in which SHA1_CTX objects are returned is in general different from the order
92  * in which they are submitted.
93  *
94  * A few possible error conditions exist:
95  * <ul>
96  *  <li> Submitting flags other than the allowed entire/first/update/last values
97  *  <li> Submitting a context that is currently being managed by a SHA1_HASH_CTX_MGR.
98  *  <li> Submitting a context after HASH_LAST is used but before HASH_FIRST is set.
99  * </ul>
100  *
101  *  These error conditions are reported by returning the SHA1_HASH_CTX immediately after
102  *  a submit with its error member set to a non-zero error code (defined in
103  *  multi_buffer.h). No changes are made to the SHA1_HASH_CTX_MGR in the case of an
104  *  error; no processing is done for other hashes.
105  *
106  */
107 
108 #include <stdint.h>
109 #include <string.h>
110 #include "multi_buffer.h"
111 #include "types.h"
112 
113 #ifndef _MSC_VER
114 #include <stdbool.h>
115 #endif
116 
117 #ifdef __cplusplus
118 extern "C" {
119 #endif
120 
121 // Hash Constants and Typedefs
122 #define SHA1_DIGEST_NWORDS       5
123 #define SHA1_MAX_LANES           16
124 #define SHA1_X8_LANES            8
125 #define SHA1_MIN_LANES           4
126 #define SHA1_BLOCK_SIZE          64
127 #define SHA1_LOG2_BLOCK_SIZE     6
128 #define SHA1_PADLENGTHFIELD_SIZE 8
129 #define SHA1_INITIAL_DIGEST      0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0
130 
131 typedef uint32_t sha1_digest_array[SHA1_DIGEST_NWORDS][SHA1_MAX_LANES];
132 typedef uint32_t SHA1_WORD_T;
133 
134 /** @brief Scheduler layer - Holds info describing a single SHA1 job for the multi-buffer manager */
135 
136 typedef struct {
137         uint8_t *buffer; //!< pointer to data buffer for this job
138         uint32_t len;    //!< length of buffer for this job in blocks.
139         DECLARE_ALIGNED(uint32_t result_digest[SHA1_DIGEST_NWORDS], 64);
140         JOB_STS status;  //!< output job status
141         void *user_data; //!< pointer for user's job-related data
142 } SHA1_JOB;
143 
144 /** @brief Scheduler layer -  Holds arguments for submitted SHA1 job */
145 
146 typedef struct {
147         sha1_digest_array digest;
148         uint8_t *data_ptr[SHA1_MAX_LANES];
149 } SHA1_MB_ARGS_X16;
150 
151 /** @brief Scheduler layer - Lane data */
152 
153 typedef struct {
154         SHA1_JOB *job_in_lane;
155 } SHA1_LANE_DATA;
156 
157 /** @brief Scheduler layer - Holds state for multi-buffer SHA1 jobs */
158 
159 typedef struct {
160         SHA1_MB_ARGS_X16 args;
161         DECLARE_ALIGNED(uint32_t lens[SHA1_MAX_LANES], 16);
162         uint64_t unused_lanes; //!< each nibble is index (0...3 or 0...7 or 0...15) of unused lanes,
163                                //!< nibble 4 or 8 is set to F as a flag
164         SHA1_LANE_DATA ldata[SHA1_MAX_LANES];
165         uint32_t num_lanes_inuse;
166 } SHA1_MB_JOB_MGR;
167 
168 /** @brief Context layer - Holds state for multi-buffer SHA1 jobs */
169 
170 typedef struct {
171         SHA1_MB_JOB_MGR mgr;
172 } SHA1_HASH_CTX_MGR;
173 
174 /** @brief Context layer - Holds info describing a single SHA1 job for the multi-buffer CTX manager.
175  * This structure must be allocated to 16-byte aligned memory */
176 
177 typedef struct {
178         SHA1_JOB job;                    // Must be at struct offset 0.
179         HASH_CTX_STS status;             //!< Context status flag
180         HASH_CTX_ERROR error;            //!< Context error flag
181         uint64_t total_length;           //!< Running counter of length processed for this CTX's job
182         const void *incoming_buffer;     //!< pointer to data input buffer for this CTX's job
183         uint32_t incoming_buffer_length; //!< length of buffer for this job in bytes.
184         uint8_t partial_block_buffer[SHA1_BLOCK_SIZE * 2]; //!< CTX partial blocks
185         uint32_t partial_block_buffer_length;
186         void *user_data; //!< pointer for user to keep any job-related data
187 } SHA1_HASH_CTX;
188 
189 /******************** multibinary function prototypes **********************/
190 
191 /**
192  * @brief Initialize the SHA1 multi-buffer manager structure.
193  * @requires SSE4.1 or AVX or AVX2 or AVX512
194  *
195  * @param mgr Structure holding context level state info
196  * @returns void
197  */
198 void
199 sha1_ctx_mgr_init(SHA1_HASH_CTX_MGR *mgr);
200 
201 /**
202  * @brief  Submit a new SHA1 job to the multi-buffer manager.
203  * @requires SSE4.1 or AVX or AVX2 or AVX512
204  *
205  * @param  mgr Structure holding context level state info
206  * @param  ctx Structure holding ctx job info
207  * @param  buffer Pointer to buffer to be processed
208  * @param  len Length of buffer (in bytes) to be processed
209  * @param  flags Input flag specifying job type (first, update, last or entire)
210  * @returns NULL if no jobs complete or pointer to jobs structure.
211  */
212 SHA1_HASH_CTX *
213 sha1_ctx_mgr_submit(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer, uint32_t len,
214                     HASH_CTX_FLAG flags);
215 
216 /**
217  * @brief Finish all submitted SHA1 jobs and return when complete.
218  * @requires SSE4.1 or AVX or AVX2 or AVX512
219  *
220  * @param mgr	Structure holding context level state info
221  * @returns NULL if no jobs to complete or pointer to jobs structure.
222  */
223 SHA1_HASH_CTX *
224 sha1_ctx_mgr_flush(SHA1_HASH_CTX_MGR *mgr);
225 
226 /*******************************************************************
227  * Context level API function prototypes
228  ******************************************************************/
229 
230 /**
231  * @brief Initialize the context level SHA1 multi-buffer manager structure.
232  * @requires SSE4.1
233  *
234  * @param mgr Structure holding context level state info
235  * @returns void
236  */
237 void
238 sha1_ctx_mgr_init_sse(SHA1_HASH_CTX_MGR *mgr);
239 
240 /**
241  * @brief  Submit a new SHA1 job to the context level multi-buffer manager.
242  * @requires SSE4.1
243  *
244  * @param  mgr Structure holding context level state info
245  * @param  ctx Structure holding ctx job info
246  * @param  buffer Pointer to buffer to be processed
247  * @param  len Length of buffer (in bytes) to be processed
248  * @param  flags Input flag specifying job type (first, update, last or entire)
249  * @returns NULL if no jobs complete or pointer to jobs structure.
250  */
251 SHA1_HASH_CTX *
252 sha1_ctx_mgr_submit_sse(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer,
253                         uint32_t len, HASH_CTX_FLAG flags);
254 
255 /**
256  * @brief Finish all submitted SHA1 jobs and return when complete.
257  * @requires SSE4.1
258  *
259  * @param mgr	Structure holding context level state info
260  * @returns NULL if no jobs to complete or pointer to jobs structure.
261  */
262 SHA1_HASH_CTX *
263 sha1_ctx_mgr_flush_sse(SHA1_HASH_CTX_MGR *mgr);
264 
265 /**
266  * @brief Initialize the context level SHA1 multi-buffer manager structure.
267  * @requires SSE4.1 and SHANI
268  *
269  * @param mgr Structure holding context level state info
270  * @returns void
271  */
272 void
273 sha1_ctx_mgr_init_sse_ni(SHA1_HASH_CTX_MGR *mgr);
274 
275 /**
276  * @brief  Submit a new SHA1 job to the context level multi-buffer manager.
277  * @requires SSE4.1 and SHANI
278  *
279  * @param  mgr Structure holding context level state info
280  * @param  ctx Structure holding ctx job info
281  * @param  buffer Pointer to buffer to be processed
282  * @param  len Length of buffer (in bytes) to be processed
283  * @param  flags Input flag specifying job type (first, update, last or entire)
284  * @returns NULL if no jobs complete or pointer to jobs structure.
285  */
286 SHA1_HASH_CTX *
287 sha1_ctx_mgr_submit_sse_ni(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer,
288                            uint32_t len, HASH_CTX_FLAG flags);
289 
290 /**
291  * @brief Finish all submitted SHA1 jobs and return when complete.
292  * @requires SSE4.1 and SHANI
293  *
294  * @param mgr	Structure holding context level state info
295  * @returns NULL if no jobs to complete or pointer to jobs structure.
296  */
297 SHA1_HASH_CTX *
298 sha1_ctx_mgr_flush_sse_ni(SHA1_HASH_CTX_MGR *mgr);
299 
300 /**
301  * @brief Initialize the SHA1 multi-buffer manager structure.
302  * @requires AVX
303  *
304  * @param mgr Structure holding context level state info
305  * @returns void
306  */
307 void
308 sha1_ctx_mgr_init_avx(SHA1_HASH_CTX_MGR *mgr);
309 
310 /**
311  * @brief  Submit a new SHA1 job to the multi-buffer manager.
312  * @requires AVX
313  *
314  * @param  mgr Structure holding context level state info
315  * @param  ctx Structure holding ctx job info
316  * @param  buffer Pointer to buffer to be processed
317  * @param  len Length of buffer (in bytes) to be processed
318  * @param  flags Input flag specifying job type (first, update, last or entire)
319  * @returns NULL if no jobs complete or pointer to jobs structure.
320  */
321 SHA1_HASH_CTX *
322 sha1_ctx_mgr_submit_avx(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer,
323                         uint32_t len, HASH_CTX_FLAG flags);
324 
325 /**
326  * @brief Finish all submitted SHA1 jobs and return when complete.
327  * @requires AVX
328  *
329  * @param mgr	Structure holding context level state info
330  * @returns NULL if no jobs to complete or pointer to jobs structure.
331  */
332 SHA1_HASH_CTX *
333 sha1_ctx_mgr_flush_avx(SHA1_HASH_CTX_MGR *mgr);
334 
335 /**
336  * @brief Initialize the SHA1 multi-buffer manager structure.
337  * @requires AVX2
338  *
339  * @param mgr	Structure holding context level state info
340  * @returns void
341  */
342 void
343 sha1_ctx_mgr_init_avx2(SHA1_HASH_CTX_MGR *mgr);
344 
345 /**
346  * @brief  Submit a new SHA1 job to the multi-buffer manager.
347  * @requires AVX2
348  *
349  * @param  mgr Structure holding context level state info
350  * @param  ctx Structure holding ctx job info
351  * @param  buffer Pointer to buffer to be processed
352  * @param  len Length of buffer (in bytes) to be processed
353  * @param  flags Input flag specifying job type (first, update, last or entire)
354  * @returns NULL if no jobs complete or pointer to jobs structure.
355  */
356 SHA1_HASH_CTX *
357 sha1_ctx_mgr_submit_avx2(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer,
358                          uint32_t len, HASH_CTX_FLAG flags);
359 
360 /**
361  * @brief Finish all submitted SHA1 jobs and return when complete.
362  * @requires AVX2
363  *
364  * @param mgr	Structure holding context level state info
365  * @returns NULL if no jobs to complete or pointer to jobs structure.
366  */
367 SHA1_HASH_CTX *
368 sha1_ctx_mgr_flush_avx2(SHA1_HASH_CTX_MGR *mgr);
369 
370 /**
371  * @brief Initialize the SHA1 multi-buffer manager structure.
372  * @requires AVX512
373  *
374  * @param mgr	Structure holding context level state info
375  * @returns void
376  */
377 void
378 sha1_ctx_mgr_init_avx512(SHA1_HASH_CTX_MGR *mgr);
379 
380 /**
381  * @brief  Submit a new SHA1 job to the multi-buffer manager.
382  * @requires AVX512
383  *
384  * @param  mgr Structure holding context level state info
385  * @param  ctx Structure holding ctx job info
386  * @param  buffer Pointer to buffer to be processed
387  * @param  len Length of buffer (in bytes) to be processed
388  * @param  flags Input flag specifying job type (first, update, last or entire)
389  * @returns NULL if no jobs complete or pointer to jobs structure.
390  */
391 SHA1_HASH_CTX *
392 sha1_ctx_mgr_submit_avx512(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer,
393                            uint32_t len, HASH_CTX_FLAG flags);
394 
395 /**
396  * @brief Finish all submitted SHA1 jobs and return when complete.
397  * @requires AVX512
398  *
399  * @param mgr	Structure holding context level state info
400  * @returns NULL if no jobs to complete or pointer to jobs structure.
401  */
402 SHA1_HASH_CTX *
403 sha1_ctx_mgr_flush_avx512(SHA1_HASH_CTX_MGR *mgr);
404 
405 /**
406  * @brief Initialize the SHA1 multi-buffer manager structure.
407  * @requires AVX512 and SHANI
408  *
409  * @param mgr	Structure holding context level state info
410  * @returns void
411  */
412 void
413 sha1_ctx_mgr_init_avx512_ni(SHA1_HASH_CTX_MGR *mgr);
414 
415 /**
416  * @brief  Submit a new SHA1 job to the multi-buffer manager.
417  * @requires AVX512 and SHANI
418  *
419  * @param  mgr Structure holding context level state info
420  * @param  ctx Structure holding ctx job info
421  * @param  buffer Pointer to buffer to be processed
422  * @param  len Length of buffer (in bytes) to be processed
423  * @param  flags Input flag specifying job type (first, update, last or entire)
424  * @returns NULL if no jobs complete or pointer to jobs structure.
425  */
426 SHA1_HASH_CTX *
427 sha1_ctx_mgr_submit_avx512_ni(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx, const void *buffer,
428                               uint32_t len, HASH_CTX_FLAG flags);
429 
430 /**
431  * @brief Finish all submitted SHA1 jobs and return when complete.
432  * @requires AVX512 and SHANI
433  *
434  * @param mgr	Structure holding context level state info
435  * @returns NULL if no jobs to complete or pointer to jobs structure.
436  */
437 SHA1_HASH_CTX *
438 sha1_ctx_mgr_flush_avx512_ni(SHA1_HASH_CTX_MGR *mgr);
439 
440 /**
441  * @brief Initialize the SHA1 multi-buffer manager structure.
442  * @requires SSE4.1 for x86 or ASIMD for ARM
443  *
444  * @param[in] mgr Structure holding context level state info
445  * @return Operation status
446  * @retval 0 on success
447  * @retval Non-zero \a ISAL_CRYPTO_ERR on failure
448  */
449 int
450 isal_sha1_ctx_mgr_init(SHA1_HASH_CTX_MGR *mgr);
451 
452 /**
453  * @brief  Submit a new SHA1 job to the multi-buffer manager.
454  * @requires SSE4.1 for x86 or ASIMD for ARM
455  * @param[in] mgr Structure holding context level state info
456  * @param[in] ctx_in Structure holding ctx job info
457  * @param[out] ctx_out	Pointer address to output job ctx info.
458  *			Modified to point to completed job structure or
459  *			NULL if no jobs completed.
460  * @param[in] buffer Pointer to buffer to be processed
461  * @param[in] len Length of buffer (in bytes) to be processed
462  * @param[in] flags Input flag specifying job type (first, update, last or entire)
463  * @return Operation status
464  * @retval 0 on success
465  * @retval Non-zero \a ISAL_CRYPTO_ERR on failure
466  */
467 int
468 isal_sha1_ctx_mgr_submit(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX *ctx_in, SHA1_HASH_CTX **ctx_out,
469                          const void *buffer, const uint32_t len, const HASH_CTX_FLAG flags);
470 
471 /**
472  * @brief Finish all submitted SHA1 jobs and return when complete.
473  * @requires SSE4.1 for x86 or ASIMD for ARM
474  *
475  * @param[in] mgr Structure holding context level state info
476  * @param[out] ctx_out	Pointer address to output job ctx info.
477  *			Modified to point to completed job structure or
478  *			NULL if no jobs completed.
479  * @return Operation status
480  * @retval 0 on success
481  * @retval Non-zero \a ISAL_CRYPTO_ERR on failure
482  */
483 int
484 isal_sha1_ctx_mgr_flush(SHA1_HASH_CTX_MGR *mgr, SHA1_HASH_CTX **ctx_out);
485 
486 /*******************************************************************
487  * Scheduler (internal) level out-of-order function prototypes
488  ******************************************************************/
489 
490 void
491 sha1_mb_mgr_init_sse(SHA1_MB_JOB_MGR *state);
492 SHA1_JOB *
493 sha1_mb_mgr_submit_sse(SHA1_MB_JOB_MGR *state, SHA1_JOB *job);
494 SHA1_JOB *
495 sha1_mb_mgr_flush_sse(SHA1_MB_JOB_MGR *state);
496 
497 #define sha1_mb_mgr_init_avx sha1_mb_mgr_init_sse
498 SHA1_JOB *
499 sha1_mb_mgr_submit_avx(SHA1_MB_JOB_MGR *state, SHA1_JOB *job);
500 SHA1_JOB *
501 sha1_mb_mgr_flush_avx(SHA1_MB_JOB_MGR *state);
502 
503 void
504 sha1_mb_mgr_init_avx2(SHA1_MB_JOB_MGR *state);
505 SHA1_JOB *
506 sha1_mb_mgr_submit_avx2(SHA1_MB_JOB_MGR *state, SHA1_JOB *job);
507 SHA1_JOB *
508 sha1_mb_mgr_flush_avx2(SHA1_MB_JOB_MGR *state);
509 
510 void
511 sha1_mb_mgr_init_avx512(SHA1_MB_JOB_MGR *state);
512 SHA1_JOB *
513 sha1_mb_mgr_submit_avx512(SHA1_MB_JOB_MGR *state, SHA1_JOB *job);
514 SHA1_JOB *
515 sha1_mb_mgr_flush_avx512(SHA1_MB_JOB_MGR *state);
516 
517 void
518 sha1_mb_mgr_init_sse_ni(SHA1_MB_JOB_MGR *state);
519 SHA1_JOB *
520 sha1_mb_mgr_submit_sse_ni(SHA1_MB_JOB_MGR *state, SHA1_JOB *job);
521 SHA1_JOB *
522 sha1_mb_mgr_flush_sse_ni(SHA1_MB_JOB_MGR *state);
523 
524 void
525 sha1_mb_mgr_init_avx512_ni(SHA1_MB_JOB_MGR *state);
526 SHA1_JOB *
527 sha1_mb_mgr_submit_avx512_ni(SHA1_MB_JOB_MGR *state, SHA1_JOB *job);
528 SHA1_JOB *
529 sha1_mb_mgr_flush_avx512_ni(SHA1_MB_JOB_MGR *state);
530 
531 #ifdef __cplusplus
532 }
533 #endif
534 
535 #endif // _SHA1_MB_H_
536