#include "mac.h" unsigned char *pcp_derivekey(char *passphrase) { unsigned char *hash64 = ucmalloc(crypto_hash_BYTES); unsigned char *xor = ucmalloc(crypto_secretbox_KEYBYTES); unsigned char *key = ucmalloc(crypto_secretbox_KEYBYTES); size_t plen = strnlen(passphrase, 255); unsigned char *temp = ucmalloc(crypto_hash_BYTES); int i; // make a hash from the passphrase and then HCYCLES times from the result memcpy(temp, passphrase, plen); for(i=0; i