Re: [CRYPTO] blkcipher: Add IV generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 29, 2007 at 09:36:48PM +0800, Herbert Xu wrote:
> 
> [CRYPTO] blkcipher: Remove alignment restriction on block size
> 
> Previously we assumed for convenience that the block size is a multiple of
> the algorithm's required alignment.  With the pending addition of CTR this
> will no longer be the case as the block size will be 1 due to it being a
> stream cipher.  However, the alignment requirement will be that of the
> underlying implementation which will most likely be greater than 1.
> 
> Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

That patch missed one spot.  Here's a fix on top of it.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
319f8a1dff903a7f8b9853bd229abbc13e7fad71
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index ea9e240..1b2a14a 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -158,7 +158,7 @@ static inline int blkcipher_next_slow(struct blkcipher_desc *desc,
 	if (walk->buffer)
 		goto ok;
 
-	n = bsize * 3 - (alignmask + 1) +
+	n = aligned_bsize * 3 - (alignmask + 1) +
 	    (alignmask & ~(crypto_tfm_ctx_alignment() - 1));
 	walk->buffer = kmalloc(n, GFP_ATOMIC);
 	if (!walk->buffer)
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux