libchat6
lc6_crypto.h
1 #ifndef LC6_SSL_H
2 #define LC6_SSL_H
3 
4 #include <sodium.h>
5 #include "../inc/lc6_common.h"
6 
7 int lc6crypto_init(void);
8 
9 int lc6crypto_genrequestsessionkey(LC6_USER *user, LC6_FRIEND *friend);
10 int lc6crypto_genresponsesessionkey(LC6_USER *user, LC6_FRIEND *friend);
11 
12 int lc6crypto_encrypt(
13  const unsigned char *data,
14  const int data_len,
15  const unsigned char *skey,
16  const unsigned char *dkey,
17  unsigned char **enc_data,
18  unsigned char **nonce);
19 
20 int lc6crypto_decrypt(
21  const unsigned char *enc_data,
22  const int enc_len,
23  const unsigned char *skey,
24  const unsigned char *dkey,
25  unsigned char **data,
26  const unsigned char *nonce);
27 
28 int lc6crypto_readfile(
29  const char *file,
30  const unsigned char *password,
31  unsigned char **data,
32  int *data_len);
33 
34 int lc6crypto_writefile(
35  const char *file,
36  const unsigned char *password,
37  const unsigned char *data,
38  const int data_len);
39 
40 LC6_USER* lc6crypto_genuserkey(LC6_USER*);
41 LC6_NODE* lc6crypto_gennodekey(LC6_NODE*);
42 
43 unsigned char* lc6crypto_hash(unsigned char*, int);
44 
45 void lc6crypto_random(unsigned char*, int);
46 
47 #endif
Definition: lc6_common.h:38
Definition: lc6_common.h:47
Definition: lc6_common.h:26