mirror of
https://github.com/zlib-ng/minizip-ng
synced 2025-03-28 21:13:18 +00:00
Allow building without libbsd on Linux when NOCRYPT symbol is defined.
This commit is contained in:
parent
4966c4d65f
commit
b276027de0
2
crypt.c
2
crypt.c
@ -84,6 +84,7 @@ void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab)
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef NOCRYPT
|
||||
int cryptrand(unsigned char *buf, unsigned int len)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
@ -140,5 +141,6 @@ int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
|
||||
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify2, t);
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
|
2
crypt.h
2
crypt.h
@ -48,12 +48,14 @@ uint8_t update_keys(uint32_t *pkeys, const z_crc_t *pcrc_32_tab, int32_t c);
|
||||
/* Initialize the encryption keys and the random header according to the given password. */
|
||||
void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab);
|
||||
|
||||
#ifndef NOCRYPT
|
||||
/* Generate cryptographically secure random numbers */
|
||||
int cryptrand(unsigned char *buf, unsigned int len);
|
||||
|
||||
/* Create encryption header */
|
||||
int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
|
||||
const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2);
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user