Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdlib.h>
#include <limits.h>
#include "zipint.h"
#include "zip_crypto.h"
#include <windows.h>
#include <bcrypt.h>
Go to the source code of this file.
Classes | |
struct | _zip_crypto_aes_s |
struct | _zip_crypto_hmac_s |
Macros | |
#define | WIN32_LEAN_AND_MEAN |
#define | NOCRYPT |
#define | HAS_BCRYPTDERIVEKEYPBKDF2 |
Functions | |
bool | _zip_crypto_pbkdf2 (const zip_uint8_t *key, zip_uint64_t key_length, const zip_uint8_t *salt, zip_uint16_t salt_length, zip_uint16_t iterations, zip_uint8_t *output, zip_uint16_t output_length) |
_zip_crypto_aes_t * | _zip_crypto_aes_new (const zip_uint8_t *key, zip_uint16_t key_size, zip_error_t *error) |
void | _zip_crypto_aes_free (_zip_crypto_aes_t *aes) |
bool | _zip_crypto_aes_encrypt_block (_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out) |
_zip_crypto_hmac_t * | _zip_crypto_hmac_new (const zip_uint8_t *secret, zip_uint64_t secret_length, zip_error_t *error) |
void | _zip_crypto_hmac_free (_zip_crypto_hmac_t *hmac) |
bool | _zip_crypto_hmac (_zip_crypto_hmac_t *hmac, zip_uint8_t *data, zip_uint64_t length) |
bool | _zip_crypto_hmac_output (_zip_crypto_hmac_t *hmac, zip_uint8_t *data) |
ZIP_EXTERN bool | zip_secure_random (zip_uint8_t *buffer, zip_uint16_t length) |
#define HAS_BCRYPTDERIVEKEYPBKDF2 |
Definition at line 85 of file zip_crypto_win.c.
#define NOCRYPT |
Definition at line 41 of file zip_crypto_win.c.
#define WIN32_LEAN_AND_MEAN |
Definition at line 40 of file zip_crypto_win.c.
bool _zip_crypto_aes_encrypt_block | ( | _zip_crypto_aes_t * | aes, |
const zip_uint8_t * | in, | ||
zip_uint8_t * | out | ||
) |
Definition at line 373 of file zip_crypto_win.c.
References in, NULL, out, status, ULONG, and ZIP_CRYPTO_AES_BLOCK_LENGTH.
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 | ||
) |
Definition at line 310 of file zip_crypto_win.c.
References _zip_crypto_aes_free(), calloc(), error(), key, malloc(), NULL, ULONG, ZIP_ER_MEMORY, and zip_error_set().
bool _zip_crypto_hmac | ( | _zip_crypto_hmac_t * | hmac, |
zip_uint8_t * | data, | ||
zip_uint64_t | length | ||
) |
Definition at line 475 of file zip_crypto_win.c.
References _zip_crypto_hmac_s::hHash, length, NULL, and ULONG.
void _zip_crypto_hmac_free | ( | _zip_crypto_hmac_t * | hmac | ) |
Definition at line 450 of file zip_crypto_win.c.
References free(), _zip_crypto_hmac_s::hAlgorithm, _zip_crypto_hmac_s::hHash, NULL, _zip_crypto_hmac_s::pbHash, and _zip_crypto_hmac_s::pbHashObject.
Referenced by _zip_crypto_hmac_new().
_zip_crypto_hmac_t* _zip_crypto_hmac_new | ( | const zip_uint8_t * | secret, |
zip_uint64_t | secret_length, | ||
zip_error_t * | error | ||
) |
Definition at line 391 of file zip_crypto_win.c.
References _zip_crypto_hmac_free(), calloc(), _zip_crypto_hmac_s::cbHash, _zip_crypto_hmac_s::cbHashObject, error(), _zip_crypto_hmac_s::hAlgorithm, _zip_crypto_hmac_s::hHash, INT_MAX, malloc(), NULL, _zip_crypto_hmac_s::pbHash, _zip_crypto_hmac_s::pbHashObject, status, ULONG, ZIP_ER_INVAL, ZIP_ER_MEMORY, and zip_error_set().
bool _zip_crypto_hmac_output | ( | _zip_crypto_hmac_t * | hmac, |
zip_uint8_t * | data | ||
) |
Definition at line 484 of file zip_crypto_win.c.
References _zip_crypto_hmac_s::cbHash, _zip_crypto_hmac_s::hHash, and NULL.
bool _zip_crypto_pbkdf2 | ( | const zip_uint8_t * | key, |
zip_uint64_t | key_length, | ||
const zip_uint8_t * | salt, | ||
zip_uint16_t | salt_length, | ||
zip_uint16_t | iterations, | ||
zip_uint8_t * | output, | ||
zip_uint16_t | output_length | ||
) |
Definition at line 91 of file zip_crypto_win.c.
ZIP_EXTERN bool zip_secure_random | ( | zip_uint8_t * | buffer, |
zip_uint16_t | length | ||
) |
Definition at line 493 of file zip_crypto_win.c.