42 #define MAX_KEY_LENGTH 256
43 #define PBKDF2_ITERATIONS 1000
59 for (j = 0; j < 8; j++) {
61 if (
ctx->counter[j] != 0) {
70 data[
i] ^=
ctx->pad[
ctx->pad_offset++];
84 switch (encryption_method) {
96 if (key_size == 0 || salt ==
NULL || password ==
NULL || password_length == 0) {
101 key_length = key_size / 8;
127 if (password_verify) {
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
void * malloc(size_t size)
_zip_crypto_hmac_t * hmac
zip_uint8_t pad[ZIP_CRYPTO_AES_BLOCK_LENGTH]
zip_uint8_t counter[ZIP_CRYPTO_AES_BLOCK_LENGTH]
void error(const char *msg)
#define ZIP_CRYPTO_AES_BLOCK_LENGTH
void _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac)
void _zip_crypto_aes_free(_zip_crypto_aes_t *aes)
_zip_crypto_aes_t * _zip_crypto_aes_new(const zip_uint8_t *key, zip_uint16_t key_size, zip_error_t *error)
_zip_crypto_hmac_t * _zip_crypto_hmac_new(const zip_uint8_t *secret, zip_uint64_t secret_length, zip_error_t *error)
#define _zip_crypto_hmac_output(hmac, data)
#define _zip_crypto_hmac(hmac, data, length)
#define _zip_crypto_pbkdf2(key, key_length, salt, salt_length, iterations, output, output_length)
#define _zip_crypto_aes_encrypt_block(aes, in, out)
bool _zip_winzip_aes_encrypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length)
bool _zip_winzip_aes_finish(zip_winzip_aes_t *ctx, zip_uint8_t *hmac)
void _zip_winzip_aes_free(zip_winzip_aes_t *ctx)
zip_winzip_aes_t * _zip_winzip_aes_new(const zip_uint8_t *password, zip_uint64_t password_length, const zip_uint8_t *salt, zip_uint16_t encryption_method, zip_uint8_t *password_verify, zip_error_t *error)
bool _zip_winzip_aes_decrypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length)
#define PBKDF2_ITERATIONS
static bool aes_crypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length)
#define _zip_crypto_clear(b, l)
#define WINZIP_AES_PASSWORD_VERIFY_LENGTH