1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef LC6_SSL_H
- #define LC6_SSL_H
-
- #include <sodium.h>
- #include "../inc/lc6_common.h"
-
- int lc6crypto_init(void);
-
- int lc6crypto_genrequestsessionkey(LC6_USER *user, LC6_FRIEND *friend);
- int lc6crypto_genresponsesessionkey(LC6_USER *user, LC6_FRIEND *friend);
-
- int lc6crypto_encrypt(
- const unsigned char *data,
- const int data_len,
- const unsigned char *skey,
- const unsigned char *dkey,
- unsigned char **enc_data,
- unsigned char **nonce);
-
- int lc6crypto_decrypt(
- const unsigned char *enc_data,
- const int enc_len,
- const unsigned char *skey,
- const unsigned char *dkey,
- unsigned char **data,
- const unsigned char *nonce);
-
- int lc6crypto_readfile(
- const char *file,
- const unsigned char *password,
- unsigned char **data,
- int *data_len);
-
- int lc6crypto_writefile(
- const char *file,
- const unsigned char *password,
- const unsigned char *data,
- const int data_len);
-
- LC6_USER* lc6crypto_genuserkey(LC6_USER*);
- LC6_NODE* lc6crypto_gennodekey(LC6_NODE*);
-
- unsigned char* lc6crypto_hash(unsigned char*, int);
-
- void lc6crypto_random(unsigned char*, int);
-
- #endif
|