annotate src/crypt_zip.c @ 34686:83875247fbc0 v9.1.0224

patch 9.1.0224: cursor may move too many lines over "right" & "below" virt text Commit: https://github.com/vim/vim/commit/515f734e687f28f7199b2a8042197624d9f3ec15 Author: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Date: Thu Mar 28 12:01:14 2024 +0100 patch 9.1.0224: cursor may move too many lines over "right" & "below" virt text Problem: If a line has "right" & "below" virtual text properties, where the "below" property may be stored first due to lack of ordering between them, then the line height is calculated to be 1 more and causes the cursor to far over the line. Solution: Remove some unnecessary setting of a `next_right_goes_below = TRUE` flag for "below" and "above" text properties. (Dylan Thacker-Smith) I modified a regression test I recently added to cover this case, leveraging the fact that "after", "right" & "below" text properties are being stored in the reverse of the order they are added in. The previous version of this regression test was crafted to workaround this issue so it can be addressed by this separate patch. closes: #14317 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Mar 2024 12:15:03 +0100
parents 3d4e28569a6d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 7817
diff changeset
1 /* vi:set ts=8 sts=4 sw=4 noet:
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 *
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 *
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 * See README.txt for an overview of the Vim source code.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 */
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 * crypt_zip.c: Zip encryption support.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 */
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 #include "vim.h"
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 #if defined(FEAT_CRYPT) || defined(PROTO)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 * Optional encryption support.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 * Mohsin Ahmed, mosh@sasi.com, 98-09-24
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 * Based on zip/crypt sources.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 *
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 * most countries. There are a few exceptions, but that still should not be a
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 * problem since this code was originally created in Europe and India.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 */
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
18757
c469e1930456 patch 8.1.2368: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 16825
diff changeset
26 // Need a type that should be 32 bits. 64 also works but wastes space.
c469e1930456 patch 8.1.2368: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 16825
diff changeset
27 typedef unsigned int u32_T; // int is at least 32 bits
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28
18757
c469e1930456 patch 8.1.2368: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 16825
diff changeset
29 // The state of encryption, referenced by cryptstate_T.
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 typedef struct {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 u32_T keys[3];
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 } zip_state_T;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 static u32_T crc_32_table[256];
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 * Fill the CRC table, if not done already.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 */
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 static void
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
41 make_crc_tab(void)
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 u32_T s, t, v;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 static int done = FALSE;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 if (done)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 return;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 for (t = 0; t < 256; t++)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 v = t;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 for (s = 0; s < 8; s++)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 v = (v >> 1) ^ ((v & 1) * (u32_T)0xedb88320L);
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 crc_32_table[t] = v;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 done = TRUE;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 #define CRC32(c, b) (crc_32_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 * Return the next byte in the pseudo-random sequence.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 */
31804
50555279168b patch 9.0.1234: the code style has to be checked manually
Bram Moolenaar <Bram@vim.org>
parents: 24970
diff changeset
63 #define DECRYPT_BYTE_ZIP(keys, t) \
50555279168b patch 9.0.1234: the code style has to be checked manually
Bram Moolenaar <Bram@vim.org>
parents: 24970
diff changeset
64 { \
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 short_u temp = (short_u)keys[2] | 2; \
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 * Update the encryption keys with the next byte of plain text.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 */
16162
cd5c83115ec6 patch 8.1.1086: too many curly braces
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
72 #define UPDATE_KEYS_ZIP(keys, c) do { \
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 keys[0] = CRC32(keys[0], (c)); \
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 keys[1] += keys[0] & 0xff; \
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 keys[1] = keys[1] * 134775813L + 1; \
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
16162
cd5c83115ec6 patch 8.1.1086: too many curly braces
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
77 } while (0)
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 * Initialize for encryption/decryption.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 */
16429
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 16162
diff changeset
82 int
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
83 crypt_zip_init(
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
84 cryptstate_T *state,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
85 char_u *key,
32299
3d4e28569a6d patch 9.0.1481: decrypting with libsodium may fail if the library changes
Bram Moolenaar <Bram@vim.org>
parents: 31804
diff changeset
86 crypt_arg_T *arg UNUSED)
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 char_u *p;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 zip_state_T *zs;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90
16825
ce04ebdf26b8 patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
Bram Moolenaar <Bram@vim.org>
parents: 16429
diff changeset
91 zs = ALLOC_ONE(zip_state_T);
16429
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 16162
diff changeset
92 if (zs == NULL)
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 16162
diff changeset
93 return FAIL;
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94 state->method_state = zs;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96 make_crc_tab();
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97 zs->keys[0] = 305419896L;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98 zs->keys[1] = 591751049L;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
99 zs->keys[2] = 878082192L;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100 for (p = key; *p != NUL; ++p)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101 UPDATE_KEYS_ZIP(zs->keys, (int)*p);
16429
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 16162
diff changeset
102
a1229400434a patch 8.1.1219: not checking for NULL return from alloc()
Bram Moolenaar <Bram@vim.org>
parents: 16162
diff changeset
103 return OK;
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
104 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
106 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 * Encrypt "from[len]" into "to[len]".
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108 * "from" and "to" can be equal to encrypt in place.
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109 */
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
110 void
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
111 crypt_zip_encode(
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
112 cryptstate_T *state,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
113 char_u *from,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
114 size_t len,
24970
7e9e53a0368f patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents: 18757
diff changeset
115 char_u *to,
7e9e53a0368f patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents: 18757
diff changeset
116 int last UNUSED)
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
117 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
118 zip_state_T *zs = state->method_state;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
119 size_t i;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
120 int ztemp, t;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
121
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
122 for (i = 0; i < len; ++i)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
123 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
124 ztemp = from[i];
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
125 DECRYPT_BYTE_ZIP(zs->keys, t);
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
126 UPDATE_KEYS_ZIP(zs->keys, ztemp);
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
127 to[i] = t ^ ztemp;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
128 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
129 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
130
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
131 /*
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
132 * Decrypt "from[len]" into "to[len]".
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
133 */
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
134 void
7817
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
135 crypt_zip_decode(
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
136 cryptstate_T *state,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
137 char_u *from,
83861277e6a3 commit https://github.com/vim/vim/commit/7454a06e2642d2b37afad1c5e71cec68081ca4ff
Christian Brabandt <cb@256bit.org>
parents: 7799
diff changeset
138 size_t len,
24970
7e9e53a0368f patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents: 18757
diff changeset
139 char_u *to,
7e9e53a0368f patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents: 18757
diff changeset
140 int last UNUSED)
6122
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
141 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
142 zip_state_T *zs = state->method_state;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
143 size_t i;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
144 short_u temp;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
145
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
146 for (i = 0; i < len; ++i)
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
147 {
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
148 temp = (short_u)zs->keys[2] | 2;
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
149 temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
150 UPDATE_KEYS_ZIP(zs->keys, to[i] = from[i] ^ temp);
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
151 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
152 }
18ac55444b37 updated for version 7.4.399
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
153
18757
c469e1930456 patch 8.1.2368: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 16825
diff changeset
154 #endif // FEAT_CRYPT