hwrng: atmel - disable TRNG during suspend
[linux-2.6-block.git] / crypto / gcm.c
index 70a892e87ccb527d774c8aba72463813faca8b22..39c261d819af1c746fb7d2e162e61c329d15e7ef 100644 (file)
@@ -117,7 +117,7 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,
        struct crypto_skcipher *ctr = ctx->ctr;
        struct {
                be128 hash;
-               u8 iv[8];
+               u8 iv[16];
 
                struct crypto_gcm_setkey_result result;
 
@@ -672,11 +672,11 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl,
        ctr = crypto_spawn_skcipher_alg(&ctx->ctr);
 
        /* We only support 16-byte blocks. */
+       err = -EINVAL;
        if (crypto_skcipher_alg_ivsize(ctr) != 16)
                goto out_put_ctr;
 
        /* Not a stream cipher? */
-       err = -EINVAL;
        if (ctr->base.cra_blocksize != 1)
                goto out_put_ctr;