Introduction
This is the API documentation of libpcp, the library behind Pretty Curved Privacy (pcp). The library can be used independently of pcp to manage keys and to encrypt or sign files or buffers.
For most actual crypto related things, libpcp uses libsodium, the portable NaCL library.
Sample usage
Example use of the libpcp library:
#include <pcp.h>
int main() {
char message[] = "hello world";
printf("hh: %ld\n", sizeof(UT_hash_handle));
pubhash = NULL;
HASH_ADD_STR( pubhash, id, bobpub);
fprintf(stderr, "Alice encrypted %"FMT_SIZE_T" bytes for Bob:\n", (SIZE_T_CAST)strlen(message));
else {
fprintf(stderr,
"Bob decrypted %"FMT_SIZE_T
" bytes from Alice:\n", (SIZE_T_CAST)
buffer_size(
ps_buffer(crypt_out)));
}
free(alice);
free(alicepub);
free(bob);
free(bobpub);
return 0;
}
To compile the example, use the following commands:
g++ -c sample.o `pkg-config --cflags libpcp1`
g++ sample.o `pkg-config --libs libpcp1` -o sample