95 size_t tmplen; |
95 size_t tmplen; |
96 size_t tmpoff; |
96 size_t tmpoff; |
97 int end; |
97 int end; |
98 } AESEncrypter; |
98 } AESEncrypter; |
99 |
99 |
|
100 typedef struct DavHashContext DavHashContext; |
|
101 |
100 int dav_rand_bytes(unsigned char *buf, size_t len); |
102 int dav_rand_bytes(unsigned char *buf, size_t len); |
101 |
103 |
102 AESDecrypter* aes_decrypter_new(DavKey *key, void *stream, dav_write_func write_func); |
104 AESDecrypter* aes_decrypter_new(DavKey *key, void *stream, dav_write_func write_func); |
103 size_t aes_write(const void *buf, size_t s, size_t n, AESDecrypter *dec); |
105 size_t aes_write(const void *buf, size_t s, size_t n, AESDecrypter *dec); |
104 void aes_decrypter_shutdown(AESDecrypter *dec); |
106 void aes_decrypter_shutdown(AESDecrypter *dec); |
114 |
116 |
115 void dav_get_hash(DAV_SHA_CTX *sha256, unsigned char *buf); |
117 void dav_get_hash(DAV_SHA_CTX *sha256, unsigned char *buf); |
116 |
118 |
117 char* dav_create_hash(const char *data, size_t len); |
119 char* dav_create_hash(const char *data, size_t len); |
118 |
120 |
|
121 DAV_SHA_CTX* dav_hash_init(void); |
|
122 void dav_hash_update(DAV_SHA_CTX *ctx, const char *data, size_t len); |
|
123 void dav_hash_final(DAV_SHA_CTX *ctx, unsigned char *buf); |
|
124 |
119 DavKey* dav_pw2key(const char *password, const unsigned char *salt, int saltlen, int pwfunc, int enc); |
125 DavKey* dav_pw2key(const char *password, const unsigned char *salt, int saltlen, int pwfunc, int enc); |
120 |
126 |
121 UcxBuffer* aes_encrypt_buffer(UcxBuffer *buf, DavKey *key); |
127 UcxBuffer* aes_encrypt_buffer(UcxBuffer *buf, DavKey *key); |
122 UcxBuffer* aes_decrypt_buffer(UcxBuffer *buf, DavKey *key); |
128 UcxBuffer* aes_decrypt_buffer(UcxBuffer *buf, DavKey *key); |
123 |
129 |