diff --git a/testsuite/arcfour-test.c b/testsuite/arcfour-test.c
index 5b1021a813e59c993c6fdf119975b8aa2a6a54ec..f4ec523a5a84060598f761db41538c842d2fd511 100644
--- a/testsuite/arcfour-test.c
+++ b/testsuite/arcfour-test.c
@@ -4,10 +4,10 @@
 int
 test_main(void)
 {
-  test_cipher(&nettle_arcfour128,
-	      HL("01234567 89ABCDEF 00000000 00000000"),
-	      HL("01234567 89ABCDEF"),
-	      H("69723659 1B5242B1"));
+  test_cipher_stream(&nettle_arcfour128,
+		     HL("01234567 89ABCDEF 00000000 00000000"),
+		     HL("01234567 89ABCDEF"),
+		     H("69723659 1B5242B1"));
 
   SUCCESS();
 }
diff --git a/testsuite/testutils.c b/testsuite/testutils.c
index 418faa1293f5a623c42f8b4e054d84cd17fa9a58..ab7f9259207f23d08ca03f50ac16a37873c70ad7 100644
--- a/testsuite/testutils.c
+++ b/testsuite/testutils.c
@@ -216,6 +216,50 @@ test_cipher_cbc(const struct nettle_cipher *cipher,
     FAIL();
 }
 
+void
+test_cipher_stream(const struct nettle_cipher *cipher,
+		   unsigned key_length,
+		   const uint8_t *key,
+		   unsigned length,
+		   const uint8_t *cleartext,
+		   const uint8_t *ciphertext)
+{
+  unsigned block;
+  
+  void *ctx = alloca(cipher->context_size);
+  uint8_t *data = alloca(length + 1);
+  
+  for (block = 1; block <= length; block++)
+    {
+      unsigned i;
+
+      memset(data, 0x17, length + 1);
+      cipher->set_encrypt_key(ctx, key_length, key);
+
+      for (i = 0; i + block < length; i += block)
+	{
+	  cipher->encrypt(ctx, block, data + i, cleartext + i);
+	  if (data[i + block] != 0x17)
+	    FAIL();
+	}
+      cipher->encrypt(ctx, length - i, data + i, cleartext + i);
+      if (data[length] != 0x17)
+	FAIL();
+      
+      if (!MEMEQ(length, data, ciphertext))
+	FAIL();
+    }
+  
+  cipher->set_decrypt_key(ctx, key_length, key);
+  cipher->decrypt(ctx, length, data, data);
+
+  if (data[length] != 0x17)
+    FAIL();
+
+  if (!MEMEQ(length, data, cleartext))
+    FAIL();
+}
+
 void
 test_hash(const struct nettle_hash *hash,
 	  unsigned length,
diff --git a/testsuite/testutils.h b/testsuite/testutils.h
index 2eb02a655a0b9645165334334b88427af697c8e3..65298b239e3140ff614cb4889f8e0488845e2c6d 100644
--- a/testsuite/testutils.h
+++ b/testsuite/testutils.h
@@ -60,6 +60,14 @@ test_cipher_cbc(const struct nettle_cipher *cipher,
 		const uint8_t *ciphertext,
 		const uint8_t *iv);
 
+void
+test_cipher_stream(const struct nettle_cipher *cipher,
+		   unsigned key_length,
+		   const uint8_t *key,
+		   unsigned length,
+		   const uint8_t *cleartext,
+		   const uint8_t *ciphertext);
+
 void
 test_hash(const struct nettle_hash *hash,
 	  unsigned length,