Type of pcrc_32_tab (bug #44)
This commit is contained in:
parent
b353a8084e
commit
1508fdcd87
3 changed files with 6 additions and 6 deletions
|
@ -34,7 +34,7 @@
|
|||
/***********************************************************************
|
||||
* Return the next byte in the pseudo-random sequence
|
||||
*/
|
||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab UNUSED)
|
||||
static int decrypt_byte(unsigned long* pkeys, const z_crc_t FAR * pcrc_32_tab UNUSED)
|
||||
{
|
||||
//(void) pcrc_32_tab; /* avoid "unused parameter" warning */
|
||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||
|
@ -48,7 +48,7 @@ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab U
|
|||
/***********************************************************************
|
||||
* Update the encryption keys with the next byte of plain text
|
||||
*/
|
||||
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
|
||||
static int update_keys(unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab,int c)
|
||||
{
|
||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
||||
|
@ -65,7 +65,7 @@ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int
|
|||
* Initialize the encryption keys and the random header according to
|
||||
* the given password.
|
||||
*/
|
||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
|
||||
static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab)
|
||||
{
|
||||
*(pkeys+0) = 305419896L;
|
||||
*(pkeys+1) = 591751049L;
|
||||
|
@ -95,7 +95,7 @@ static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
|||
unsigned char *buf; /* where to write header */
|
||||
int bufSize;
|
||||
unsigned long* pkeys;
|
||||
const unsigned long* pcrc_32_tab;
|
||||
const z_crc_t FAR * pcrc_32_tab;
|
||||
unsigned long crcForCrypting;
|
||||
{
|
||||
int n; /* index in random header */
|
||||
|
|
|
@ -184,7 +184,7 @@ typedef struct
|
|||
|
||||
# ifndef NOUNCRYPT
|
||||
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
|
||||
const unsigned long* pcrc_32_tab;
|
||||
const z_crc_t FAR * pcrc_32_tab;
|
||||
# endif
|
||||
} unz64_s;
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ typedef struct
|
|||
ZPOS64_T totalUncompressedData;
|
||||
#ifndef NOCRYPT
|
||||
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
|
||||
const unsigned long* pcrc_32_tab;
|
||||
const z_crc_t FAR * pcrc_32_tab;
|
||||
int crypt_header_size;
|
||||
#endif
|
||||
} curfile64_info;
|
||||
|
|
Loading…
Reference in a new issue