diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:26:49 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:26:49 -0700 |
commit | d004b047838a7e803818b4973a2e39e0ff8c1fa2 (patch) | |
tree | 9e8c804f78d73152c70d4ff24c6a7531a0d46782 /contrib/minizip/crypt.h | |
parent | f6194ef39af5864f792412460c354cc339dde7d1 (diff) | |
download | zlib-1.2.3.5.tar.gz zlib-1.2.3.5.tar.bz2 zlib-1.2.3.5.zip |
zlib 1.2.3.5v1.2.3.5
Diffstat (limited to 'contrib/minizip/crypt.h')
-rw-r--r-- | contrib/minizip/crypt.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/contrib/minizip/crypt.h b/contrib/minizip/crypt.h index 622f4bc..679e2a1 100644 --- a/contrib/minizip/crypt.h +++ b/contrib/minizip/crypt.h | |||
@@ -87,13 +87,12 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned lon | |||
87 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ | 87 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ |
88 | # endif | 88 | # endif |
89 | 89 | ||
90 | static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) | 90 | static int crypthead(const char* passwd, /* password string */ |
91 | const char *passwd; /* password string */ | 91 | unsigned char* buf, /* where to write header */ |
92 | unsigned char *buf; /* where to write header */ | 92 | int bufSize, |
93 | int bufSize; | 93 | unsigned long* pkeys, |
94 | unsigned long* pkeys; | 94 | const unsigned long* pcrc_32_tab, |
95 | const unsigned long* pcrc_32_tab; | 95 | unsigned long crcForCrypting) |
96 | unsigned long crcForCrypting; | ||
97 | { | 96 | { |
98 | int n; /* index in random header */ | 97 | int n; /* index in random header */ |
99 | int t; /* temporary */ | 98 | int t; /* temporary */ |
@@ -124,8 +123,8 @@ static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) | |||
124 | { | 123 | { |
125 | buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); | 124 | buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); |
126 | } | 125 | } |
127 | buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); | 126 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); |
128 | buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); | 127 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); |
129 | return n; | 128 | return n; |
130 | } | 129 | } |
131 | 130 | ||