X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=crypto%2Fahash.c;fp=crypto%2Fahash.c;h=96fec0ca202af9c5211027f818f9449ec55bf489;hb=85b84327b3f0df32be19e01257fb375972be115c;hp=74be1eb26c1aacdd42190cba352e7201db30164f;hpb=ecf889b70b6c0a174965a902a381f967bfd06914;p=linux-2.6-block.git diff --git a/crypto/ahash.c b/crypto/ahash.c index 74be1eb26c1a..96fec0ca202a 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -27,8 +27,6 @@ #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000e -static const struct crypto_type crypto_ahash_type; - static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, unsigned int keylen) { @@ -511,7 +509,7 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) crypto_ahash_set_statesize(hash, alg->halg.statesize); - if (tfm->__crt_alg->cra_type != &crypto_ahash_type) + if (tfm->__crt_alg->cra_type == &crypto_shash_type) return crypto_init_shash_ops_async(tfm); hash->init = alg->init; @@ -535,7 +533,7 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) { - if (alg->cra_type != &crypto_ahash_type) + if (alg->cra_type == &crypto_shash_type) return sizeof(struct crypto_shash *); return crypto_alg_extsize(alg); @@ -760,7 +758,7 @@ bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg) { struct crypto_alg *alg = &halg->base; - if (alg->cra_type != &crypto_ahash_type) + if (alg->cra_type == &crypto_shash_type) return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); return __crypto_ahash_alg(alg)->setkey != NULL;