Skip to content

Commit 8afa25a

Browse files
weiny2herbertx
authored andcommitted
crypto: hash - Remove unused async iterators
Revert "crypto: hash - Add real ahash walk interface" This reverts commit 75ecb23. The callers of the functions in this commit were removed in ab8085c Remove these unused calls. Fixes: ab8085c ("crypto: x86 - remove SHA multibuffer routines and mcryptd") Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5d1cdfd commit 8afa25a

2 files changed

Lines changed: 4 additions & 50 deletions

File tree

‎crypto/ahash.c‎

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include <crypto/internal/hash.h>
1212
#include <crypto/scatterwalk.h>
13-
#include <linux/bug.h>
1413
#include <linux/err.h>
1514
#include <linux/kernel.h>
1615
#include <linux/module.h>
@@ -46,10 +45,7 @@ static int hash_walk_next(struct crypto_hash_walk *walk)
4645
unsigned int nbytes = min(walk->entrylen,
4746
((unsigned int)(PAGE_SIZE)) - offset);
4847

49-
if (walk->flags & CRYPTO_ALG_ASYNC)
50-
walk->data = kmap(walk->pg);
51-
else
52-
walk->data = kmap_atomic(walk->pg);
48+
walk->data = kmap_atomic(walk->pg);
5349
walk->data += offset;
5450

5551
if (offset & alignmask) {
@@ -99,16 +95,8 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
9995
}
10096
}
10197

102-
if (walk->flags & CRYPTO_ALG_ASYNC)
103-
kunmap(walk->pg);
104-
else {
105-
kunmap_atomic(walk->data);
106-
/*
107-
* The may sleep test only makes sense for sync users.
108-
* Async users don't need to sleep here anyway.
109-
*/
110-
crypto_yield(walk->flags);
111-
}
98+
kunmap_atomic(walk->data);
99+
crypto_yield(walk->flags);
112100

113101
if (err)
114102
return err;
@@ -140,33 +128,12 @@ int crypto_hash_walk_first(struct ahash_request *req,
140128

141129
walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req));
142130
walk->sg = req->src;
143-
walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK;
131+
walk->flags = req->base.flags;
144132

145133
return hash_walk_new_entry(walk);
146134
}
147135
EXPORT_SYMBOL_GPL(crypto_hash_walk_first);
148136

149-
int crypto_ahash_walk_first(struct ahash_request *req,
150-
struct crypto_hash_walk *walk)
151-
{
152-
walk->total = req->nbytes;
153-
154-
if (!walk->total) {
155-
walk->entrylen = 0;
156-
return 0;
157-
}
158-
159-
walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req));
160-
walk->sg = req->src;
161-
walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK;
162-
walk->flags |= CRYPTO_ALG_ASYNC;
163-
164-
BUILD_BUG_ON(CRYPTO_TFM_REQ_MASK & CRYPTO_ALG_ASYNC);
165-
166-
return hash_walk_new_entry(walk);
167-
}
168-
EXPORT_SYMBOL_GPL(crypto_ahash_walk_first);
169-
170137
static int ahash_setkey_unaligned(struct crypto_ahash *tfm, const u8 *key,
171138
unsigned int keylen)
172139
{

‎include/crypto/internal/hash.h‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,12 @@ struct crypto_shash_spawn {
6262
int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err);
6363
int crypto_hash_walk_first(struct ahash_request *req,
6464
struct crypto_hash_walk *walk);
65-
int crypto_ahash_walk_first(struct ahash_request *req,
66-
struct crypto_hash_walk *walk);
67-
68-
static inline int crypto_ahash_walk_done(struct crypto_hash_walk *walk,
69-
int err)
70-
{
71-
return crypto_hash_walk_done(walk, err);
72-
}
7365

7466
static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk)
7567
{
7668
return !(walk->entrylen | walk->total);
7769
}
7870

79-
static inline int crypto_ahash_walk_last(struct crypto_hash_walk *walk)
80-
{
81-
return crypto_hash_walk_last(walk);
82-
}
83-
8471
int crypto_register_ahash(struct ahash_alg *alg);
8572
void crypto_unregister_ahash(struct ahash_alg *alg);
8673
int crypto_register_ahashes(struct ahash_alg *algs, int count);

0 commit comments

Comments
 (0)