summaryrefslogtreecommitdiff
path: root/missing
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-31 16:49:30 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-31 16:49:30 (GMT)
commitccea383a589571d41587af79b90e79cfc41295c0 (patch)
tree090f2399762696b9fe7e85f38101a27e93fff180 /missing
parent1978ce784b44e9e0ff376779629714cbad3dd756 (diff)
crypt.c: constify
* missing/crypt.c: constify Standard DES Tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/crypt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/missing/crypt.c b/missing/crypt.c
index 366fba0..97acbb9 100644
--- a/missing/crypt.c
+++ b/missing/crypt.c
@@ -326,7 +326,7 @@ permute(cp, out, p, chars_in)
/* ===== (mostly) Standard DES Tables ==================== */
-static unsigned char IP[] = { /* initial permutation */
+static const unsigned char IP[] = { /* initial permutation */
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,
@@ -339,7 +339,7 @@ static unsigned char IP[] = { /* initial permutation */
/* The final permutation is the inverse of IP - no table is necessary */
-static unsigned char ExpandTr[] = { /* expansion operation */
+static const unsigned char ExpandTr[] = { /* expansion operation */
32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
@@ -350,7 +350,7 @@ static unsigned char ExpandTr[] = { /* expansion operation */
28, 29, 30, 31, 32, 1,
};
-static unsigned char PC1[] = { /* permuted choice table 1 */
+static const unsigned char PC1[] = { /* permuted choice table 1 */
57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
@@ -362,12 +362,12 @@ static unsigned char PC1[] = { /* permuted choice table 1 */
21, 13, 5, 28, 20, 12, 4,
};
-static unsigned char Rotates[] = { /* PC1 rotation schedule */
+static const unsigned char Rotates[] = { /* PC1 rotation schedule */
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1,
};
/* note: each "row" of PC2 is left-padded with bits that make it invertible */
-static unsigned char PC2[] = { /* permuted choice table 2 */
+static const unsigned char PC2[] = { /* permuted choice table 2 */
9, 18, 14, 17, 11, 24, 1, 5,
22, 25, 3, 28, 15, 6, 21, 10,
35, 38, 23, 19, 12, 4, 26, 8,
@@ -379,7 +379,7 @@ static unsigned char PC2[] = { /* permuted choice table 2 */
0, 0, 46, 42, 50, 36, 29, 32,
};
-static unsigned char S[8][64] = { /* 48->32 bit substitution tables */
+static const unsigned char S[8][64] = { /* 48->32 bit substitution tables */
{
/* S[1] */
14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
@@ -438,7 +438,7 @@ static unsigned char S[8][64] = { /* 48->32 bit substitution tables */
},
};
-static unsigned char P32Tr[] = { /* 32-bit permutation function */
+static const unsigned char P32Tr[] = { /* 32-bit permutation function */
16, 7, 20, 21,
29, 12, 28, 17,
1, 15, 23, 26,
@@ -449,7 +449,7 @@ static unsigned char P32Tr[] = { /* 32-bit permutation function */
22, 11, 4, 25,
};
-static unsigned char CIFP[] = { /* compressed/interleaved permutation */
+static const unsigned char CIFP[] = { /* compressed/interleaved permutation */
1, 2, 3, 4, 17, 18, 19, 20,
5, 6, 7, 8, 21, 22, 23, 24,
9, 10, 11, 12, 25, 26, 27, 28,
@@ -461,7 +461,7 @@ static unsigned char CIFP[] = { /* compressed/interleaved permutation */
45, 46, 47, 48, 61, 62, 63, 64,
};
-static unsigned char itoa64[] = /* 0..63 => ascii-64 */
+static const unsigned char itoa64[] = /* 0..63 => ascii-64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";