annotate src/blowfish.c @ 3497:b782e2f9e689 v7.3.511

updated for version 7.3.511 Problem: Using a FileReadCmd autocommand that does ":e! {file}" may cause a crash. (Christian Brabandt) Solution: Properly restore curwin->w_s.
author Bram Moolenaar <bram@vim.org>
date Mon, 30 Apr 2012 17:04:52 +0200
parents 2d9eebf2c48f
children 391e10afccf6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 *
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
4 *
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
7 * See README.txt for an overview of the Vim source code.
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
8 *
2182
3cb515c62e9c Minor updates to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2180
diff changeset
9 * Blowfish encryption for Vim; in Blowfish output feedback mode.
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
10 * Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 * Based on http://www.schneier.com/blowfish.html by Bruce Schneier.
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 #include "vim.h"
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 #if defined(FEAT_CRYPT)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 #define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0]))
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 #define BF_BLOCK 8
2244
caca0ddd789b Made crypt/decrypt faster.
Bram Moolenaar <bram@vim.org>
parents: 2217
diff changeset
21 #define BF_BLOCK_MASK 7
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 #define BF_OFB_LEN (8*(BF_BLOCK))
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 typedef union {
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
25 UINT32_T ul[2];
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
26 char_u uc[8];
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 } block8;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28
2217
120502692d82 Improve the MS-Windows installer.
Bram Moolenaar <bram@vim.org>
parents: 2215
diff changeset
29 #if defined(WIN3264) || defined(DOS32)
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
30 /* MS-Windows is always little endian */
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 #else
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
32 # ifdef HAVE_CONFIG_H
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
33 /* in configure.in AC_C_BIGENDIAN() defines WORDS_BIGENDIAN when needed */
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
34 # else
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
35 error!
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
36 Please change this code to define WORDS_BIGENDIAN for big-endian machines.
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 # endif
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 #endif
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
40 static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 static void bf_e_cblock __ARGS((char_u *block));
2271
2b33a7678e7b Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
Bram Moolenaar <bram@vim.org>
parents: 2267
diff changeset
42 static int bf_check_tables __ARGS((UINT32_T a_ipa[18], UINT32_T a_sbi[4][256], UINT32_T val));
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 static int bf_self_test __ARGS((void));
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44
2195
f9aec8acb188 Fix build on Cygwin and MingW.
Bram Moolenaar <bram@vim.org>
parents: 2184
diff changeset
45 /* Blowfish code */
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
46 static UINT32_T pax[18];
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
47 static UINT32_T ipa[18] = {
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 0x243f6a88u, 0x85a308d3u, 0x13198a2eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 0x03707344u, 0xa4093822u, 0x299f31d0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 0x082efa98u, 0xec4e6c89u, 0x452821e6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 0x38d01377u, 0xbe5466cfu, 0x34e90c6cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 0xc0ac29b7u, 0xc97c50ddu, 0x3f84d5b5u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 0xb5470917u, 0x9216d5d9u, 0x8979fb1bu
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 };
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
56 static UINT32_T sbx[4][256];
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
57 static UINT32_T sbi[4][256] = {
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 {0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 0x636920d8u, 0x71574e69u, 0xa458fea3u, 0xf4933d7eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 0x0d95748fu, 0x728eb658u, 0x718bcd58u, 0x82154aeeu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 0x7b54a41du, 0xc25a59b5u, 0x9c30d539u, 0x2af26013u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 0xc5d1b023u, 0x286085f0u, 0xca417918u, 0xb8db38efu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 0x8e79dcb0u, 0x603a180eu, 0x6c9e0e8bu, 0xb01e8a3eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 0xd71577c1u, 0xbd314b27u, 0x78af2fdau, 0x55605c60u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 0xe65525f3u, 0xaa55ab94u, 0x57489862u, 0x63e81440u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 0x55ca396au, 0x2aab10b6u, 0xb4cc5c34u, 0x1141e8ceu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 0xa15486afu, 0x7c72e993u, 0xb3ee1411u, 0x636fbc2au,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 0x2ba9c55du, 0x741831f6u, 0xce5c3e16u, 0x9b87931eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 0xafd6ba33u, 0x6c24cf5cu, 0x7a325381u, 0x28958677u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 0x3b8f4898u, 0x6b4bb9afu, 0xc4bfe81bu, 0x66282193u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 0x61d809ccu, 0xfb21a991u, 0x487cac60u, 0x5dec8032u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 0xef845d5du, 0xe98575b1u, 0xdc262302u, 0xeb651b88u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 0x23893e81u, 0xd396acc5u, 0x0f6d6ff3u, 0x83f44239u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 0x2e0b4482u, 0xa4842004u, 0x69c8f04au, 0x9e1f9b5eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 0x21c66842u, 0xf6e96c9au, 0x670c9c61u, 0xabd388f0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 0x6a51a0d2u, 0xd8542f68u, 0x960fa728u, 0xab5133a3u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 0x6eef0b6cu, 0x137a3be4u, 0xba3bf050u, 0x7efb2a98u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 0xa1f1651du, 0x39af0176u, 0x66ca593eu, 0x82430e88u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 0x8cee8619u, 0x456f9fb4u, 0x7d84a5c3u, 0x3b8b5ebeu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 0xe06f75d8u, 0x85c12073u, 0x401a449fu, 0x56c16aa6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 0x4ed3aa62u, 0x363f7706u, 0x1bfedf72u, 0x429b023du,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 0x37d0d724u, 0xd00a1248u, 0xdb0fead3u, 0x49f1c09bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 0x075372c9u, 0x80991b7bu, 0x25d479d8u, 0xf6e8def7u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86 0xe3fe501au, 0xb6794c3bu, 0x976ce0bdu, 0x04c006bau,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 0xc1a94fb6u, 0x409f60c4u, 0x5e5c9ec2u, 0x196a2463u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 0x68fb6fafu, 0x3e6c53b5u, 0x1339b2ebu, 0x3b52ec6fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 0x6dfc511fu, 0x9b30952cu, 0xcc814544u, 0xaf5ebd09u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90 0xbee3d004u, 0xde334afdu, 0x660f2807u, 0x192e4bb3u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91 0xc0cba857u, 0x45c8740fu, 0xd20b5f39u, 0xb9d3fbdbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 0x5579c0bdu, 0x1a60320au, 0xd6a100c6u, 0x402c7279u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 0x679f25feu, 0xfb1fa3ccu, 0x8ea5e9f8u, 0xdb3222f8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94 0x3c7516dfu, 0xfd616b15u, 0x2f501ec8u, 0xad0552abu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95 0x323db5fau, 0xfd238760u, 0x53317b48u, 0x3e00df82u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96 0x9e5c57bbu, 0xca6f8ca0u, 0x1a87562eu, 0xdf1769dbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97 0xd542a8f6u, 0x287effc3u, 0xac6732c6u, 0x8c4f5573u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98 0x695b27b0u, 0xbbca58c8u, 0xe1ffa35du, 0xb8f011a0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
99 0x10fa3d98u, 0xfd2183b8u, 0x4afcb56cu, 0x2dd1d35bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100 0x9a53e479u, 0xb6f84565u, 0xd28e49bcu, 0x4bfb9790u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101 0xe1ddf2dau, 0xa4cb7e33u, 0x62fb1341u, 0xcee4c6e8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
102 0xef20cadau, 0x36774c01u, 0xd07e9efeu, 0x2bf11fb4u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
103 0x95dbda4du, 0xae909198u, 0xeaad8e71u, 0x6b93d5a0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
104 0xd08ed1d0u, 0xafc725e0u, 0x8e3c5b2fu, 0x8e7594b7u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105 0x8ff6e2fbu, 0xf2122b64u, 0x8888b812u, 0x900df01cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
106 0x4fad5ea0u, 0x688fc31cu, 0xd1cff191u, 0xb3a8c1adu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 0x2f2f2218u, 0xbe0e1777u, 0xea752dfeu, 0x8b021fa1u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108 0xe5a0cc0fu, 0xb56f74e8u, 0x18acf3d6u, 0xce89e299u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109 0xb4a84fe0u, 0xfd13e0b7u, 0x7cc43b81u, 0xd2ada8d9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
110 0x165fa266u, 0x80957705u, 0x93cc7314u, 0x211a1477u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
111 0xe6ad2065u, 0x77b5fa86u, 0xc75442f5u, 0xfb9d35cfu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
112 0xebcdaf0cu, 0x7b3e89a0u, 0xd6411bd3u, 0xae1e7e49u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
113 0x00250e2du, 0x2071b35eu, 0x226800bbu, 0x57b8e0afu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
114 0x2464369bu, 0xf009b91eu, 0x5563911du, 0x59dfa6aau,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
115 0x78c14389u, 0xd95a537fu, 0x207d5ba2u, 0x02e5b9c5u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
116 0x83260376u, 0x6295cfa9u, 0x11c81968u, 0x4e734a41u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
117 0xb3472dcau, 0x7b14a94au, 0x1b510052u, 0x9a532915u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
118 0xd60f573fu, 0xbc9bc6e4u, 0x2b60a476u, 0x81e67400u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
119 0x08ba6fb5u, 0x571be91fu, 0xf296ec6bu, 0x2a0dd915u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
120 0xb6636521u, 0xe7b9f9b6u, 0xff34052eu, 0xc5855664u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
121 0x53b02d5du, 0xa99f8fa1u, 0x08ba4799u, 0x6e85076au},
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
122 {0x4b7a70e9u, 0xb5b32944u, 0xdb75092eu, 0xc4192623u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
123 0xad6ea6b0u, 0x49a7df7du, 0x9cee60b8u, 0x8fedb266u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
124 0xecaa8c71u, 0x699a17ffu, 0x5664526cu, 0xc2b19ee1u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
125 0x193602a5u, 0x75094c29u, 0xa0591340u, 0xe4183a3eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
126 0x3f54989au, 0x5b429d65u, 0x6b8fe4d6u, 0x99f73fd6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
127 0xa1d29c07u, 0xefe830f5u, 0x4d2d38e6u, 0xf0255dc1u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
128 0x4cdd2086u, 0x8470eb26u, 0x6382e9c6u, 0x021ecc5eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
129 0x09686b3fu, 0x3ebaefc9u, 0x3c971814u, 0x6b6a70a1u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
130 0x687f3584u, 0x52a0e286u, 0xb79c5305u, 0xaa500737u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
131 0x3e07841cu, 0x7fdeae5cu, 0x8e7d44ecu, 0x5716f2b8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
132 0xb03ada37u, 0xf0500c0du, 0xf01c1f04u, 0x0200b3ffu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
133 0xae0cf51au, 0x3cb574b2u, 0x25837a58u, 0xdc0921bdu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
134 0xd19113f9u, 0x7ca92ff6u, 0x94324773u, 0x22f54701u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
135 0x3ae5e581u, 0x37c2dadcu, 0xc8b57634u, 0x9af3dda7u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
136 0xa9446146u, 0x0fd0030eu, 0xecc8c73eu, 0xa4751e41u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
137 0xe238cd99u, 0x3bea0e2fu, 0x3280bba1u, 0x183eb331u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
138 0x4e548b38u, 0x4f6db908u, 0x6f420d03u, 0xf60a04bfu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
139 0x2cb81290u, 0x24977c79u, 0x5679b072u, 0xbcaf89afu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
140 0xde9a771fu, 0xd9930810u, 0xb38bae12u, 0xdccf3f2eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
141 0x5512721fu, 0x2e6b7124u, 0x501adde6u, 0x9f84cd87u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
142 0x7a584718u, 0x7408da17u, 0xbc9f9abcu, 0xe94b7d8cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
143 0xec7aec3au, 0xdb851dfau, 0x63094366u, 0xc464c3d2u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
144 0xef1c1847u, 0x3215d908u, 0xdd433b37u, 0x24c2ba16u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
145 0x12a14d43u, 0x2a65c451u, 0x50940002u, 0x133ae4ddu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
146 0x71dff89eu, 0x10314e55u, 0x81ac77d6u, 0x5f11199bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
147 0x043556f1u, 0xd7a3c76bu, 0x3c11183bu, 0x5924a509u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
148 0xf28fe6edu, 0x97f1fbfau, 0x9ebabf2cu, 0x1e153c6eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
149 0x86e34570u, 0xeae96fb1u, 0x860e5e0au, 0x5a3e2ab3u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
150 0x771fe71cu, 0x4e3d06fau, 0x2965dcb9u, 0x99e71d0fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
151 0x803e89d6u, 0x5266c825u, 0x2e4cc978u, 0x9c10b36au,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
152 0xc6150ebau, 0x94e2ea78u, 0xa5fc3c53u, 0x1e0a2df4u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
153 0xf2f74ea7u, 0x361d2b3du, 0x1939260fu, 0x19c27960u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
154 0x5223a708u, 0xf71312b6u, 0xebadfe6eu, 0xeac31f66u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
155 0xe3bc4595u, 0xa67bc883u, 0xb17f37d1u, 0x018cff28u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
156 0xc332ddefu, 0xbe6c5aa5u, 0x65582185u, 0x68ab9802u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
157 0xeecea50fu, 0xdb2f953bu, 0x2aef7dadu, 0x5b6e2f84u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
158 0x1521b628u, 0x29076170u, 0xecdd4775u, 0x619f1510u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
159 0x13cca830u, 0xeb61bd96u, 0x0334fe1eu, 0xaa0363cfu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
160 0xb5735c90u, 0x4c70a239u, 0xd59e9e0bu, 0xcbaade14u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
161 0xeecc86bcu, 0x60622ca7u, 0x9cab5cabu, 0xb2f3846eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
162 0x648b1eafu, 0x19bdf0cau, 0xa02369b9u, 0x655abb50u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
163 0x40685a32u, 0x3c2ab4b3u, 0x319ee9d5u, 0xc021b8f7u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
164 0x9b540b19u, 0x875fa099u, 0x95f7997eu, 0x623d7da8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
165 0xf837889au, 0x97e32d77u, 0x11ed935fu, 0x16681281u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
166 0x0e358829u, 0xc7e61fd6u, 0x96dedfa1u, 0x7858ba99u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
167 0x57f584a5u, 0x1b227263u, 0x9b83c3ffu, 0x1ac24696u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
168 0xcdb30aebu, 0x532e3054u, 0x8fd948e4u, 0x6dbc3128u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
169 0x58ebf2efu, 0x34c6ffeau, 0xfe28ed61u, 0xee7c3c73u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
170 0x5d4a14d9u, 0xe864b7e3u, 0x42105d14u, 0x203e13e0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
171 0x45eee2b6u, 0xa3aaabeau, 0xdb6c4f15u, 0xfacb4fd0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
172 0xc742f442u, 0xef6abbb5u, 0x654f3b1du, 0x41cd2105u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
173 0xd81e799eu, 0x86854dc7u, 0xe44b476au, 0x3d816250u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
174 0xcf62a1f2u, 0x5b8d2646u, 0xfc8883a0u, 0xc1c7b6a3u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
175 0x7f1524c3u, 0x69cb7492u, 0x47848a0bu, 0x5692b285u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
176 0x095bbf00u, 0xad19489du, 0x1462b174u, 0x23820e00u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
177 0x58428d2au, 0x0c55f5eau, 0x1dadf43eu, 0x233f7061u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
178 0x3372f092u, 0x8d937e41u, 0xd65fecf1u, 0x6c223bdbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
179 0x7cde3759u, 0xcbee7460u, 0x4085f2a7u, 0xce77326eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
180 0xa6078084u, 0x19f8509eu, 0xe8efd855u, 0x61d99735u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
181 0xa969a7aau, 0xc50c06c2u, 0x5a04abfcu, 0x800bcadcu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
182 0x9e447a2eu, 0xc3453484u, 0xfdd56705u, 0x0e1e9ec9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
183 0xdb73dbd3u, 0x105588cdu, 0x675fda79u, 0xe3674340u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
184 0xc5c43465u, 0x713e38d8u, 0x3d28f89eu, 0xf16dff20u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
185 0x153e21e7u, 0x8fb03d4au, 0xe6e39f2bu, 0xdb83adf7u},
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
186 {0xe93d5a68u, 0x948140f7u, 0xf64c261cu, 0x94692934u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
187 0x411520f7u, 0x7602d4f7u, 0xbcf46b2eu, 0xd4a20068u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
188 0xd4082471u, 0x3320f46au, 0x43b7d4b7u, 0x500061afu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
189 0x1e39f62eu, 0x97244546u, 0x14214f74u, 0xbf8b8840u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
190 0x4d95fc1du, 0x96b591afu, 0x70f4ddd3u, 0x66a02f45u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
191 0xbfbc09ecu, 0x03bd9785u, 0x7fac6dd0u, 0x31cb8504u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
192 0x96eb27b3u, 0x55fd3941u, 0xda2547e6u, 0xabca0a9au,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
193 0x28507825u, 0x530429f4u, 0x0a2c86dau, 0xe9b66dfbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
194 0x68dc1462u, 0xd7486900u, 0x680ec0a4u, 0x27a18deeu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
195 0x4f3ffea2u, 0xe887ad8cu, 0xb58ce006u, 0x7af4d6b6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
196 0xaace1e7cu, 0xd3375fecu, 0xce78a399u, 0x406b2a42u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
197 0x20fe9e35u, 0xd9f385b9u, 0xee39d7abu, 0x3b124e8bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
198 0x1dc9faf7u, 0x4b6d1856u, 0x26a36631u, 0xeae397b2u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
199 0x3a6efa74u, 0xdd5b4332u, 0x6841e7f7u, 0xca7820fbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
200 0xfb0af54eu, 0xd8feb397u, 0x454056acu, 0xba489527u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
201 0x55533a3au, 0x20838d87u, 0xfe6ba9b7u, 0xd096954bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
202 0x55a867bcu, 0xa1159a58u, 0xcca92963u, 0x99e1db33u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
203 0xa62a4a56u, 0x3f3125f9u, 0x5ef47e1cu, 0x9029317cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
204 0xfdf8e802u, 0x04272f70u, 0x80bb155cu, 0x05282ce3u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
205 0x95c11548u, 0xe4c66d22u, 0x48c1133fu, 0xc70f86dcu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
206 0x07f9c9eeu, 0x41041f0fu, 0x404779a4u, 0x5d886e17u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
207 0x325f51ebu, 0xd59bc0d1u, 0xf2bcc18fu, 0x41113564u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
208 0x257b7834u, 0x602a9c60u, 0xdff8e8a3u, 0x1f636c1bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
209 0x0e12b4c2u, 0x02e1329eu, 0xaf664fd1u, 0xcad18115u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
210 0x6b2395e0u, 0x333e92e1u, 0x3b240b62u, 0xeebeb922u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
211 0x85b2a20eu, 0xe6ba0d99u, 0xde720c8cu, 0x2da2f728u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
212 0xd0127845u, 0x95b794fdu, 0x647d0862u, 0xe7ccf5f0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
213 0x5449a36fu, 0x877d48fau, 0xc39dfd27u, 0xf33e8d1eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
214 0x0a476341u, 0x992eff74u, 0x3a6f6eabu, 0xf4f8fd37u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
215 0xa812dc60u, 0xa1ebddf8u, 0x991be14cu, 0xdb6e6b0du,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
216 0xc67b5510u, 0x6d672c37u, 0x2765d43bu, 0xdcd0e804u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
217 0xf1290dc7u, 0xcc00ffa3u, 0xb5390f92u, 0x690fed0bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
218 0x667b9ffbu, 0xcedb7d9cu, 0xa091cf0bu, 0xd9155ea3u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
219 0xbb132f88u, 0x515bad24u, 0x7b9479bfu, 0x763bd6ebu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
220 0x37392eb3u, 0xcc115979u, 0x8026e297u, 0xf42e312du,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
221 0x6842ada7u, 0xc66a2b3bu, 0x12754cccu, 0x782ef11cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
222 0x6a124237u, 0xb79251e7u, 0x06a1bbe6u, 0x4bfb6350u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
223 0x1a6b1018u, 0x11caedfau, 0x3d25bdd8u, 0xe2e1c3c9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
224 0x44421659u, 0x0a121386u, 0xd90cec6eu, 0xd5abea2au,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
225 0x64af674eu, 0xda86a85fu, 0xbebfe988u, 0x64e4c3feu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
226 0x9dbc8057u, 0xf0f7c086u, 0x60787bf8u, 0x6003604du,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
227 0xd1fd8346u, 0xf6381fb0u, 0x7745ae04u, 0xd736fcccu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
228 0x83426b33u, 0xf01eab71u, 0xb0804187u, 0x3c005e5fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
229 0x77a057beu, 0xbde8ae24u, 0x55464299u, 0xbf582e61u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
230 0x4e58f48fu, 0xf2ddfda2u, 0xf474ef38u, 0x8789bdc2u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
231 0x5366f9c3u, 0xc8b38e74u, 0xb475f255u, 0x46fcd9b9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
232 0x7aeb2661u, 0x8b1ddf84u, 0x846a0e79u, 0x915f95e2u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
233 0x466e598eu, 0x20b45770u, 0x8cd55591u, 0xc902de4cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
234 0xb90bace1u, 0xbb8205d0u, 0x11a86248u, 0x7574a99eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
235 0xb77f19b6u, 0xe0a9dc09u, 0x662d09a1u, 0xc4324633u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
236 0xe85a1f02u, 0x09f0be8cu, 0x4a99a025u, 0x1d6efe10u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
237 0x1ab93d1du, 0x0ba5a4dfu, 0xa186f20fu, 0x2868f169u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
238 0xdcb7da83u, 0x573906feu, 0xa1e2ce9bu, 0x4fcd7f52u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
239 0x50115e01u, 0xa70683fau, 0xa002b5c4u, 0x0de6d027u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
240 0x9af88c27u, 0x773f8641u, 0xc3604c06u, 0x61a806b5u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
241 0xf0177a28u, 0xc0f586e0u, 0x006058aau, 0x30dc7d62u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
242 0x11e69ed7u, 0x2338ea63u, 0x53c2dd94u, 0xc2c21634u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
243 0xbbcbee56u, 0x90bcb6deu, 0xebfc7da1u, 0xce591d76u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
244 0x6f05e409u, 0x4b7c0188u, 0x39720a3du, 0x7c927c24u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
245 0x86e3725fu, 0x724d9db9u, 0x1ac15bb4u, 0xd39eb8fcu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
246 0xed545578u, 0x08fca5b5u, 0xd83d7cd3u, 0x4dad0fc4u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
247 0x1e50ef5eu, 0xb161e6f8u, 0xa28514d9u, 0x6c51133cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
248 0x6fd5c7e7u, 0x56e14ec4u, 0x362abfceu, 0xddc6c837u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
249 0xd79a3234u, 0x92638212u, 0x670efa8eu, 0x406000e0u},
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
250 {0x3a39ce37u, 0xd3faf5cfu, 0xabc27737u, 0x5ac52d1bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
251 0x5cb0679eu, 0x4fa33742u, 0xd3822740u, 0x99bc9bbeu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
252 0xd5118e9du, 0xbf0f7315u, 0xd62d1c7eu, 0xc700c47bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
253 0xb78c1b6bu, 0x21a19045u, 0xb26eb1beu, 0x6a366eb4u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
254 0x5748ab2fu, 0xbc946e79u, 0xc6a376d2u, 0x6549c2c8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
255 0x530ff8eeu, 0x468dde7du, 0xd5730a1du, 0x4cd04dc6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
256 0x2939bbdbu, 0xa9ba4650u, 0xac9526e8u, 0xbe5ee304u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
257 0xa1fad5f0u, 0x6a2d519au, 0x63ef8ce2u, 0x9a86ee22u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
258 0xc089c2b8u, 0x43242ef6u, 0xa51e03aau, 0x9cf2d0a4u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
259 0x83c061bau, 0x9be96a4du, 0x8fe51550u, 0xba645bd6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
260 0x2826a2f9u, 0xa73a3ae1u, 0x4ba99586u, 0xef5562e9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
261 0xc72fefd3u, 0xf752f7dau, 0x3f046f69u, 0x77fa0a59u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
262 0x80e4a915u, 0x87b08601u, 0x9b09e6adu, 0x3b3ee593u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
263 0xe990fd5au, 0x9e34d797u, 0x2cf0b7d9u, 0x022b8b51u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
264 0x96d5ac3au, 0x017da67du, 0xd1cf3ed6u, 0x7c7d2d28u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
265 0x1f9f25cfu, 0xadf2b89bu, 0x5ad6b472u, 0x5a88f54cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
266 0xe029ac71u, 0xe019a5e6u, 0x47b0acfdu, 0xed93fa9bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
267 0xe8d3c48du, 0x283b57ccu, 0xf8d56629u, 0x79132e28u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
268 0x785f0191u, 0xed756055u, 0xf7960e44u, 0xe3d35e8cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
269 0x15056dd4u, 0x88f46dbau, 0x03a16125u, 0x0564f0bdu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
270 0xc3eb9e15u, 0x3c9057a2u, 0x97271aecu, 0xa93a072au,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
271 0x1b3f6d9bu, 0x1e6321f5u, 0xf59c66fbu, 0x26dcf319u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
272 0x7533d928u, 0xb155fdf5u, 0x03563482u, 0x8aba3cbbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
273 0x28517711u, 0xc20ad9f8u, 0xabcc5167u, 0xccad925fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
274 0x4de81751u, 0x3830dc8eu, 0x379d5862u, 0x9320f991u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
275 0xea7a90c2u, 0xfb3e7bceu, 0x5121ce64u, 0x774fbe32u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
276 0xa8b6e37eu, 0xc3293d46u, 0x48de5369u, 0x6413e680u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
277 0xa2ae0810u, 0xdd6db224u, 0x69852dfdu, 0x09072166u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
278 0xb39a460au, 0x6445c0ddu, 0x586cdecfu, 0x1c20c8aeu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
279 0x5bbef7ddu, 0x1b588d40u, 0xccd2017fu, 0x6bb4e3bbu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
280 0xdda26a7eu, 0x3a59ff45u, 0x3e350a44u, 0xbcb4cdd5u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
281 0x72eacea8u, 0xfa6484bbu, 0x8d6612aeu, 0xbf3c6f47u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
282 0xd29be463u, 0x542f5d9eu, 0xaec2771bu, 0xf64e6370u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
283 0x740e0d8du, 0xe75b1357u, 0xf8721671u, 0xaf537d5du,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
284 0x4040cb08u, 0x4eb4e2ccu, 0x34d2466au, 0x0115af84u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
285 0xe1b00428u, 0x95983a1du, 0x06b89fb4u, 0xce6ea048u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
286 0x6f3f3b82u, 0x3520ab82u, 0x011a1d4bu, 0x277227f8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
287 0x611560b1u, 0xe7933fdcu, 0xbb3a792bu, 0x344525bdu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
288 0xa08839e1u, 0x51ce794bu, 0x2f32c9b7u, 0xa01fbac9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
289 0xe01cc87eu, 0xbcc7d1f6u, 0xcf0111c3u, 0xa1e8aac7u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
290 0x1a908749u, 0xd44fbd9au, 0xd0dadecbu, 0xd50ada38u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
291 0x0339c32au, 0xc6913667u, 0x8df9317cu, 0xe0b12b4fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
292 0xf79e59b7u, 0x43f5bb3au, 0xf2d519ffu, 0x27d9459cu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
293 0xbf97222cu, 0x15e6fc2au, 0x0f91fc71u, 0x9b941525u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
294 0xfae59361u, 0xceb69cebu, 0xc2a86459u, 0x12baa8d1u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
295 0xb6c1075eu, 0xe3056a0cu, 0x10d25065u, 0xcb03a442u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
296 0xe0ec6e0eu, 0x1698db3bu, 0x4c98a0beu, 0x3278e964u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
297 0x9f1f9532u, 0xe0d392dfu, 0xd3a0342bu, 0x8971f21eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
298 0x1b0a7441u, 0x4ba3348cu, 0xc5be7120u, 0xc37632d8u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
299 0xdf359f8du, 0x9b992f2eu, 0xe60b6f47u, 0x0fe3f11du,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
300 0xe54cda54u, 0x1edad891u, 0xce6279cfu, 0xcd3e7e6fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
301 0x1618b166u, 0xfd2c1d05u, 0x848fd2c5u, 0xf6fb2299u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
302 0xf523f357u, 0xa6327623u, 0x93a83531u, 0x56cccd02u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
303 0xacf08162u, 0x5a75ebb5u, 0x6e163697u, 0x88d273ccu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
304 0xde966292u, 0x81b949d0u, 0x4c50901bu, 0x71c65614u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
305 0xe6c6c7bdu, 0x327a140au, 0x45e1d006u, 0xc3f27b9au,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
306 0xc9aa53fdu, 0x62a80f00u, 0xbb25bfe2u, 0x35bdd2f6u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
307 0x71126905u, 0xb2040222u, 0xb6cbcf7cu, 0xcd769c2bu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
308 0x53113ec0u, 0x1640e3d3u, 0x38abbd60u, 0x2547adf0u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
309 0xba38209cu, 0xf746ce76u, 0x77afa1c5u, 0x20756060u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
310 0x85cbfe4eu, 0x8ae88dd8u, 0x7aaaf9b0u, 0x4cf9aa7eu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
311 0x1948c25cu, 0x02fb8a8cu, 0x01c36ae4u, 0xd6ebe1f9u,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
312 0x90d4f869u, 0xa65cdea0u, 0x3f09252du, 0xc208e69fu,
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
313 0xb74e6132u, 0xce77e25bu, 0x578fdfe3u, 0x3ac372e6u
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
314 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
315 };
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
316
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
317
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
318 #define F1(i) \
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
319 xl ^= pax[i]; \
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
320 xr ^= ((sbx[0][xl >> 24] + \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
321 sbx[1][(xl & 0xFF0000) >> 16]) ^ \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
322 sbx[2][(xl & 0xFF00) >> 8]) + \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
323 sbx[3][xl & 0xFF];
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
324
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
325 #define F2(i) \
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
326 xr ^= pax[i]; \
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
327 xl ^= ((sbx[0][xr >> 24] + \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
328 sbx[1][(xr & 0xFF0000) >> 16]) ^ \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
329 sbx[2][(xr & 0xFF00) >> 8]) + \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
330 sbx[3][xr & 0xFF];
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
331
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
332
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
333 static void
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
334 bf_e_block(p_xl, p_xr)
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
335 UINT32_T *p_xl;
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
336 UINT32_T *p_xr;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
337 {
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
338 UINT32_T temp, xl = *p_xl, xr = *p_xr;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
339
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
340 F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
341 F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15)
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
342 xl ^= pax[16];
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
343 xr ^= pax[17];
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
344 temp = xl;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
345 xl = xr;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
346 xr = temp;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
347 *p_xl = xl;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
348 *p_xr = xr;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
349 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
350
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
351 #if 0 /* not used */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
352 static void
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
353 bf_d_block(p_xl, p_xr)
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
354 UINT32_T *p_xl;
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
355 UINT32_T *p_xr;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
356 {
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
357 UINT32_T temp, xl = *p_xl, xr = *p_xr;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
358 F1(17) F2(16) F1(15) F2(14) F1(13) F2(12) F1(11) F2(10)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
359 F1(9) F2(8) F1(7) F2(6) F1(5) F2(4) F1(3) F2(2)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
360 xl ^= pax[1];
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
361 xr ^= pax[0];
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
362 temp = xl; xl = xr; xr = temp;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
363 *p_xl = xl; *p_xr = xr;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
364 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
365 #endif
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
366
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
367
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
368 #ifdef WORDS_BIGENDIAN
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
369 # define htonl2(x) \
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
370 x = ((((x) & 0xffL) << 24) | (((x) & 0xff00L) << 8) | \
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
371 (((x) & 0xff0000L) >> 8) | (((x) & 0xff000000L) >> 24))
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
372 #else
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
373 # define htonl2(x)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
374 #endif
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
375
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
376 static void
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
377 bf_e_cblock(block)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
378 char_u *block;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
379 {
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
380 block8 bk;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
381
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
382 memcpy(bk.uc, block, 8);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
383 htonl2(bk.ul[0]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
384 htonl2(bk.ul[1]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
385 bf_e_block(&bk.ul[0], &bk.ul[1]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
386 htonl2(bk.ul[0]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
387 htonl2(bk.ul[1]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
388 memcpy(block, bk.uc, 8);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
389 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
390
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
391 #if 0 /* not used */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
392 void
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
393 bf_d_cblock(block)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
394 char_u *block;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
395 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
396 block8 bk;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
397 memcpy(bk.uc, block, 8);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
398 htonl2(bk.ul[0]); htonl2(bk.ul[1]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
399 bf_d_block(&bk.ul[0], &bk.ul[1]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
400 htonl2(bk.ul[0]); htonl2(bk.ul[1]);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
401 memcpy(block, bk.uc, 8);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
402 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
403 #endif
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
404
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
405 /*
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
406 * Initialize the crypt method using "password" as the encryption key and
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
407 * "salt[salt_len]" as the salt.
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
408 */
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
409 void
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
410 bf_key_init(password, salt, salt_len)
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
411 char_u *password;
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
412 char_u *salt;
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
413 int salt_len;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
414 {
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
415 int i, j, keypos = 0;
2710
2d9eebf2c48f updated for version 7.3.126
Bram Moolenaar <bram@vim.org>
parents: 2311
diff changeset
416 unsigned u;
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
417 UINT32_T val, data_l, data_r;
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
418 char_u *key;
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
419 int keylen;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
420
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
421 /* Process the key 1000 times.
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
422 * See http://en.wikipedia.org/wiki/Key_strengthening. */
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
423 key = sha256_key(password, salt, salt_len);
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
424 for (i = 0; i < 1000; i++)
2311
ccda151dde4e Support completion for ":find". (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents: 2271
diff changeset
425 key = sha256_key(key, salt, salt_len);
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
426
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
427 /* Convert the key from 64 hex chars to 32 binary chars. */
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
428 keylen = (int)STRLEN(key) / 2;
2251
646d34788036 Fix a few compiler warnings. Fix crash with encrypted undo file.
Bram Moolenaar <bram@vim.org>
parents: 2245
diff changeset
429 if (keylen == 0)
646d34788036 Fix a few compiler warnings. Fix crash with encrypted undo file.
Bram Moolenaar <bram@vim.org>
parents: 2245
diff changeset
430 {
646d34788036 Fix a few compiler warnings. Fix crash with encrypted undo file.
Bram Moolenaar <bram@vim.org>
parents: 2245
diff changeset
431 EMSG(_("E831: bf_key_init() called with empty password"));
646d34788036 Fix a few compiler warnings. Fix crash with encrypted undo file.
Bram Moolenaar <bram@vim.org>
parents: 2245
diff changeset
432 return;
646d34788036 Fix a few compiler warnings. Fix crash with encrypted undo file.
Bram Moolenaar <bram@vim.org>
parents: 2245
diff changeset
433 }
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
434 for (i = 0; i < keylen; i++)
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
435 {
2710
2d9eebf2c48f updated for version 7.3.126
Bram Moolenaar <bram@vim.org>
parents: 2311
diff changeset
436 sscanf((char *)&key[i * 2], "%2x", &u);
2d9eebf2c48f updated for version 7.3.126
Bram Moolenaar <bram@vim.org>
parents: 2311
diff changeset
437 key[i] = u;
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
438 }
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
439
2267
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
440 mch_memmove(sbx, sbi, 4 * 4 * 256);
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
441
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
442 for (i = 0; i < 18; ++i)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
443 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
444 val = 0;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
445 for (j = 0; j < 4; ++j)
2182
3cb515c62e9c Minor updates to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2180
diff changeset
446 val = (val << 8) | key[keypos++ % keylen];
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
447 pax[i] = ipa[i] ^ val;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
448 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
449
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
450 data_l = data_r = 0;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
451 for (i = 0; i < 18; i += 2)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
452 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
453 bf_e_block(&data_l, &data_r);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
454 pax[i + 0] = data_l;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
455 pax[i + 1] = data_r;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
456 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
457
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
458 for (i = 0; i < 4; ++i)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
459 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
460 for (j = 0; j < 256; j += 2)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
461 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
462 bf_e_block(&data_l, &data_r);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
463 sbx[i][j + 0] = data_l;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
464 sbx[i][j + 1] = data_r;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
465 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
466 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
467 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
468
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
469 /*
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
470 * BF Self test for corrupted tables or instructions
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
471 */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
472 static int
2271
2b33a7678e7b Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
Bram Moolenaar <bram@vim.org>
parents: 2267
diff changeset
473 bf_check_tables(a_ipa, a_sbi, val)
2b33a7678e7b Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
Bram Moolenaar <bram@vim.org>
parents: 2267
diff changeset
474 UINT32_T a_ipa[18];
2b33a7678e7b Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
Bram Moolenaar <bram@vim.org>
parents: 2267
diff changeset
475 UINT32_T a_sbi[4][256];
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
476 UINT32_T val;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
477 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
478 int i, j;
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
479 UINT32_T c = 0;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
480
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
481 for (i = 0; i < 18; i++)
2271
2b33a7678e7b Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
Bram Moolenaar <bram@vim.org>
parents: 2267
diff changeset
482 c ^= a_ipa[i];
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
483 for (i = 0; i < 4; i++)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
484 for (j = 0; j < 256; j++)
2271
2b33a7678e7b Fix compiler warnings for shadowed variables. Make 'conceal' a long instead
Bram Moolenaar <bram@vim.org>
parents: 2267
diff changeset
485 c ^= a_sbi[i][j];
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
486 return c == val;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
487 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
488
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
489 typedef struct {
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
490 char_u password[64];
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
491 char_u salt[9];
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
492 char_u plaintxt[9];
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
493 char_u cryptxt[9];
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
494 char_u badcryptxt[9]; /* cryptxt when big/little endian is wrong */
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
495 UINT32_T keysum;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
496 } struct_bf_test_data;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
497
2195
f9aec8acb188 Fix build on Cygwin and MingW.
Bram Moolenaar <bram@vim.org>
parents: 2184
diff changeset
498 /*
f9aec8acb188 Fix build on Cygwin and MingW.
Bram Moolenaar <bram@vim.org>
parents: 2184
diff changeset
499 * Assert bf(password, plaintxt) is cryptxt.
f9aec8acb188 Fix build on Cygwin and MingW.
Bram Moolenaar <bram@vim.org>
parents: 2184
diff changeset
500 * Assert csum(pax sbx(password)) is keysum.
f9aec8acb188 Fix build on Cygwin and MingW.
Bram Moolenaar <bram@vim.org>
parents: 2184
diff changeset
501 */
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
502 static struct_bf_test_data bf_test_data[] = {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
503 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
504 "password",
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
505 "salt",
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
506 "plaintxt",
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
507 "\xad\x3d\xfa\x7f\xe8\xea\x40\xf6", /* cryptxt */
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
508 "\x72\x50\x3b\x38\x10\x60\x22\xa7", /* badcryptxt */
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
509 0x56701b5du /* keysum */
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
510 },
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
511 };
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
512
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
513 /*
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
514 * Return FAIL when there is something wrong with blowfish encryption.
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
515 */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
516 static int
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
517 bf_self_test()
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
518 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
519 int i, bn;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
520 int err = 0;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
521 block8 bk;
2199
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
522 UINT32_T ui = 0xffffffffUL;
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
523
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
524 /* We can't simply use sizeof(UINT32_T), it would generate a compiler
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
525 * warning. */
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
526 if (ui != 0xffffffffUL || ui + 1 != 0) {
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
527 err++;
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
528 EMSG(_("E820: sizeof(uint32_t) != 4"));
014a996ac896 Use UINT32_T in the code, define it to uint32_t or unsigned int.
Bram Moolenaar <bram@vim.org>
parents: 2195
diff changeset
529 }
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
530
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
531 if (!bf_check_tables(ipa, sbi, 0x6ffa520a))
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
532 err++;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
533
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
534 bn = ARRAY_LENGTH(bf_test_data);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
535 for (i = 0; i < bn; i++)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
536 {
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
537 bf_key_init((char_u *)(bf_test_data[i].password),
2311
ccda151dde4e Support completion for ":find". (Nazri Ramliy)
Bram Moolenaar <bram@vim.org>
parents: 2271
diff changeset
538 bf_test_data[i].salt,
2265
b7cb69ab616d Added salt to blowfish encryption.
Bram Moolenaar <bram@vim.org>
parents: 2251
diff changeset
539 (int)STRLEN(bf_test_data[i].salt));
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
540 if (!bf_check_tables(pax, sbx, bf_test_data[i].keysum))
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
541 err++;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
542
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
543 /* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
544 memcpy(bk.uc, bf_test_data[i].plaintxt, 8);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
545 bf_e_cblock(bk.uc);
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
546 if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
547 {
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
548 if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
549 EMSG(_("E817: Blowfish big/little endian use wrong"));
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
550 err++;
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
551 }
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
552 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
553
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
554 return err > 0 ? FAIL : OK;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
555 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
556
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
557 /* Output feedback mode. */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
558 static int randbyte_offset = 0;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
559 static int update_offset = 0;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
560 static char_u ofb_buffer[BF_OFB_LEN]; /* 64 bytes */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
561
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
562 /*
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
563 * Initialize with seed "iv[iv_len]".
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
564 */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
565 void
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
566 bf_ofb_init(iv, iv_len)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
567 char_u *iv;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
568 int iv_len;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
569 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
570 int i, mi;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
571
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
572 randbyte_offset = update_offset = 0;
2215
cccb71c2c5c1 Fix uninit memory read in undo code. Fix uint32_t in proto file.
Bram Moolenaar <bram@vim.org>
parents: 2199
diff changeset
573 vim_memset(ofb_buffer, 0, BF_OFB_LEN);
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
574 if (iv_len > 0)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
575 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
576 mi = iv_len > BF_OFB_LEN ? iv_len : BF_OFB_LEN;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
577 for (i = 0; i < mi; i++)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
578 ofb_buffer[i % BF_OFB_LEN] ^= iv[i % iv_len];
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
579 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
580 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
581
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
582 #define BF_OFB_UPDATE(c) { \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
583 ofb_buffer[update_offset] ^= (char_u)c; \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
584 if (++update_offset == BF_OFB_LEN) \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
585 update_offset = 0; \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
586 }
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
587
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
588 #define BF_RANBYTE(t) { \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
589 if ((randbyte_offset & BF_BLOCK_MASK) == 0) \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
590 bf_e_cblock(&ofb_buffer[randbyte_offset]); \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
591 t = ofb_buffer[randbyte_offset]; \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
592 if (++randbyte_offset == BF_OFB_LEN) \
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
593 randbyte_offset = 0; \
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
594 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
595
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
596 /*
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
597 * Encrypt "from[len]" into "to[len]".
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
598 * "from" and "to" can be equal to encrypt in place.
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
599 */
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
600 void
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
601 bf_crypt_encode(from, len, to)
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
602 char_u *from;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
603 size_t len;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
604 char_u *to;
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
605 {
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
606 size_t i;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
607 int ztemp, t;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
608
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
609 for (i = 0; i < len; ++i)
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
610 {
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
611 ztemp = from[i];
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
612 BF_RANBYTE(t);
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
613 BF_OFB_UPDATE(ztemp);
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
614 to[i] = t ^ ztemp;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
615 }
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
616 }
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
617
2245
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
618 /*
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
619 * Decrypt "ptr[len]" in place.
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
620 */
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
621 void
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
622 bf_crypt_decode(ptr, len)
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
623 char_u *ptr;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
624 long len;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
625 {
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
626 char_u *p;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
627 int t;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
628
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
629 for (p = ptr; p < ptr + len; ++p)
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
630 {
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
631 BF_RANBYTE(t);
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
632 *p ^= t;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
633 BF_OFB_UPDATE(*p);
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
634 }
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
635 }
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
636
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
637 /*
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
638 * Initialize the encryption keys and the random header according to
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
639 * the given password.
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
640 */
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
641 void
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
642 bf_crypt_init_keys(passwd)
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
643 char_u *passwd; /* password string with which to modify keys */
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
644 {
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
645 char_u *p;
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
646
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
647 for (p = passwd; *p != NUL; ++p)
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
648 {
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
649 BF_OFB_UPDATE(*p);
4e0124f5aee2 Optimize the blowfish crypt/decrypt code a bit more.
Bram Moolenaar <bram@vim.org>
parents: 2244
diff changeset
650 }
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
651 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
652
2267
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
653 static int save_randbyte_offset;
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
654 static int save_update_offset;
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
655 static char_u save_ofb_buffer[BF_OFB_LEN];
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
656 static UINT32_T save_pax[18];
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
657 static UINT32_T save_sbx[4][256];
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
658
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
659 /*
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
660 * Save the current crypt state. Can only be used once before
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
661 * bf_crypt_restore().
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
662 */
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
663 void
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
664 bf_crypt_save()
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
665 {
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
666 save_randbyte_offset = randbyte_offset;
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
667 save_update_offset = update_offset;
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
668 mch_memmove(save_ofb_buffer, ofb_buffer, BF_OFB_LEN);
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
669 mch_memmove(save_pax, pax, 4 * 18);
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
670 mch_memmove(save_sbx, sbx, 4 * 4 * 256);
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
671 }
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
672
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
673 /*
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
674 * Restore the current crypt state. Can only be used after
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
675 * bf_crypt_save().
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
676 */
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
677 void
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
678 bf_crypt_restore()
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
679 {
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
680 randbyte_offset = save_randbyte_offset;
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
681 update_offset = save_update_offset;
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
682 mch_memmove(ofb_buffer, save_ofb_buffer, BF_OFB_LEN);
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
683 mch_memmove(pax, save_pax, 4 * 18);
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
684 mch_memmove(sbx, save_sbx, 4 * 4 * 256);
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
685 }
c08f91142c41 Crypt the swapfile.
Bram Moolenaar <bram@vim.org>
parents: 2265
diff changeset
686
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
687 /*
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
688 * Run a test to check if the encryption works as expected.
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
689 * Give an error and return FAIL when not.
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
690 */
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
691 int
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
692 blowfish_self_test()
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
693 {
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
694 if (sha256_self_test() == FAIL)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
695 {
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
696 EMSG(_("E818: sha256 test failed"));
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
697 return FAIL;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
698 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
699 if (bf_self_test() == FAIL)
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
700 {
2184
5028c4d6d825 Fixed encryption big/little endian test.
Bram Moolenaar <bram@vim.org>
parents: 2182
diff changeset
701 EMSG(_("E819: Blowfish test failed"));
2180
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
702 return FAIL;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
703 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
704 return OK;
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
705 }
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
706
f60a0c9cbe6c Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
707 #endif /* FEAT_CRYPT */