Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: ahash - make hash walk functions from ahash.c public

Make the hash walk functions
crypto_hash_walk_done()
crypto_hash_walk_first()
crypto_hash_walk_last()
public again.
These functions had been removed from the header file
include/crypto/internal/hash.h with commit 7fa481734016
("crypto: ahash - make hash walk functions private to ahash.c")
as there was no crypto algorithm code using them.

With the upcoming crypto implementation for s390 phmac
these functions will be exploited and thus need to be
public within the kernel again.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Harald Freudenberger and committed by
Herbert Xu
2f8839e6 fa13f1d7

+28 -21
+5 -21
crypto/ahash.c
··· 29 29 30 30 #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000e 31 31 32 - struct crypto_hash_walk { 33 - const char *data; 34 - 35 - unsigned int offset; 36 - unsigned int flags; 37 - 38 - struct page *pg; 39 - unsigned int entrylen; 40 - 41 - unsigned int total; 42 - struct scatterlist *sg; 43 - }; 44 - 45 32 static int ahash_def_finup(struct ahash_request *req); 46 33 47 34 static inline bool crypto_ahash_block_only(struct crypto_ahash *tfm) ··· 99 112 return hash_walk_next(walk); 100 113 } 101 114 102 - static int crypto_hash_walk_first(struct ahash_request *req, 103 - struct crypto_hash_walk *walk) 115 + int crypto_hash_walk_first(struct ahash_request *req, 116 + struct crypto_hash_walk *walk) 104 117 { 105 118 walk->total = req->nbytes; 106 119 walk->entrylen = 0; ··· 120 133 121 134 return hash_walk_new_entry(walk); 122 135 } 136 + EXPORT_SYMBOL_GPL(crypto_hash_walk_first); 123 137 124 - static int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) 138 + int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) 125 139 { 126 140 if ((walk->flags & CRYPTO_AHASH_REQ_VIRT)) 127 141 return err; ··· 148 160 149 161 return hash_walk_new_entry(walk); 150 162 } 151 - 152 - static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk) 153 - { 154 - return !(walk->entrylen | walk->total); 155 - } 163 + EXPORT_SYMBOL_GPL(crypto_hash_walk_done); 156 164 157 165 /* 158 166 * For an ahash tfm that is using an shash algorithm (instead of an ahash
+23
include/crypto/internal/hash.h
··· 30 30 __##name##_req, (req)) 31 31 32 32 struct ahash_request; 33 + struct scatterlist; 34 + 35 + struct crypto_hash_walk { 36 + const char *data; 37 + 38 + unsigned int offset; 39 + unsigned int flags; 40 + 41 + struct page *pg; 42 + unsigned int entrylen; 43 + 44 + unsigned int total; 45 + struct scatterlist *sg; 46 + }; 33 47 34 48 struct ahash_instance { 35 49 void (*free)(struct ahash_instance *inst); ··· 74 60 struct crypto_shash_spawn { 75 61 struct crypto_spawn base; 76 62 }; 63 + 64 + int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); 65 + int crypto_hash_walk_first(struct ahash_request *req, 66 + struct crypto_hash_walk *walk); 67 + 68 + static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk) 69 + { 70 + return !(walk->entrylen | walk->total); 71 + } 77 72 78 73 int crypto_register_ahash(struct ahash_alg *alg); 79 74 void crypto_unregister_ahash(struct ahash_alg *alg);