diff -r 6ab1f4ad2835 -r 6bf798ad3aec libidav/crypto.h --- a/libidav/crypto.h Thu Sep 06 12:51:37 2018 +0200 +++ b/libidav/crypto.h Sat Sep 15 11:56:36 2018 +0200 @@ -67,6 +67,11 @@ extern "C" { #endif +#define DAV_PWFUNC_PBKDF2_SHA256 0 +#define DAV_PWFUNC_PBKDF2_SHA512 1 + +#define DAV_CRYPTO_ITERATION_COUNT 4000 + typedef struct { DAV_AES_CTX ctx; DAV_SHA_CTX sha256; @@ -109,6 +114,11 @@ char* dav_create_hash(const char *data, size_t len); +DavKey* dav_pw2key(const char *password, const char *salt, int saltlen, int pwfunc, int enc); + +UcxBuffer* aes_encrypt_buffer(UcxBuffer *buf, DavKey *key); +UcxBuffer* aes_decrypt_buffer(UcxBuffer *buf, DavKey *key); + #ifdef __cplusplus } #endif