84#define MPDC_CRYPTO_PHASH_CPU_COST 4
90#define MPDC_CRYPTO_PHASH_MEMORY_COST 1
163MPDC_EXPORT_API
void mpdc_crypto_generate_mac_code(
char* output,
size_t outlen,
const char* message,
size_t msglen,
const char* key,
size_t keylen);
177MPDC_EXPORT_API
void mpdc_crypto_hash_password(
char* output,
size_t outlen,
const char* username,
size_t userlen,
const char* password,
size_t passlen);
206MPDC_EXPORT_API
bool mpdc_crypto_password_verify(
const char* username,
size_t userlen,
const char* password,
size_t passlen,
const char* hash,
size_t hashlen);
MPDC_EXPORT_API uint8_t * mpdc_crypto_secure_memory_allocate(size_t length)
Allocate a block of secure memory.
Definition crypto.c:12
MPDC_EXPORT_API void mpdc_crypto_generate_hash_code(char *output, const char *message, size_t msglen)
Hash a message and write the resulting hash to an output array.
Definition crypto.c:145
MPDC_EXPORT_API void mpdc_crypto_generate_application_salt(uint8_t *output, size_t outlen)
Generate a user-unique application salt from OS sources.
Definition crypto.c:125
MPDC_EXPORT_API void mpdc_crypto_secure_memory_deallocate(uint8_t *block, size_t length)
Release an allocated block of secure memory.
Definition crypto.c:33
MPDC_EXPORT_API bool mpdc_crypto_password_verify(const char *username, size_t userlen, const char *password, size_t passlen, const char *hash, size_t hashlen)
Verify a password against a stored hash.
Definition crypto.c:239
MPDC_EXPORT_API bool mpdc_crypto_decrypt_stream(uint8_t *output, const uint8_t *seed, const uint8_t *input, size_t length)
Decrypt a stream of bytes.
Definition crypto.c:71
MPDC_EXPORT_API void mpdc_crypto_hash_password(char *output, size_t outlen, const char *username, size_t userlen, const char *password, size_t passlen)
Hash a password and user name.
Definition crypto.c:172
MPDC_EXPORT_API void mpdc_crypto_generate_application_keychain(uint8_t *seed, size_t seedlen, const char *password, size_t passlen, const char *username, size_t userlen)
Generate a secure application key chain.
Definition crypto.c:46
MPDC_EXPORT_API bool mpdc_crypto_password_minimum_check(const char *password, size_t passlen)
Check a password for a minimum secure threshold.
Definition crypto.c:190
MPDC_EXPORT_API void mpdc_crypto_generate_mac_code(char *output, size_t outlen, const char *message, size_t msglen, const char *key, size_t keylen)
Compute a MAC (Message Authentication Code) for a message.
Definition crypto.c:157
MPDC_EXPORT_API void mpdc_crypto_encrypt_stream(uint8_t *output, const uint8_t *seed, const uint8_t *input, size_t length)
Encrypt a stream of bytes.
Definition crypto.c:101
MPDC Common Definitions and Protocol Configuration.