Skip to content

Commit cd5a4d5

Browse files
committed
crypto: hash - Move core export and import into internel/hash.h
The core export and import functions are targeted at implementors so move them into internal/hash.h. Signed-off-by: Herbert Xu <[email protected]>
1 parent 7d39f32 commit cd5a4d5

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

include/crypto/hash.h

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -506,18 +506,6 @@ int crypto_ahash_digest(struct ahash_request *req);
506506
*/
507507
int crypto_ahash_export(struct ahash_request *req, void *out);
508508

509-
/**
510-
* crypto_ahash_export_core() - extract core state for message digest
511-
* @req: reference to the ahash_request handle whose state is exported
512-
* @out: output buffer of sufficient size that can hold the hash state
513-
*
514-
* Export the hash state without the partial block buffer.
515-
*
516-
* Context: Softirq or process context.
517-
* Return: 0 if the export creation was successful; < 0 if an error occurred
518-
*/
519-
int crypto_ahash_export_core(struct ahash_request *req, void *out);
520-
521509
/**
522510
* crypto_ahash_import() - import message digest state
523511
* @req: reference to ahash_request handle the state is imported into
@@ -531,18 +519,6 @@ int crypto_ahash_export_core(struct ahash_request *req, void *out);
531519
*/
532520
int crypto_ahash_import(struct ahash_request *req, const void *in);
533521

534-
/**
535-
* crypto_ahash_import_core() - import core state
536-
* @req: reference to ahash_request handle the state is imported into
537-
* @in: buffer holding the state
538-
*
539-
* Import the hash state without the partial block buffer.
540-
*
541-
* Context: Softirq or process context.
542-
* Return: 0 if the import was successful; < 0 if an error occurred
543-
*/
544-
int crypto_ahash_import_core(struct ahash_request *req, const void *in);
545-
546522
/**
547523
* crypto_ahash_init() - (re)initialize message digest handle
548524
* @req: ahash_request handle that already is initialized with all necessary
@@ -933,18 +909,6 @@ int crypto_hash_digest(struct crypto_ahash *tfm, const u8 *data,
933909
*/
934910
int crypto_shash_export(struct shash_desc *desc, void *out);
935911

936-
/**
937-
* crypto_shash_export_core() - extract core state for message digest
938-
* @desc: reference to the operational state handle whose state is exported
939-
* @out: output buffer of sufficient size that can hold the hash state
940-
*
941-
* Export the hash state without the partial block buffer.
942-
*
943-
* Context: Softirq or process context.
944-
* Return: 0 if the export creation was successful; < 0 if an error occurred
945-
*/
946-
int crypto_shash_export_core(struct shash_desc *desc, void *out);
947-
948912
/**
949913
* crypto_shash_import() - import operational state
950914
* @desc: reference to the operational state handle the state imported into
@@ -959,18 +923,6 @@ int crypto_shash_export_core(struct shash_desc *desc, void *out);
959923
*/
960924
int crypto_shash_import(struct shash_desc *desc, const void *in);
961925

962-
/**
963-
* crypto_shash_import_core() - import core state
964-
* @desc: reference to the operational state handle the state imported into
965-
* @in: buffer holding the state
966-
*
967-
* Import the hash state without the partial block buffer.
968-
*
969-
* Context: Softirq or process context.
970-
* Return: 0 if the import was successful; < 0 if an error occurred
971-
*/
972-
int crypto_shash_import_core(struct shash_desc *desc, const void *in);
973-
974926
/**
975927
* crypto_shash_init() - (re)initialize message digest
976928
* @desc: operational state handle that is already filled

include/crypto/internal/hash.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,5 +305,53 @@ static inline unsigned int crypto_shash_coresize(struct crypto_shash *tfm)
305305
#define HASH_REQUEST_ZERO(name) \
306306
memzero_explicit(__##name##_req, sizeof(__##name##_req))
307307

308+
/**
309+
* crypto_ahash_export_core() - extract core state for message digest
310+
* @req: reference to the ahash_request handle whose state is exported
311+
* @out: output buffer of sufficient size that can hold the hash state
312+
*
313+
* Export the hash state without the partial block buffer.
314+
*
315+
* Context: Softirq or process context.
316+
* Return: 0 if the export creation was successful; < 0 if an error occurred
317+
*/
318+
int crypto_ahash_export_core(struct ahash_request *req, void *out);
319+
320+
/**
321+
* crypto_ahash_import_core() - import core state
322+
* @req: reference to ahash_request handle the state is imported into
323+
* @in: buffer holding the state
324+
*
325+
* Import the hash state without the partial block buffer.
326+
*
327+
* Context: Softirq or process context.
328+
* Return: 0 if the import was successful; < 0 if an error occurred
329+
*/
330+
int crypto_ahash_import_core(struct ahash_request *req, const void *in);
331+
332+
/**
333+
* crypto_shash_export_core() - extract core state for message digest
334+
* @desc: reference to the operational state handle whose state is exported
335+
* @out: output buffer of sufficient size that can hold the hash state
336+
*
337+
* Export the hash state without the partial block buffer.
338+
*
339+
* Context: Softirq or process context.
340+
* Return: 0 if the export creation was successful; < 0 if an error occurred
341+
*/
342+
int crypto_shash_export_core(struct shash_desc *desc, void *out);
343+
344+
/**
345+
* crypto_shash_import_core() - import core state
346+
* @desc: reference to the operational state handle the state imported into
347+
* @in: buffer holding the state
348+
*
349+
* Import the hash state without the partial block buffer.
350+
*
351+
* Context: Softirq or process context.
352+
* Return: 0 if the import was successful; < 0 if an error occurred
353+
*/
354+
int crypto_shash_import_core(struct shash_desc *desc, const void *in);
355+
308356
#endif /* _CRYPTO_INTERNAL_HASH_H */
309357

0 commit comments

Comments
 (0)