forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: hash - Added scatter list walking helper
This patch adds the walking helpers for hash algorithms akin to those of block ciphers. This is a necessary step before we can reimplement existing hash algorithms using the new ahash interface. Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information
Showing
2 changed files
with
131 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Hash algorithms. | ||
* | ||
* Copyright (c) 2008 Herbert Xu <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the Free | ||
* Software Foundation; either version 2 of the License, or (at your option) | ||
* any later version. | ||
* | ||
*/ | ||
|
||
#ifndef _CRYPTO_INTERNAL_HASH_H | ||
#define _CRYPTO_INTERNAL_HASH_H | ||
|
||
#include <crypto/algapi.h> | ||
|
||
struct ahash_request; | ||
struct scatterlist; | ||
|
||
struct crypto_hash_walk { | ||
char *data; | ||
|
||
unsigned int offset; | ||
unsigned int alignmask; | ||
|
||
struct page *pg; | ||
unsigned int entrylen; | ||
|
||
unsigned int total; | ||
struct scatterlist *sg; | ||
|
||
unsigned int flags; | ||
}; | ||
|
||
int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); | ||
int crypto_hash_walk_first(struct ahash_request *req, | ||
struct crypto_hash_walk *walk); | ||
|
||
#endif /* _CRYPTO_INTERNAL_HASH_H */ | ||
|