A library for a decentralised peer-to-peer chat over IPv6 only.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

lc6_crypto.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef LC6_SSL_H
  2. #define LC6_SSL_H
  3. #include <sodium.h>
  4. #include "../inc/lc6_common.h"
  5. int lc6crypto_init(void);
  6. int lc6crypto_encrypt(
  7. const unsigned char *data,
  8. const int data_len,
  9. const unsigned char *skey,
  10. const unsigned char *dkey,
  11. unsigned char **enc_data,
  12. unsigned char **nonce);
  13. int lc6crypto_decrypt(
  14. const unsigned char *enc_data,
  15. const int enc_len,
  16. const unsigned char *skey,
  17. const unsigned char *dkey,
  18. unsigned char **data,
  19. const unsigned char *nonce);
  20. int lc6crypto_readfile(
  21. const char *file,
  22. const unsigned char *password,
  23. unsigned char **data,
  24. int *data_len);
  25. int lc6crypto_writefile(
  26. const char *file,
  27. const unsigned char *password,
  28. const unsigned char *data,
  29. const int data_len);
  30. LC6_USER* lc6crypto_genuserkey(LC6_USER*);
  31. unsigned char* lc6crypto_hash(unsigned char*, int);
  32. void lc6crypto_random(unsigned char*, int);
  33. #define LC6_CRYPTO_HASHLEN crypto_generichash_BYTES
  34. #define LC6_CRYPTO_HASHSIGNLEN (crypto_secretbox_NONCEBYTES+crypto_box_MACBYTES+crypto_generichash_BYTES)
  35. #endif