A few more changes for encryption. Add test that encrypted file can be read.
diff --git a/src/testdir/test71.in b/src/testdir/test71.in
index a2eadd3..717b660 100644
--- a/src/testdir/test71.in
+++ b/src/testdir/test71.in
@@ -2,10 +2,14 @@
STARTTEST
:so small.vim
-:/^start of testfile/+1
-:let lines = getline('.', '$')
-:new
-:call append(0, lines)
+:/^start of text/+1
+:let text_lines = getline('.', line('.') + 2)
+:/^start of cm=0 bytes/+1
+:let cm0_bytes = getline('.', '.')
+:/^start of cm=1 bytes/+1
+:let cm1_bytes = getline('.', '.')
+:bwipe
+:call append(0, text_lines)
:$d
:X
foobar
@@ -14,10 +18,11 @@
:bwipe!
:e Xtestfile
foobar
-:let dec1_lines = getline('.', '$')
-:%s/^/2/
+:let cm0_read_back = getline('.', '$')
:set key=
:set cryptmethod=1
+:" If the blowfish test fails 'cryptmethod' will be 0 now.
+:%s/^/\=&cryptmethod == 1 ? "OK " : "blowfish test failed "/
:X
barfoo
barfoo
@@ -25,13 +30,46 @@
:bwipe!
:e Xtestfile
barfoo
-:call append(0, dec1_lines)
-:set key=
+:let cm1_read_back = getline('.', '$')
+:bwipe!
+:set bin noeol key=
+:call append(0, cm0_bytes)
+:$d
+:set fenc=latin1
+:w! Xtestfile
+:bwipe!
+:set nobin
+:e Xtestfile
+foofoo
+:let cm0_read_bin = getline('.', '$')
+:bwipe!
+:set bin noeol key=
+:call append(0, cm1_bytes)
+:$d
+:set fenc=latin1
+:w! Xtestfile
+:bwipe!
+:set nobin
+:e Xtestfile
+barbar
+:call append(0, cm0_read_bin)
+:call append(0, cm1_read_back)
+:call append(0, cm0_read_back)
+:set key= fenc=latin1
:w! test.out
:qa!
ENDTEST
-start of testfile
+start of text
01234567890123456789012345678901234567
line 2 foo bar blah
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+end of text
+
+start of cm=0 bytes
+VimCrypt~01!lV'Þ}Mg ê£V©çE#32Ué
+end of cm=0 bytes
+
+start of cm=1 bytes
+VimCrypt~02!¨Ò9ZÙ¢èìF¼èÃ[,ìF¼z¼Öè»y¾Ô(
+end of cm=1 bytes
diff --git a/src/testdir/test71.ok b/src/testdir/test71.ok
index 5820892..24652c4 100644
--- a/src/testdir/test71.ok
+++ b/src/testdir/test71.ok
@@ -1,6 +1,10 @@
01234567890123456789012345678901234567
line 2 foo bar blah
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-201234567890123456789012345678901234567
-2line 2 foo bar blah
-2line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+OK 01234567890123456789012345678901234567
+OK line 2 foo bar blah
+OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+1234567890
+aábbccddeëff
+asdfasdfasdf
+0001112223333