1111 * modification, are permitted provided that the following conditions
1212 * are met:
1313 * 1. Redistributions of source code must retain the above copyright
14- * notice, this list of conditions and the following disclaimer.
14+ * notice, this list of conditions and the following disclaimer.
1515 * 2. Redistributions in binary form must reproduce the above copyright
16- * notice, this list of conditions and the following disclaimer in the
17- * documentation and/or other materials provided with the distribution.
18- * 3. All advertising materials mentioning features or use of this software
19- * must display the following acknowledgement:
20- *This product includes software developed by the University of
21- *California, Berkeley and its contributors.
22- * 4. Neither the name of the University nor the names of its contributors
23- * may be used to endorse or promote products derived from this software
24- * without specific prior written permission.
16+ * notice, this list of conditions and the following disclaimer in the
17+ * documentation and/or other materials provided with the distribution.
18+ * 3. Neither the name of the University nor the names of its contributors
19+ * may be used to endorse or promote products derived from this software
20+ * without specific prior written permission.
2521 *
2622 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2723 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2824 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3026 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3127 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3228 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -337,7 +333,7 @@ intchars_in;
337333
338334/* ===== (mostly) Standard DES Tables ==================== */
339335
340- static unsignedchar IP []= {/* initial permutation */
336+ static const unsignedchar IP []= {/* initial permutation */
34133758 ,50 ,42 ,34 ,26 ,18 ,10 ,2 ,
34233860 ,52 ,44 ,36 ,28 ,20 ,12 ,4 ,
34333962 ,54 ,46 ,38 ,30 ,22 ,14 ,6 ,
@@ -350,7 +346,7 @@ static unsigned char IP[] = {/* initial permutation */
350346
351347/* The final permutation is the inverse of IP - no table is necessary */
352348
353- static unsignedchar ExpandTr []= {/* expansion operation */
349+ static const unsignedchar ExpandTr []= {/* expansion operation */
35435032 ,1 ,2 ,3 ,4 ,5 ,
3553514 ,5 ,6 ,7 ,8 ,9 ,
3563528 ,9 ,10 ,11 ,12 ,13 ,
@@ -361,7 +357,7 @@ static unsigned char ExpandTr[] = {/* expansion operation */
36135728 ,29 ,30 ,31 ,32 ,1 ,
362358};
363359
364- static unsignedchar PC1 []= {/* permuted choice table 1 */
360+ static const unsignedchar PC1 []= {/* permuted choice table 1 */
36536157 ,49 ,41 ,33 ,25 ,17 ,9 ,
3663621 ,58 ,50 ,42 ,34 ,26 ,18 ,
36736310 ,2 ,59 ,51 ,43 ,35 ,27 ,
@@ -373,12 +369,12 @@ static unsigned char PC1[] = {/* permuted choice table 1 */
37336921 ,13 ,5 ,28 ,20 ,12 ,4 ,
374370};
375371
376- static unsignedchar Rotates []= {/* PC1 rotation schedule */
372+ static const unsignedchar Rotates []= {/* PC1 rotation schedule */
3773731 ,1 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,
378374};
379375
380376/* note: each "row" of PC2 is left-padded with bits that make it invertible */
381- static unsignedchar PC2 []= {/* permuted choice table 2 */
377+ static const unsignedchar PC2 []= {/* permuted choice table 2 */
3823789 ,18 ,14 ,17 ,11 ,24 ,1 ,5 ,
38337922 ,25 ,3 ,28 ,15 ,6 ,21 ,10 ,
38438035 ,38 ,23 ,19 ,12 ,4 ,26 ,8 ,
@@ -390,7 +386,7 @@ static unsigned char PC2[] = {/* permuted choice table 2 */
3903860 ,0 ,46 ,42 ,50 ,36 ,29 ,32 ,
391387};
392388
393- static unsignedchar S [8 ][64 ]= {/* 48->32 bit substitution tables */
389+ static const unsignedchar S [8 ][64 ]= {/* 48->32 bit substitution tables */
394390/* S[1]*/
395391{14 ,4 ,13 ,1 ,2 ,15 ,11 ,8 ,3 ,10 ,6 ,12 ,5 ,9 ,0 ,7 ,
3963920 ,15 ,7 ,4 ,14 ,2 ,13 ,1 ,10 ,6 ,12 ,11 ,9 ,5 ,3 ,8 ,
@@ -433,7 +429,7 @@ static unsigned char S[8][64] = {/* 48->32 bit substitution tables */
4334292 ,1 ,14 ,7 ,4 ,10 ,8 ,13 ,15 ,12 ,9 ,0 ,3 ,5 ,6 ,11 }
434430};
435431
436- static unsignedchar P32Tr []= {/* 32-bit permutation function */
432+ static const unsignedchar P32Tr []= {/* 32-bit permutation function */
43743316 ,7 ,20 ,21 ,
43843429 ,12 ,28 ,17 ,
4394351 ,15 ,23 ,26 ,
@@ -444,7 +440,7 @@ static unsigned char P32Tr[] = {/* 32-bit permutation function */
44444022 ,11 ,4 ,25 ,
445441};
446442
447- static unsignedchar CIFP []= {/* compressed/interleaved permutation */
443+ static const unsignedchar CIFP []= {/* compressed/interleaved permutation */
4484441 ,2 ,3 ,4 ,17 ,18 ,19 ,20 ,
4494455 ,6 ,7 ,8 ,21 ,22 ,23 ,24 ,
4504469 ,10 ,11 ,12 ,25 ,26 ,27 ,28 ,
@@ -456,7 +452,7 @@ static unsigned char CIFP[] = { /* compressed/interleaved permutation */
45645245 ,46 ,47 ,48 ,61 ,62 ,63 ,64 ,
457453};
458454
459- static unsignedchar itoa64 []= /* 0..63 => ascii-64 */
455+ static const unsignedchar itoa64 []= /* 0..63 => ascii-64 */
460456"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
461457
462458