Copyright(c) 2011-2016 Intel Corporation All rights reserved.
Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
+ modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
SHA1_JOB job; // Must be at struct offset 0.
HASH_CTX_STS status; //!< Context status flag
HASH_CTX_ERROR error; //!< Context error flag
- uint32_t total_length; //!< Running counter of length processed for this CTX's job
+ uint64_t total_length; //!< Running counter of length processed for this CTX's job
const void* incoming_buffer; //!< pointer to data input buffer for this CTX's job
uint32_t incoming_buffer_length; //!< length of buffer for this job in bytes.
uint8_t partial_block_buffer[SHA1_BLOCK_SIZE * 2]; //!< CTX partial blocks
void* user_data; //!< pointer for user to keep any job-related data
} SHA1_HASH_CTX;
+/******************** multibinary function prototypes **********************/
+
+/**
+ * @brief Initialize the SHA1 multi-buffer manager structure.
+ * @requires SSE4.1 or AVX or AVX2 or AVX512
+ *
+ * @param mgr Structure holding context level state info
+ * @returns void
+ */
+void sha1_ctx_mgr_init (SHA1_HASH_CTX_MGR* mgr);
+
+/**
+ * @brief Submit a new SHA1 job to the multi-buffer manager.
+ * @requires SSE4.1 or AVX or AVX2 or AVX512
+ *
+ * @param mgr Structure holding context level state info
+ * @param ctx Structure holding ctx job info
+ * @param buffer Pointer to buffer to be processed
+ * @param len Length of buffer (in bytes) to be processed
+ * @param flags Input flag specifying job type (first, update, last or entire)
+ * @returns NULL if no jobs complete or pointer to jobs structure.
+ */
+SHA1_HASH_CTX* sha1_ctx_mgr_submit (SHA1_HASH_CTX_MGR* mgr, SHA1_HASH_CTX* ctx,
+ const void* buffer, uint32_t len, HASH_CTX_FLAG flags);
+
+/**
+ * @brief Finish all submitted SHA1 jobs and return when complete.
+ * @requires SSE4.1 or AVX or AVX2 or AVX512
+ *
+ * @param mgr Structure holding context level state info
+ * @returns NULL if no jobs to complete or pointer to jobs structure.
+ */
+SHA1_HASH_CTX* sha1_ctx_mgr_flush (SHA1_HASH_CTX_MGR* mgr);
+
+
/*******************************************************************
* Context level API function prototypes
******************************************************************/
*/
SHA1_HASH_CTX* sha1_ctx_mgr_flush_sse (SHA1_HASH_CTX_MGR* mgr);
+/**
+ * @brief Initialize the context level SHA1 multi-buffer manager structure.
+ * @requires SSE4.1 and SHANI
+ *
+ * @param mgr Structure holding context level state info
+ * @returns void
+ */
+void sha1_ctx_mgr_init_sse_ni (SHA1_HASH_CTX_MGR* mgr);
+
+/**
+ * @brief Submit a new SHA1 job to the context level multi-buffer manager.
+ * @requires SSE4.1 and SHANI
+ *
+ * @param mgr Structure holding context level state info
+ * @param ctx Structure holding ctx job info
+ * @param buffer Pointer to buffer to be processed
+ * @param len Length of buffer (in bytes) to be processed
+ * @param flags Input flag specifying job type (first, update, last or entire)
+ * @returns NULL if no jobs complete or pointer to jobs structure.
+ */
+SHA1_HASH_CTX* sha1_ctx_mgr_submit_sse_ni (SHA1_HASH_CTX_MGR* mgr, SHA1_HASH_CTX* ctx,
+ const void* buffer, uint32_t len, HASH_CTX_FLAG flags);
+
+/**
+ * @brief Finish all submitted SHA1 jobs and return when complete.
+ * @requires SSE4.1 and SHANI
+ *
+ * @param mgr Structure holding context level state info
+ * @returns NULL if no jobs to complete or pointer to jobs structure.
+ */
+SHA1_HASH_CTX* sha1_ctx_mgr_flush_sse_ni (SHA1_HASH_CTX_MGR* mgr);
+
/**
* @brief Initialize the SHA1 multi-buffer manager structure.
* @requires AVX
*/
SHA1_HASH_CTX* sha1_ctx_mgr_flush_avx512 (SHA1_HASH_CTX_MGR* mgr);
-/******************** multibinary function prototypes **********************/
-
/**
* @brief Initialize the SHA1 multi-buffer manager structure.
- * @requires SSE4.1 or AVX or AVX2 or AVX512
+ * @requires AVX512 and SHANI
*
- * @param mgr Structure holding context level state info
+ * @param mgr Structure holding context level state info
* @returns void
*/
-void sha1_ctx_mgr_init (SHA1_HASH_CTX_MGR* mgr);
+void sha1_ctx_mgr_init_avx512_ni (SHA1_HASH_CTX_MGR* mgr);
/**
* @brief Submit a new SHA1 job to the multi-buffer manager.
- * @requires SSE4.1 or AVX or AVX2 or AVX512
+ * @requires AVX512 and SHANI
*
* @param mgr Structure holding context level state info
* @param ctx Structure holding ctx job info
* @param flags Input flag specifying job type (first, update, last or entire)
* @returns NULL if no jobs complete or pointer to jobs structure.
*/
-SHA1_HASH_CTX* sha1_ctx_mgr_submit (SHA1_HASH_CTX_MGR* mgr, SHA1_HASH_CTX* ctx,
+SHA1_HASH_CTX* sha1_ctx_mgr_submit_avx512_ni (SHA1_HASH_CTX_MGR* mgr, SHA1_HASH_CTX* ctx,
const void* buffer, uint32_t len, HASH_CTX_FLAG flags);
/**
* @brief Finish all submitted SHA1 jobs and return when complete.
- * @requires SSE4.1 or AVX or AVX2 or AVX512
+ * @requires AVX512 and SHANI
*
* @param mgr Structure holding context level state info
* @returns NULL if no jobs to complete or pointer to jobs structure.
*/
-SHA1_HASH_CTX* sha1_ctx_mgr_flush (SHA1_HASH_CTX_MGR* mgr);
+SHA1_HASH_CTX* sha1_ctx_mgr_flush_avx512_ni (SHA1_HASH_CTX_MGR* mgr);
/*******************************************************************
SHA1_JOB* sha1_mb_mgr_submit_avx512 (SHA1_MB_JOB_MGR *state, SHA1_JOB* job);
SHA1_JOB* sha1_mb_mgr_flush_avx512 (SHA1_MB_JOB_MGR *state);
+void sha1_mb_mgr_init_sse_ni (SHA1_MB_JOB_MGR *state);
+SHA1_JOB* sha1_mb_mgr_submit_sse_ni (SHA1_MB_JOB_MGR *state, SHA1_JOB* job);
+SHA1_JOB* sha1_mb_mgr_flush_sse_ni (SHA1_MB_JOB_MGR *state);
+
+void sha1_mb_mgr_init_avx512_ni (SHA1_MB_JOB_MGR *state);
+SHA1_JOB* sha1_mb_mgr_submit_avx512_ni (SHA1_MB_JOB_MGR *state, SHA1_JOB* job);
+SHA1_JOB* sha1_mb_mgr_flush_avx512_ni (SHA1_MB_JOB_MGR *state);
+
#ifdef __cplusplus
}
#endif