]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - crypto/xcbc.c
Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
[linux.git] / crypto / xcbc.c
index 25c75af50d3feee683703b47da1f2f08004eb3f4..c055f57fab11aa927069f7610b03f99eb0e09d55 100644 (file)
@@ -57,15 +57,17 @@ struct xcbc_desc_ctx {
        u8 ctx[];
 };
 
+#define XCBC_BLOCKSIZE 16
+
 static int crypto_xcbc_digest_setkey(struct crypto_shash *parent,
                                     const u8 *inkey, unsigned int keylen)
 {
        unsigned long alignmask = crypto_shash_alignmask(parent);
        struct xcbc_tfm_ctx *ctx = crypto_shash_ctx(parent);
-       int bs = crypto_shash_blocksize(parent);
        u8 *consts = PTR_ALIGN(&ctx->ctx[0], alignmask + 1);
        int err = 0;
-       u8 key1[bs];
+       u8 key1[XCBC_BLOCKSIZE];
+       int bs = sizeof(key1);
 
        if ((err = crypto_cipher_setkey(ctx->child, inkey, keylen)))
                return err;
@@ -212,7 +214,7 @@ static int xcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
                return PTR_ERR(alg);
 
        switch(alg->cra_blocksize) {
-       case 16:
+       case XCBC_BLOCKSIZE:
                break;
        default:
                goto out_put_alg;