[CRYPTO] api: Add crypto_inc and crypto_xor
[powerpc.git] / crypto / blkcipher.c
index f6c67f9..180d914 100644 (file)
@@ -433,9 +433,8 @@ static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg, u32 type,
        struct blkcipher_alg *cipher = &alg->cra_blkcipher;
        unsigned int len = alg->cra_ctxsize;
 
-       type ^= CRYPTO_ALG_ASYNC;
-       mask &= CRYPTO_ALG_ASYNC;
-       if ((type & mask) && cipher->ivsize) {
+       if ((mask & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_MASK &&
+           cipher->ivsize) {
                len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1);
                len += cipher->ivsize;
        }
@@ -482,9 +481,7 @@ static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
        if (alg->ivsize > PAGE_SIZE / 8)
                return -EINVAL;
 
-       type ^= CRYPTO_ALG_ASYNC;
-       mask &= CRYPTO_ALG_ASYNC;
-       if (type & mask)
+       if ((mask & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_MASK)
                return crypto_init_blkcipher_ops_sync(tfm);
        else
                return crypto_init_blkcipher_ops_async(tfm);