* If the key or authentication tag size couldn't be set, no need to
         * continue to encrypt.
         */
+       vec->crypt_error = 0;
        if (vec->setkey_error || vec->setauthsize_error)
                goto done;
 
                                        req, tsgls);
                if (err)
                        goto out;
-               err = test_aead_vec_cfg(driver, DECRYPT, &vec, vec_name, cfg,
-                                       req, tsgls);
-               if (err)
-                       goto out;
+               if (vec.crypt_error == 0) {
+                       err = test_aead_vec_cfg(driver, DECRYPT, &vec, vec_name,
+                                               cfg, req, tsgls);
+                       if (err)
+                               goto out;
+               }
                cond_resched();
        }
        err = 0;
        skcipher_request_set_callback(req, 0, crypto_req_done, &wait);
        skcipher_request_set_crypt(req, &src, &dst, vec->len, iv);
        vec->crypt_error = crypto_wait_req(crypto_skcipher_encrypt(req), &wait);
+       if (vec->crypt_error != 0) {
+               /*
+                * The only acceptable error here is for an invalid length, so
+                * skcipher decryption should fail with the same error too.
+                * We'll test for this.  But to keep the API usage well-defined,
+                * explicitly initialize the ciphertext buffer too.
+                */
+               memset((u8 *)vec->ctext, 0, vec->len);
+       }
 done:
        snprintf(name, max_namelen, "\"random: len=%u klen=%u\"",
                 vec->len, vec->klen);