#include <crypto/internal/hash.h>
#include <crypto/scatterwalk.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/cryptouser.h>
#include <linux/compiler.h>
struct ahash_request_priv {
crypto_completion_t complete;
void *ubuf[] CRYPTO_MINALIGN_ATTR;
static inline struct ahash_alg *crypto_ahash_alg(struct crypto_ahash *hash)
return container_of(crypto_hash_alg_common(hash), struct ahash_alg,
static int hash_walk_next(struct crypto_hash_walk *walk)
unsigned int alignmask = walk->alignmask;
unsigned int offset = walk->offset;
unsigned int nbytes = min(walk->entrylen,
((unsigned int)(PAGE_SIZE)) - offset);
if (walk->flags & CRYPTO_ALG_ASYNC)
walk->data = kmap(walk->pg);
walk->data = kmap_atomic(walk->pg);
if (offset & alignmask) {
unsigned int unaligned = alignmask + 1 - (offset & alignmask);
walk->entrylen -= nbytes;