diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-14 08:29:57 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-14 08:29:57 -0400 |
commit | 500b3e3c3dc8e4845b77ae81e5b7b085ab183ce6 (patch) | |
tree | 0cd5ceeab5a085ba017e535b8a232780c0850aaf /crypto/ahash.c | |
parent | 4dc10c0142ce0af8c20ec44dc6928ae63ad4f73a (diff) |
crypto: ahash - Remove old_ahash_alg
Now that all ahash implementations have been converted to the new
ahash type, we can remove old_ahash_alg and its associated support.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ahash.c')
-rw-r--r-- | crypto/ahash.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c index 7f599d26086a..cc824ef25830 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c | |||
@@ -175,46 +175,19 @@ static int ahash_nosetkey(struct crypto_ahash *tfm, const u8 *key, | |||
175 | return -ENOSYS; | 175 | return -ENOSYS; |
176 | } | 176 | } |
177 | 177 | ||
178 | static int crypto_init_ahash_ops(struct crypto_tfm *tfm, u32 type, u32 mask) | ||
179 | { | ||
180 | struct old_ahash_alg *alg = &tfm->__crt_alg->cra_ahash; | ||
181 | struct crypto_ahash *crt = __crypto_ahash_cast(tfm); | ||
182 | struct ahash_alg *nalg = crypto_ahash_alg(crt); | ||
183 | |||
184 | if (alg->digestsize > PAGE_SIZE / 8) | ||
185 | return -EINVAL; | ||
186 | |||
187 | crt->init = alg->init; | ||
188 | crt->update = alg->update; | ||
189 | crt->final = alg->final; | ||
190 | crt->digest = alg->digest; | ||
191 | crt->setkey = alg->setkey ? ahash_setkey : ahash_nosetkey; | ||
192 | crt->digestsize = alg->digestsize; | ||
193 | |||
194 | nalg->setkey = alg->setkey; | ||
195 | nalg->halg.digestsize = alg->digestsize; | ||
196 | |||
197 | return 0; | ||
198 | } | ||
199 | |||
200 | static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) | 178 | static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) |
201 | { | 179 | { |
202 | struct crypto_ahash *hash = __crypto_ahash_cast(tfm); | 180 | struct crypto_ahash *hash = __crypto_ahash_cast(tfm); |
203 | struct ahash_alg *alg = crypto_ahash_alg(hash); | 181 | struct ahash_alg *alg = crypto_ahash_alg(hash); |
204 | struct old_ahash_alg *oalg = crypto_old_ahash_alg(hash); | ||
205 | 182 | ||
206 | if (tfm->__crt_alg->cra_type != &crypto_ahash_type) | 183 | if (tfm->__crt_alg->cra_type != &crypto_ahash_type) |
207 | return crypto_init_shash_ops_async(tfm); | 184 | return crypto_init_shash_ops_async(tfm); |
208 | 185 | ||
209 | if (oalg->init) | ||
210 | return crypto_init_ahash_ops(tfm, 0, 0); | ||
211 | |||
212 | hash->init = alg->init; | 186 | hash->init = alg->init; |
213 | hash->update = alg->update; | 187 | hash->update = alg->update; |
214 | hash->final = alg->final; | 188 | hash->final = alg->final; |
215 | hash->digest = alg->digest; | 189 | hash->digest = alg->digest; |
216 | hash->setkey = alg->setkey ? ahash_setkey : ahash_nosetkey; | 190 | hash->setkey = alg->setkey ? ahash_setkey : ahash_nosetkey; |
217 | hash->digestsize = alg->halg.digestsize; | ||
218 | 191 | ||
219 | return 0; | 192 | return 0; |
220 | } | 193 | } |