diff -r 509e9e1cbdcc -r 37fb12574acd libidav/crypto.h --- a/libidav/crypto.h Sat Oct 03 20:10:54 2015 +0200 +++ b/libidav/crypto.h Sun Oct 04 15:57:40 2015 +0200 @@ -33,12 +33,19 @@ #include #include +#ifdef __sun +#include +#else +#include +#endif + #ifdef __cplusplus extern "C" { #endif typedef struct { EVP_CIPHER_CTX ctx; + SHA256_CTX sha256; void *stream; dav_write_func write; DavKey *key; @@ -49,6 +56,7 @@ typedef struct { EVP_CIPHER_CTX ctx; + SHA256_CTX sha256; void *iv; size_t ivlen; void *stream; @@ -68,8 +76,10 @@ size_t aes_read(void *buf, size_t s, size_t n, AESEncrypter *enc); void aes_encrypter_close(AESEncrypter *enc); -char* aes_encrypt(char *in, DavKey *key); -char* aes_decrypt(char *in, DavKey *key); +char* aes_encrypt(char *in, size_t len, DavKey *key); +char* aes_decrypt(char *in, size_t *len, DavKey *key); + +void dav_get_hash(SHA256_CTX *sha256, char *buf); #ifdef __cplusplus }