On Sun, May 16, 2010 at 2:08 PM, Bram Moolenaar <[email protected]> wrote: > > Mohsin wrote: > >> I was able to see the problem you encountered, (which is changing from >> old encryption >> to new encryption in the same session and using the old password). >> >> So, I cleaned the code considerably >> 1 new self test and reorganized key hashing to be on need basis. >> 2 added command line utils to encrypt/decrypt VimCrypt~0[12] files >> for quick test >> 3 test with bcc 551, vc6, cygwin gcc >> >> Resending the patch in attached patch4.zip. >> >> 54K 2010-05-15 15:02 73g-73m1.udiff >> 582 2010-05-08 17:10 sha256.h >> 248K 2010-05-15 13:19 fileio.c >> 142K 2010-05-15 13:21 misc2.c >> 1.1K 2010-05-15 14:18 blowfish.h >> 28K 2010-05-15 14:26 blowfish.c >> 12K 2010-05-15 14:57 sha256.c >> 1.3K 2010-05-15 15:08 blowfish.mak > > Thanks for the update. I have included it in the vim73 branch. > > I have changed the syntax everywhere to match the Vim style. > Also changed C++ stuff to plain C. > I also made the header files generated automatically. > And I moved the global variables to globals.h.
thanks for all the above items. > > I removed the standalone stuff, it was repeating too much code that > appears elsewhere. I don't think we need this to test the encryption > using the normal Vim read and write functions. > > I added src/testdir/test71.in for both types of encryption. Should be > improved to check border cases. > > The bf_self_test() always fails. I changed the enctrypted bytes to make > it pass. Please check why the original value didn't work. I verified I > get exactly the same value when applying your patch without any of my > changes. I'm testing this on Ubuntu 9.10. Found the problem (1) BIG_ENDIAN is defined by gcc on linux 64bit x86, this was causing self test to fail. I rewrote the macro. (This ENDIAN check should be generalized and tested for more platforms and compilers). (2) the blowfish algorithm works on blocks of size 32+32bits, so I changed unsigned long to unsigned int. It now works on x64 linux and windows with same self test passing. > > To be able to distribute this with Vim it needs to go under the Vim > license. Please send me a clear statement that you agree with this. Yes, please change the license to vim license, and change the comments as needed by vim. thanks, Mohsin. > > -- > CVS sux, men don't like commitment > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ > \\\ download, build and distribute -- http://www.A-A-P.org /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org /// > -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
diff5
Description: Binary data
